Index: trunk/extensions/ConfirmAccount/SpecialConfirmAccount.php |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | <?php
|
3 | | -#(c) Aaron Schulz
|
| 3 | +#(c) Aaron Schulz 2007, GPL
|
4 | 4 |
|
5 | 5 | if ( !defined( 'MEDIAWIKI' ) ) {
|
6 | 6 | echo "ConfirmAccount extension\n";
|
— | — | @@ -21,10 +21,14 @@ |
22 | 22 |
|
23 | 23 | # Set the person's bio as their userpage?
|
24 | 24 | $wgMakeUserPageFromBio = true;
|
| 25 | +# Make the username of the real name?
|
| 26 | +$wgUseRealNamesOnly = true;
|
25 | 27 | $wgSaveRejectedAccountReqs = true;
|
26 | 28 | $wgRejectedAccountMaxAge = 7 * 24 * 3600; // One week
|
27 | 29 | # How many requests can an IP make at once?
|
28 | 30 | $wgAccountRequestThrottle = 1;
|
| 31 | +# Minimum biography specs
|
| 32 | +$wgAccountRequestMinWords = 50;
|
29 | 33 |
|
30 | 34 | $wgGroupPermissions['*']['createaccount'] = false;
|
31 | 35 | $wgGroupPermissions['sysop']['createaccount'] = false;
|
— | — | @@ -57,11 +61,9 @@ |
58 | 62 | $dup = $dbw->selectField( 'account_requests', '1',
|
59 | 63 | array( 'acr_name' => $user->getName() ),
|
60 | 64 | __METHOD__ );
|
61 | | -
|
62 | 65 | if ( $dup ) {
|
63 | 66 | $abortError = wfMsgHtml('requestaccount-inuse');
|
64 | 67 | }
|
65 | | -
|
66 | 68 | return true;
|
67 | 69 | }
|
68 | 70 |
|
Index: trunk/extensions/ConfirmAccount/ConfirmAccount_body.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | }
|
16 | 16 |
|
17 | 17 | function execute( $subpage ) {
|
18 | | - global $wgUser, $wgOut, $wgRequest, $action ;
|
| 18 | + global $wgUser, $wgOut, $wgRequest, $action, $wgUseRealNamesOnly;
|
19 | 19 |
|
20 | 20 | if( $wgUser->isBlocked() ) {
|
21 | 21 | $wgOut->blockedPage();
|
— | — | @@ -26,13 +26,20 @@ |
27 | 27 | }
|
28 | 28 |
|
29 | 29 | $this->setHeaders();
|
30 | | -
|
31 | | - $this->mUsername = $wgRequest->getText( 'wpUsername' );
|
| 30 | + # We may only want real names being used
|
| 31 | + if( $wgUseRealNamesOnly )
|
| 32 | + $this->mUsername = $wgRequest->getText( 'wpRealName' );
|
| 33 | + else
|
| 34 | + $this->mUsername = $wgRequest->getText( 'wpUsername' );
|
| 35 | + # Grab other info fields...
|
32 | 36 | $this->mRealName = $wgRequest->getText( 'wpRealName' );
|
33 | 37 | $this->mEmail = $wgRequest->getText( 'wpEmail' );
|
34 | 38 | $this->mBio = $wgRequest->getText( 'wpBio' );
|
35 | 39 | $this->mNotes = $wgRequest->getText( 'wpNotes' );
|
36 | 40 | $this->mUrls = $wgRequest->getText( 'wpUrls' );
|
| 41 | + $this->mCorrect = $wgRequest->getBool('wpCorrect');
|
| 42 | + $this->mToS = $wgRequest->getBool('wpToS');
|
| 43 | + # We may be confirming an email address here
|
37 | 44 | $emailCode = $wgRequest->getText( 'wpEmailToken' );
|
38 | 45 |
|
39 | 46 | if ( $wgRequest->wasPosted() && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
|
— | — | @@ -45,33 +52,38 @@ |
46 | 53 | }
|
47 | 54 |
|
48 | 55 | function showForm( $msg='' ) {
|
49 | | - global $wgOut, $wgUser, $wgTitle, $wgAuth;
|
| 56 | + global $wgOut, $wgUser, $wgTitle, $wgAuth, $wgUseRealNamesOnly;
|
50 | 57 |
|
51 | | - $wgOut->setPagetitle( wfMsg( "requestaccount" ) );
|
| 58 | + $wgOut->setPagetitle( wfMsgHtml( "requestaccount" ) );
|
52 | 59 | # Output failure message
|
53 | 60 | if( $msg ) {
|
54 | 61 | $wgOut->addHTML( '<div class="errorbox">' . $msg . '</div><div class="visualClear"></div>' );
|
55 | 62 | }
|
56 | 63 | # Give notice to users that are logged in
|
57 | 64 | if( $wgUser->getID() ) {
|
58 | | - $wgOut->addWikiText( wfMsg( "requestaccount-dup" ) );
|
| 65 | + $wgOut->addWikiText( wfMsgHtml( "requestaccount-dup" ) );
|
59 | 66 | }
|
60 | 67 |
|
61 | | - $wgOut->addWikiText( wfMsg( "requestacount-text" ) );
|
| 68 | + $wgOut->addWikiText( wfMsgHtml( "requestacount-text" ) );
|
62 | 69 |
|
63 | 70 | $action = $wgTitle->escapeLocalUrl( 'action=submit' );
|
64 | 71 | $form = "<form name='accountrequest' action='$action' method='post'><fieldset>";
|
65 | | - $form .= '<legend>' . wfMsg('requestacount-legend1') . '</legend>';
|
| 72 | + $form .= '<legend>' . wfMsgHtml('requestacount-legend1') . '</legend>';
|
66 | 73 | $form .= "<p>".wfMsgExt( 'requestacount-acc-text', array('parse') )."</p>\n";
|
67 | 74 | $form .= '<table cellpadding=\'4\'>';
|
68 | | - $form .= "<tr><td>".Xml::label( wfMsgHtml('username'), 'wpUsername' )."</td>";
|
69 | | - $form .= "<td>".Xml::input( 'wpUsername', 30, $this->mUsername, array('id' => 'wpUsername') )."</td></tr>\n";
|
| 75 | + if( $wgUseRealNamesOnly ) {
|
| 76 | + $form .= "<tr><td>".wfMsgHtml('username')."</td>";
|
| 77 | + $form .= "<td>".wfMsgHtml('requestaccount-same')."</td></tr>\n";
|
| 78 | + } else {
|
| 79 | + $form .= "<tr><td>".Xml::label( wfMsgHtml('username'), 'wpUsername' )."</td>";
|
| 80 | + $form .= "<td>".Xml::input( 'wpUsername', 30, $this->mUsername, array('id' => 'wpUsername') )."</td></tr>\n";
|
| 81 | + }
|
70 | 82 | $form .= "<tr><td>".Xml::label( wfMsgHtml('requestaccount-email'), 'wpEmail' )."</td>";
|
71 | 83 | $form .= "<td>".Xml::input( 'wpEmail', 30, $this->mEmail, array('id' => 'wpEmail') )."</td></tr>\n";
|
72 | 84 | $form .= '</table></fieldset>';
|
73 | 85 |
|
74 | 86 | $form .= '<fieldset>';
|
75 | | - $form .= '<legend>' . wfMsg('requestacount-legend2') . '</legend>';
|
| 87 | + $form .= '<legend>' . wfMsgHtml('requestacount-legend2') . '</legend>';
|
76 | 88 | $form .= "<p>".wfMsgExt( 'requestaccount-bio-text', array('parse') )."</p>\n";
|
77 | 89 | $form .= '<table cellpadding=\'4\'>';
|
78 | 90 | $form .= "<tr><td>".Xml::label( wfMsgHtml('requestaccount-real'), 'wpRealName' )."</td>";
|
— | — | @@ -84,7 +96,7 @@ |
85 | 97 | $form .= '</fieldset>';
|
86 | 98 |
|
87 | 99 | $form .= '<fieldset>';
|
88 | | - $form .= '<legend>' . wfMsg('requestacount-legend3') . '</legend>';
|
| 100 | + $form .= '<legend>' . wfMsgHtml('requestacount-legend3') . '</legend>';
|
89 | 101 | $form .= "<p>".wfMsgExt( 'requestacount-ext-text', array('parse') )."</p>\n";
|
90 | 102 |
|
91 | 103 | $form .= "<p>".wfMsgHtml('requestaccount-notes')."</p>\n";
|
— | — | @@ -95,9 +107,6 @@ |
96 | 108 | $form .= "<p><textarea tabindex='1' name='wpUrls' id='wpUrls' rows='2' cols='80' style='width:100%'>" .
|
97 | 109 | $this->mUrls .
|
98 | 110 | "</textarea></p>";
|
99 | | -
|
100 | | - $form .= Xml::hidden( 'title', $wgTitle->getPrefixedText() )."\n";
|
101 | | - $form .= Xml::hidden( 'wpEditToken', $wgUser->editToken() )."\n";
|
102 | 111 | $form .= '</fieldset>';
|
103 | 112 |
|
104 | 113 | # Pseudo template for extensions
|
— | — | @@ -113,8 +122,12 @@ |
114 | 123 | $form .= '</fieldset>';
|
115 | 124 | }
|
116 | 125 | }
|
117 | | -
|
118 | | - $form .= "<p>".wfMsgExt( 'requestacount-confirm', array('parse') )."</p>\n";
|
| 126 | + $form .= "<p>".Xml::checkLabel( wfMsgExt( 'requestaccount-correct',
|
| 127 | + array('parseinline') ), 'wpCorrect', 'wpCorrect', $this->mCorrect )."</p>\n";
|
| 128 | + $form .= "<p>".Xml::checkLabel( wfMsgExt( 'requestaccount-tos',
|
| 129 | + array('parseinline') ), 'wpToS', 'wpToS', $this->mToS )."</p>\n";
|
| 130 | + $form .= Xml::hidden( 'title', $wgTitle->getPrefixedText() )."\n";
|
| 131 | + $form .= Xml::hidden( 'wpEditToken', $wgUser->editToken() )."\n";
|
119 | 132 | $form .= "<p>".Xml::submitButton( wfMsgHtml( 'requestacount-submit') ) . "</p></fieldset>";
|
120 | 133 | $form .= '</form>';
|
121 | 134 |
|
— | — | @@ -145,11 +158,22 @@ |
146 | 159 | $this->showForm( wfMsgHtml('requestaccount-inuse') );
|
147 | 160 | return;
|
148 | 161 | }
|
| 162 | + # Make sure user agrees to policy here
|
| 163 | + if( !$this->mCorrect || !$this->mToS ) {
|
| 164 | + $this->showForm( wfMsgHtml('requestaccount-agree') );
|
| 165 | + return;
|
| 166 | + }
|
149 | 167 | # Validate email address
|
150 | 168 | if( !$u->isValidEmailAddr( $this->mEmail ) ) {
|
151 | 169 | $this->showForm( wfMsgHtml('invalidemailaddress') );
|
152 | 170 | return;
|
153 | 171 | }
|
| 172 | + global $wgAccountRequestMinWords;
|
| 173 | + # Check if biography is long enough
|
| 174 | + if( str_word_count($this->mBio) < $wgAccountRequestMinWords ) {
|
| 175 | + $this->showForm( wfMsgHtml('requestaccount-tooshort',$wgAccountRequestMinWords) );
|
| 176 | + return;
|
| 177 | + }
|
154 | 178 | # Set some additional data so the AbortNewAccount hook can be
|
155 | 179 | # used for more than just username validation
|
156 | 180 | $u->setEmail( $this->mEmail );
|
— | — | @@ -219,7 +243,7 @@ |
220 | 244 | function throttleHit( $limit ) {
|
221 | 245 | global $wgOut;
|
222 | 246 |
|
223 | | - $wgOut->addWikiText( wfMsg( 'acct_request_throttle_hit', $limit ) );
|
| 247 | + $wgOut->addWikiText( wfMsgHtml( 'acct_request_throttle_hit', $limit ) );
|
224 | 248 | }
|
225 | 249 |
|
226 | 250 | function confirmEmailToken( $code ) {
|
— | — | @@ -228,8 +252,7 @@ |
229 | 253 | $name = $this->requestFromEmailToken( $code );
|
230 | 254 | if( $name !== false ) {
|
231 | 255 | $this->confirmEmail( $name );
|
232 | | - $message = $wgUser->isLoggedIn() ? 'confirmemail_loggedin' : 'confirmemail_success';
|
233 | | - $wgOut->addWikiText( wfMsg( $message ) );
|
| 256 | + $wgOut->addWikiText( wfMsgHtml( 'request-account-econf' ) );
|
234 | 257 | $wgOut->returnToMain();
|
235 | 258 | return;
|
236 | 259 | }
|
— | — | @@ -362,6 +385,9 @@ |
363 | 386 | $this->mUsername = $wgRequest->getText( 'wpNewName' );
|
364 | 387 | # For viewing rejects
|
365 | 388 | $this->showRejects = $wgRequest->getBool( 'wpShowRejects' );
|
| 389 | +
|
| 390 | + $this->submitType = $wgRequest->getVal( 'wpSubmitType' );
|
| 391 | + $this->reason = $wgRequest->getText( 'wpReason' );
|
366 | 392 |
|
367 | 393 | $this->skin = $wgUser->getSkin();
|
368 | 394 |
|
— | — | @@ -375,24 +401,29 @@ |
376 | 402 | }
|
377 | 403 |
|
378 | 404 | function doSubmit() {
|
379 | | - global $wgOut, $wgTitle, $wgAuth, $action;
|
| 405 | + global $wgOut, $wgTitle, $wgAuth;
|
380 | 406 |
|
381 | 407 | $row = $this->getRequest();
|
382 | 408 | if( !$row ) {
|
383 | | - $wgOut->addHTML( wfMsg('confirmaccount-badid') );
|
| 409 | + $wgOut->addHTML( wfMsgHtml('confirmaccount-badid') );
|
384 | 410 | $wgOut->returnToMain( true, $wgTitle );
|
385 | 411 | return;
|
386 | 412 | }
|
387 | 413 |
|
388 | | - if( $action == 'reject' ) {
|
| 414 | + if( $this->submitType == 'reject' ) {
|
389 | 415 | global $wgSaveRejectedAccountReqs;
|
390 | 416 | # Make proxy user to email a rejection message :(
|
391 | 417 | $u = User::newFromName( $row->acr_name, 'creatable' );
|
392 | 418 | $u->setEmail( $row->acr_email );
|
393 | 419 | # Do not send multiple times
|
394 | 420 | if( !$row->acr_rejected ) {
|
395 | | - $result = $u->sendMail( wfMsg( 'confirmaccount-email-subj' ),
|
396 | | - wfMsg( 'confirmaccount-email-body2', $u->getName() ) );
|
| 421 | + if( $this->reason ) {
|
| 422 | + $result = $u->sendMail( wfMsg( 'confirmaccount-email-subj' ),
|
| 423 | + wfMsg( 'confirmaccount-email-body4', $u->getName(), $this->reason ) );
|
| 424 | + } else {
|
| 425 | + $result = $u->sendMail( wfMsg( 'confirmaccount-email-subj' ),
|
| 426 | + wfMsg( 'confirmaccount-email-body3', $u->getName() ) );
|
| 427 | + }
|
397 | 428 | if( WikiError::isError( $result ) ) {
|
398 | 429 | $error = wfMsg( 'mailerror', htmlspecialchars( $result->getMessage() ) );
|
399 | 430 | $this->showForm( $error );
|
— | — | @@ -413,7 +444,7 @@ |
414 | 445 | }
|
415 | 446 |
|
416 | 447 | $this->showSuccess( $action );
|
417 | | - } else if( $action == 'accept' ) {
|
| 448 | + } else if( $this->submitType == 'accept' ) {
|
418 | 449 | global $wgMakeUserPageFromBio;
|
419 | 450 | # Check if the name is to be overridden
|
420 | 451 | $name = $this->mUsername ? trim($this->mUsername) : $row->acr_name;
|
— | — | @@ -434,17 +465,20 @@ |
435 | 466 | # VERY important to set email now. Otherwise user will have to request
|
436 | 467 | # a new password at the login screen...
|
437 | 468 | $user->setEmail( $row->acr_email );
|
438 | | - $result = $user->sendMail( wfMsg( 'confirmaccount-email-subj' ),
|
439 | | - wfMsg( 'confirmaccount-email-body',
|
440 | | - $user->getName(),
|
441 | | - $pass ) );
|
| 469 | + if( $this->reason ) {
|
| 470 | + $result = $user->sendMail( wfMsg( 'confirmaccount-email-subj' ),
|
| 471 | + wfMsg( 'confirmaccount-email-body2', $user->getName(), $pass, $this->reason ) );
|
| 472 | + } else {
|
| 473 | + $result = $user->sendMail( wfMsg( 'confirmaccount-email-subj' ),
|
| 474 | + wfMsg( 'confirmaccount-email-body', $user->getName(), $pass ) );
|
| 475 | + }
|
442 | 476 | if( WikiError::isError( $result ) ) {
|
443 | 477 | $error = wfMsg( 'mailerror', htmlspecialchars( $result->getMessage() ) );
|
444 | 478 | $this->showForm( $error );
|
445 | 479 | return false;
|
446 | 480 | }
|
447 | 481 | if( !$wgAuth->addUser( $user, $pass, $row->acr_email, $row->acr_real_name ) ) {
|
448 | | - $this->showForm( wfMsg( 'externaldberror' ) );
|
| 482 | + $this->showForm( wfMsgHtml( 'externaldberror' ) );
|
449 | 483 | return false;
|
450 | 484 | }
|
451 | 485 | # Set password and realname
|
— | — | @@ -470,6 +504,8 @@ |
471 | 505 | }
|
472 | 506 |
|
473 | 507 | $this->showSuccess( $action, $user->getName() );
|
| 508 | + } else {
|
| 509 | + $this->showForm();
|
474 | 510 | }
|
475 | 511 | }
|
476 | 512 |
|
— | — | @@ -483,7 +519,7 @@ |
484 | 520 |
|
485 | 521 | $row = $this->getRequest();
|
486 | 522 | if( !$row || $row->acr_rejected && !$this->showRejects ) {
|
487 | | - $wgOut->addHTML( wfMsg('confirmaccount-badid') );
|
| 523 | + $wgOut->addHTML( wfMsgHtml('confirmaccount-badid') );
|
488 | 524 | $wgOut->returnToMain( true, $wgTitle );
|
489 | 525 | return;
|
490 | 526 | }
|
— | — | @@ -499,18 +535,18 @@ |
500 | 536 |
|
501 | 537 | $action = $wgTitle->escapeLocalUrl( 'action=submit' );
|
502 | 538 | $form = "<form name='accountconfirm' action='$action' method='post'><fieldset>";
|
503 | | - $form .= '<legend>' . wfMsg('requestacount-legend1') . '</legend>';
|
| 539 | + $form .= '<legend>' . wfMsgHtml('requestacount-legend1') . '</legend>';
|
504 | 540 | $form .= '<table cellpadding=\'4\'>';
|
505 | 541 | $form .= "<tr><td>".Xml::label( wfMsgHtml('username'), 'wpNewName' )."</td>";
|
506 | 542 | $form .= "<td>".Xml::input( 'wpNewName', 30, $row->acr_name, array('id' => 'wpNewName') )."</td></tr>\n";
|
507 | 543 |
|
508 | | - $econf = $row->acr_email_authenticated ? ' <strong>'.wfMsg('confirmaccount-econf').'</strong>' : '';
|
| 544 | + $econf = $row->acr_email_authenticated ? ' <strong>'.wfMsgHtml('confirmaccount-econf').'</strong>' : '';
|
509 | 545 | $form .= "<tr><td>".wfMsgHtml('requestaccount-email')."</td>";
|
510 | 546 | $form .= "<td>".htmlspecialchars($row->acr_email).$econf."</td></tr>\n";
|
511 | 547 | $form .= '</table></fieldset>';
|
512 | 548 |
|
513 | 549 | $form .= '<fieldset>';
|
514 | | - $form .= '<legend>' . wfMsg('requestacount-legend2') . '</legend>';
|
| 550 | + $form .= '<legend>' . wfMsgHtml('requestacount-legend2') . '</legend>';
|
515 | 551 | $form .= '<table cellpadding=\'4\'>';
|
516 | 552 | $form .= "<tr><td>".wfMsgHtml('requestaccount-real')."</td>";
|
517 | 553 | $form .= "<td>".htmlspecialchars($row->acr_real_name)."</td></tr>\n";
|
— | — | @@ -522,28 +558,27 @@ |
523 | 559 | $form .= '</fieldset>';
|
524 | 560 |
|
525 | 561 | $form .= '<fieldset>';
|
526 | | - $form .= '<legend>' . wfMsg('requestacount-legend3') . '</legend>';
|
| 562 | + $form .= '<legend>' . wfMsgHtml('requestacount-legend3') . '</legend>';
|
527 | 563 | $form .= "<p>".wfMsgHtml('requestaccount-notes')."</p>\n";
|
528 | 564 | $form .= "<p><textarea tabindex='1' readonly name='wpNotes' id='wpNotes' rows='3' cols='80' style='width:100%'>" .
|
529 | 565 | htmlspecialchars($row->acr_notes) .
|
530 | 566 | "</textarea></p>";
|
531 | | - $form .= "<p>".wfMsgHtml('requestaccount-urls')."</p>\n";
|
532 | | - $form .= "<p><textarea tabindex='1' readonly name='wpUrls' id='wpUrls' rows='2' cols='80' style='width:100%'>" .
|
533 | | - htmlspecialchars($row->acr_urls) .
|
534 | | - "</textarea></p>";
|
| 567 | + $form .= "<p>".wfMsgHtml('confirmaccount-urls')."</p>\n";
|
| 568 | + $form .= "<p>".$this->parseLinks($row->acr_urls)."</p>";
|
535 | 569 | $form .= '</fieldset>';
|
536 | 570 |
|
537 | | - $form .= Xml::hidden( 'title', $wgTitle->getPrefixedText() )."\n";
|
538 | | - $form .= Xml::hidden( 'action', 'accept' );
|
539 | | - $form .= Xml::hidden( 'acrid', $row->acr_id );
|
540 | | - $form .= Xml::hidden( 'wpEditToken', $wgUser->editToken() )."\n";
|
| 571 | + $form .= "<p>".wfMsgExt( 'confirmacount-confirm', array('parse') )."</p>\n";
|
| 572 | + $form .= "<p>".Xml::radio( 'wpSubmitType', 'accept', $this->submitType=='accept', array('id' => 'submitCreate') );
|
| 573 | + $form .= ' '.Xml::label( wfMsg('confirmacount-create'), 'submitCreate' )."</p>\n";
|
| 574 | + $form .= "<p>".Xml::radio( 'wpSubmitType', 'reject', $this->submitType=='reject', array('id' => 'submitDeny') );
|
| 575 | + $form .= ' '.Xml::label( wfMsg('confirmacount-deny'), 'submitDeny' )."</p>\n";
|
| 576 | +
|
| 577 | + $form .= "<p>".wfMsgHtml('requestaccount-reason')."</p>\n";
|
| 578 | + $form .= "<p><textarea tabindex='1' name='wpReason' id='wpReason' rows='3' cols='80' style='width:80%'>" .
|
| 579 | + htmlspecialchars($this->reason) .
|
| 580 | + "</textarea></p>";
|
| 581 | + $form .= "<p>".Xml::submitButton( wfMsgHtml( 'confirmacount-submit') )."</p>\n";
|
541 | 582 |
|
542 | | - $form .= "<p>".wfMsgExt( 'confirmacount-confirm', array('parse') )."</p>\n";
|
543 | | - $form .= '<div style="float: left">'.Xml::submitButton( wfMsgHtml( 'confirmacount-create') ).'</div>';
|
544 | | - $form .= '</form>';
|
545 | | - # Make deny use a separate form to avoid problems with people pressing enter
|
546 | | - $form .= "<form name='accountreject' action='$action' method='post'>";
|
547 | | - $form .= '<div style="float: right">'.Xml::submitButton( wfMsgHtml( 'confirmacount-deny') ) . "</div>";
|
548 | 583 | $form .= Xml::hidden( 'title', $wgTitle->getPrefixedText() )."\n";
|
549 | 584 | $form .= Xml::hidden( 'action', 'reject' );
|
550 | 585 | $form .= Xml::hidden( 'acrid', $row->acr_id );
|
— | — | @@ -553,6 +588,29 @@ |
554 | 589 | $wgOut->addHTML( $form );
|
555 | 590 | }
|
556 | 591 |
|
| 592 | + /**
|
| 593 | + * Extract a list of all recognized HTTP links in the text.
|
| 594 | + * @param string $text
|
| 595 | + * @return string $linkList, list of clickable links
|
| 596 | + */
|
| 597 | + function parseLinks( $text ) {
|
| 598 | + global $wgParser, $wgTitle, $wgUser;
|
| 599 | +
|
| 600 | + $linkList = '';
|
| 601 | + $links = explode( "\n", htmlspecialchars($text) );
|
| 602 | + foreach( $links as $link ) {
|
| 603 | + if( strpos($link,'.') )
|
| 604 | + $linkList .= "<li><a href='$link'>$link</a></li>\n";
|
| 605 | + }
|
| 606 | + if( $linkList == '' ) {
|
| 607 | + $linkList = wfMsgHtml( 'confirmaccount-nourls' );
|
| 608 | + } else {
|
| 609 | + $linkList = "<ul>$linkList</ul>";
|
| 610 | + }
|
| 611 | +
|
| 612 | + return $linkList;
|
| 613 | + }
|
| 614 | +
|
557 | 615 | function getRequest() {
|
558 | 616 | if( !$this->acrID )
|
559 | 617 | return false;
|
— | — | @@ -567,9 +625,9 @@ |
568 | 626 | global $wgOut, $wgTitle;
|
569 | 627 |
|
570 | 628 | $wgOut->setPagetitle( wfMsg( "requestaccount" ) );
|
571 | | - if( $action == 'accept' )
|
| 629 | + if( $this->submitType == 'accept' )
|
572 | 630 | $wgOut->addWikiText( wfMsg( "confirmaccount-acc", $name ) );
|
573 | | - else
|
| 631 | + else if( $this->submitType == 'reject' )
|
574 | 632 | $wgOut->addWikiText( wfMsg( "confirmaccount-rej" ) );
|
575 | 633 |
|
576 | 634 | $wgOut->returnToMain( true, $wgTitle );
|
— | — | @@ -622,10 +680,10 @@ |
623 | 681 |
|
624 | 682 | $title = SpecialPage::getTitleFor( 'ConfirmAccounts' );
|
625 | 683 | if( $this->showRejects ) {
|
626 | | - $link = $this->skin->makeKnownLinkObj( $title, wfMsg('confirmaccount-review'),
|
| 684 | + $link = $this->skin->makeKnownLinkObj( $title, wfMsgHtml('confirmaccount-review'),
|
627 | 685 | 'acrid='.$row->acr_id.'&wpShowRejects=1' );
|
628 | 686 | } else {
|
629 | | - $link = $this->skin->makeKnownLinkObj( $title, wfMsg('confirmaccount-review'), 'acrid='.$row->acr_id );
|
| 687 | + $link = $this->skin->makeKnownLinkObj( $title, wfMsgHtml('confirmaccount-review'), 'acrid='.$row->acr_id );
|
630 | 688 | }
|
631 | 689 | $time = $wgLang->timeanddate( wfTimestamp(TS_MW, $row->acr_registration), true );
|
632 | 690 |
|
— | — | @@ -634,12 +692,12 @@ |
635 | 693 | if( $this->showRejects )
|
636 | 694 | $r .= ' <strong>'.wfMsgExt( 'confirmaccount-reject', array('parseinline'), $row->user_name ).'</strong>';
|
637 | 695 | $r .= '<br/><table cellspacing=\'1\' cellpadding=\'3\' border=\'1\' width=\'100%\'>';
|
638 | | - $r .= '<tr><td><strong>'.wfMsg('confirmaccount-name').'</strong></td><td width=\'100%\'>' .
|
| 696 | + $r .= '<tr><td><strong>'.wfMsgHtml('confirmaccount-name').'</strong></td><td width=\'100%\'>' .
|
639 | 697 | htmlspecialchars($row->acr_name) . '</td></tr>';
|
640 | | - $r .= '<tr><td><strong>'.wfMsg('confirmaccount-real').'</strong></td><td width=\'100%\'>' .
|
| 698 | + $r .= '<tr><td><strong>'.wfMsgHtml('confirmaccount-real').'</strong></td><td width=\'100%\'>' .
|
641 | 699 | htmlspecialchars($row->acr_real_name) . '</td></tr>';
|
642 | 700 | $econf = $row->acr_email_authenticated ? ' <strong>'.wfMsg('confirmaccount-econf').'</strong>' : '';
|
643 | | - $r .= '<tr><td><strong>'.wfMsg('confirmaccount-email').'</strong></td><td width=\'100%\'>' .
|
| 701 | + $r .= '<tr><td><strong>'.wfMsgHtml('confirmaccount-email').'</strong></td><td width=\'100%\'>' .
|
644 | 702 | htmlspecialchars($row->acr_email) . $econf.'</td></tr>';
|
645 | 703 | # Truncate this, blah blah...
|
646 | 704 | $bio = htmlspecialchars($row->acr_bio);
|
— | — | @@ -648,7 +706,7 @@ |
649 | 707 | $preview = substr( $preview, 0, strrpos($preview,' ') );
|
650 | 708 | $preview .= " . . .";
|
651 | 709 | }
|
652 | | - $r .= '<tr><td><strong>'.wfMsg('confirmaccount-bio').'</strong></td><td width=\'100%\'><i>'.$preview.'</i></td></tr>';
|
| 710 | + $r .= '<tr><td><strong>'.wfMsgHtml('confirmaccount-bio').'</strong></td><td width=\'100%\'><i>'.$preview.'</i></td></tr>';
|
653 | 711 | $r .= '</table></li>';
|
654 | 712 |
|
655 | 713 | return $r;
|
Index: trunk/extensions/ConfirmAccount/ConfirmAccount.i18n.php |
— | — | @@ -12,8 +12,7 @@ |
13 | 13 | 'requestaccount' => 'Request account',
|
14 | 14 | 'requestacount-text' => '\'\'\'Complete and submit the following form to request a user account\'\'\'.
|
15 | 15 |
|
16 | | - Your email address will be sent a confirmation message once this request is submited. Please respond by clicking
|
17 | | - on the confirmation link provided by the the email.
|
| 16 | + Make sure that you first read the [[{{NS:PROJECT}}:Terms of Service|Terms of Service]] before requesting an account.
|
18 | 17 |
|
19 | 18 | Once the account is approved, you will be emailed a notification message and the account will be usable at
|
20 | 19 | [[Special:Userlogin]].',
|
— | — | @@ -21,20 +20,27 @@ |
22 | 21 | 'requestacount-legend1' => 'User account:',
|
23 | 22 | 'requestacount-legend2' => 'Personal information:',
|
24 | 23 | 'requestacount-legend3' => 'Other information:',
|
25 | | - 'requestacount-acc-text' => 'Your password will be emailed to you when your account is confirmed.',
|
| 24 | + 'requestacount-acc-text' => 'Your email address will be sent a confirmation message once this request is submited. Please respond by clicking
|
| 25 | + on the confirmation link provided by the the email. Also, your password will be emailed to you when your account is created.',
|
26 | 26 | 'requestacount-ext-text' => 'The following information is kept private and will only be used for this request.
|
27 | | - You may want to list contacts such as fax/phone numbers to aid in identify confirmation.',
|
| 27 | + You may want to list contacts such a phone number to aid in identify confirmation.',
|
28 | 28 | 'requestaccount-bio-text' => "Your biography will be set as the default content for your userpage. Try to include
|
29 | 29 | any credentials. Make sure you are comfortable publishing such information. Your name can be changed via [[Special:Preferences]].",
|
30 | 30 | 'requestaccount-real' => 'Real name:',
|
| 31 | + 'requestaccount-same' => '(same as real name)',
|
31 | 32 | 'requestaccount-email' => 'Email address:',
|
32 | 33 | 'requestaccount-bio' => 'Personal biography:',
|
33 | 34 | 'requestaccount-notes' => 'Additional notes:',
|
34 | | - 'requestaccount-urls' => 'Websites:',
|
| 35 | + 'requestaccount-urls' => 'List of websites (separated by newlines):',
|
| 36 | + 'requestaccount-agree' => 'You must certify that your real name is correct and that you agree to our Terms of Service.',
|
35 | 37 | 'requestaccount-inuse' => 'Username is already in use in a pending account request.',
|
36 | | - 'requestacount-confirm' => 'Press the submit button below once you have confirmed that all the above is correct.',
|
| 38 | + 'requestaccount-tooshort' => 'Your biography must be at least be $1 words long.',
|
| 39 | + 'requestaccount-tos' => 'I have read and agree to abide by the Terms of Service of {{SITENAME}}.',
|
| 40 | + 'requestaccount-correct' => 'I certify that the name I have specified under "Real name" is in fact my own real name.',
|
37 | 41 | 'requestacount-submit' => 'Request account',
|
38 | 42 | 'requestaccount-sent' => 'Your account request has successfully been sent and is now pending review.',
|
| 43 | + 'request-account-econf' => 'Your e-mail address has been confirmed and will be listed as such in your account
|
| 44 | + request.',
|
39 | 45 | 'requestaccount-email-subj' => '{{SITENAME}} e-mail address confirmation',
|
40 | 46 | 'requestaccount-email-body' => 'Someone, probably you from IP address $1, has requested an
|
41 | 47 | account "$2" with this e-mail address on {{SITENAME}}.
|
— | — | @@ -73,12 +79,16 @@ |
74 | 80 | 'confirmaccount-real' => 'Name',
|
75 | 81 | 'confirmaccount-email' => 'Email',
|
76 | 82 | 'confirmaccount-bio' => 'Biography',
|
| 83 | + 'confirmaccount-urls' => 'List of websites:',
|
| 84 | + 'confirmaccount-nourls' => '(None provided)',
|
77 | 85 | 'confirmaccount-review' => 'Approve/Reject',
|
78 | | - 'confirmacount-confirm' => 'Use the buttons below to irreversibly confirm this request and create the account or deny it.',
|
| 86 | + 'confirmacount-confirm' => 'Use the buttons below to confirm this request or deny it.',
|
79 | 87 | 'confirmaccount-econf' => '(confirmed)',
|
80 | 88 | 'confirmaccount-reject' => '(rejected by [[User:$1|$1]])',
|
81 | 89 | 'confirmacount-create' => 'Confirm (create account)',
|
82 | 90 | 'confirmacount-deny' => 'Reject (delist)',
|
| 91 | + 'requestaccount-reason' => 'Comment (will be included in email):',
|
| 92 | + 'confirmacount-submit' => 'Confirm',
|
83 | 93 | 'confirmaccount-acc' => 'Account request confirmed successfully; created new user account [[User:$1]].',
|
84 | 94 | 'confirmaccount-rej' => 'Account request rejected successfully.',
|
85 | 95 | 'confirmaccount-summary' => 'Creating user page with biography of new user.',
|
— | — | @@ -91,9 +101,24 @@ |
92 | 102 |
|
93 | 103 | You may have been granted a slightly different name than requested. This could be due to name collisions
|
94 | 104 | or policy reasons. Also, please immediatly login, go to your preferences options, and set a new password.',
|
95 | | - 'confirmaccount-email-body2' => 'Sorry, your request for an account "$1" has been rejected on {{SITENAME}}.
|
| 105 | + 'confirmaccount-email-body2' => 'Your request for an account has been approved on {{SITENAME}}.
|
96 | 106 |
|
| 107 | +Account name: $1
|
| 108 | +
|
| 109 | +Password: $2
|
| 110 | +
|
| 111 | +$3
|
| 112 | +
|
| 113 | +You may have been granted a slightly different name than requested. This could be due to name collisions
|
| 114 | +or policy reasons. Also, please immediatly login, go to your preferences options, and set a new password.',
|
| 115 | + 'confirmaccount-email-body3' => 'Sorry, your request for an account "$1" has been rejected on {{SITENAME}}.
|
| 116 | +
|
97 | 117 | There are several ways this can happen. You may not have filled out the form correctly, did not provide adequate
|
98 | 118 | length in your responses, or otherwise failed to meet some policy criteria. There may be contact lists on site that
|
99 | 119 | you can use if you want to know more about user account policy.',
|
| 120 | + 'confirmaccount-email-body4' => 'Sorry, your request for an account "$1" has been rejected on {{SITENAME}}.
|
| 121 | +
|
| 122 | +$1
|
| 123 | +
|
| 124 | +There may be contact lists on site that you can use if you want to know more about user account policy.',
|
100 | 125 | ); |
\ No newline at end of file |