* @ingroup SpecialPage
*/
class SpecialChangeEmail extends UnlistedSpecialPage {
-
/**
* Users password
* @var string
}
/**
- * @return Bool
+ * @return bool
*/
function isListed() {
global $wgAuth;
/**
* Main execution point
+ * @param string $par
*/
function execute( $par ) {
global $wgAuth;
}
/**
- * @param $type string
+ * @param string $type
*/
protected function doReturnTo( $type = 'hard' ) {
$titleObj = Title::newFromText( $this->getRequest()->getVal( 'returnto' ) );
}
/**
- * @param $msg string
+ * @param string $msg
*/
protected function error( $msg ) {
$this->getOutput()->wrapWikiMsg( "<p class='error'>\n$1\n</p>", $msg );
}
protected function showForm() {
- global $wgRequirePasswordforEmailChange;
$user = $this->getUser();
$oldEmailText = $user->getEmail()
array( 'wpOldEmail', 'changeemail-oldemail', 'text', $oldEmailText ),
array( 'wpNewEmail', 'changeemail-newemail', 'email', $this->mNewEmail ),
);
- if ( $wgRequirePasswordforEmailChange ) {
+ if ( $this->getConfig()->get( 'RequirePasswordforEmailChange' ) ) {
$items[] = array( 'wpPassword', 'changeemail-password', 'password', $this->mPassword );
}
}
/**
- * @param $fields array
+ * @param array $fields
* @return string
*/
protected function pretty( $fields ) {
}
/**
- * @param $user User
- * @param $pass string
- * @param $newaddr string
- * @return bool|string true or string on success, false on failure
+ * @param User $user
+ * @param string $pass
+ * @param string $newaddr
+ * @return bool|string True or string on success, false on failure
*/
protected function attemptChange( User $user, $pass, $newaddr ) {
- global $wgAuth, $wgPasswordAttemptThrottle;
+ global $wgAuth;
if ( $newaddr != '' && !Sanitizer::validateEmail( $newaddr ) ) {
$this->error( 'invalidemailaddress' );
$throttleCount = LoginForm::incLoginThrottle( $user->getName() );
if ( $throttleCount === true ) {
$lang = $this->getLanguage();
- $this->error( array( 'changeemail-throttled', $lang->formatDuration( $wgPasswordAttemptThrottle['seconds'] ) ) );
+ $throttleInfo = $this->getConfig()->get( 'PasswordAttemptThrottle' );
+ $this->error( array(
+ 'changeemail-throttled',
+ $lang->formatDuration( $throttleInfo['seconds'] )
+ ) );
return false;
}
- global $wgRequirePasswordforEmailChange;
- if ( $wgRequirePasswordforEmailChange && !$user->checkTemporaryPassword( $pass ) && !$user->checkPassword( $pass ) ) {
+ if ( $this->getConfig()->get( 'RequirePasswordforEmailChange' )
+ && !$user->checkTemporaryPassword( $pass )
+ && !$user->checkPassword( $pass )
+ ) {
$this->error( 'wrongpassword' );
return false;