improved admin interface (#6)

This commit is contained in:
Jacob G 2015-01-11 19:21:30 -05:00
parent 1f8d97bbaf
commit 7fda23dc76
4 changed files with 13 additions and 8 deletions

View file

@ -110,9 +110,13 @@ class AccountRequestSubmission {
if ($_POST['pwd1'] != $_POST['pwd2']) {
return array('pwds_no_match', 'The passwords did not match.');
}
if (strlen($_POST['pwd1']) <= 4) {
return array('pwd_too_short', 'The password is too short');
}
if (!$success) {
return array('no_comment', 'It does not appear you commented the verification code on the specified project. Please try again.');
return array('no_comment', $this->msg('requestaccount-nocomment-error'));
}
$u = User::newFromName( $this->userName, 'creatable' );

View file

@ -75,7 +75,8 @@ You cannot make any more requests.",
'requestaccount-code-troubleshoot' => '\'\'\'Note:\'\'\' If you are having problems with user verification not working, please see our [[Scratch_Wiki:Become a contributor/Verification code troubleshooting|troubleshooting page]]',
'requestaccount-set-pwd' => 'Set password',
'requestaccount-project-info' => 'Please go to the [$1 user verification project] and comment the following code:<br />\'\'\'$2\'\'\'',
'requestaccount-project-link' => 'http://scratch.mit.edu/projects/10135908/'
'requestaccount-project-link' => 'http://scratch.mit.edu/projects/10135908/',
'requestaccount-nocomment-error' => 'It does not appear you commented the verification code on the specified project. Please try again.',
);
/** Message documentation (Message documentation)

View file

@ -295,13 +295,13 @@ class ConfirmAccountsPage extends SpecialPage {
$form .= '<legend>' . $this->msg( 'confirmaccount-leg-user' )->escaped() . '</legend>';
$form .= '<table cellpadding=\'4\'>';
$form .= "<tr><td>" . Xml::label( $this->msg( 'username' )->text(), 'wpNewName' ) . "</td>";
$form .= "<td>" . Xml::input( 'wpNewName', 30, $this->reqUsername, array( 'id' => 'wpNewName' ) ) . "</td></tr>\n";
$form .= '<td>' . Xml::input( 'wpNewName', 30, $this->reqUsername, array( 'id' => 'wpNewName', 'type' => 'hidden' ) ) . ' <a href="http://scratch.mit.edu/users/' . htmlspecialchars(str_replace(' ', '_', $this->reqUsername)) . '">' . htmlspecialchars($this->reqUsername) . '</a></td></tr>' . "\n";
$econf = '';
if ( $accountReq->getEmailAuthTimestamp() ) {
/*if ( $accountReq->getEmailAuthTimestamp() ) {
$econf = ' <strong>' . $this->msg( 'confirmaccount-econf' )->escaped() . '</strong>';
}
$form .= "<tr><td>" . $this->msg( 'confirmaccount-email' )->escaped() . "</td>";
$form .= "<td>" . htmlspecialchars( $accountReq->getEmail() ) . $econf . "</td></tr>\n";
$form .= "<td>" . htmlspecialchars( $accountReq->getEmail() ) . $econf . "</td></tr>\n";*/
if ( count( $wgAccountRequestTypes ) > 1 ) {
$options = array();
$form .= "<tr><td><strong>" . $this->msg( 'confirmaccount-reqtype' )->escaped() . "</strong></td><td>";
@ -661,8 +661,8 @@ class ConfirmAccountsPage extends SpecialPage {
}
}
# Every 30th view, prune old deleted items
if ( 0 == mt_rand( 0, 29 ) ) {
# Every 10th view, prune old deleted items
if ( 0 == mt_rand( 0, 10 ) ) {
ConfirmAccount::runAutoMaintenance();
}
}

View file

@ -230,7 +230,7 @@ class RequestAccountPage extends SpecialPage {
</tr>
</table>' . "\n";
$form .= '</fieldset>';
# FIXME: do this better...
global $wgConfirmAccountCaptchas, $wgCaptchaClass, $wgCaptchaTriggers;
if ( $wgConfirmAccountCaptchas && isset( $wgCaptchaClass )