summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialUserlogin.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/specials/SpecialUserlogin.php')
-rw-r--r--includes/specials/SpecialUserlogin.php22
1 files changed, 17 insertions, 5 deletions
diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php
index 6a4da7a4..b065bdd6 100644
--- a/includes/specials/SpecialUserlogin.php
+++ b/includes/specials/SpecialUserlogin.php
@@ -45,7 +45,7 @@ class LoginForm {
*/
function LoginForm( &$request, $par = '' ) {
global $wgLang, $wgAllowRealName, $wgEnableEmail;
- global $wgAuth;
+ global $wgAuth, $wgRedirectOnLogin;
$this->mType = ( $par == 'signup' ) ? $par : $request->getText( 'type' ); # Check for [[Special:Userlogin/signup]]
$this->mName = $request->getText( 'wpName' );
@@ -66,6 +66,10 @@ class LoginForm {
$this->mLanguage = $request->getText( 'uselang' );
$this->mSkipCookieCheck = $request->getCheck( 'wpSkipCookieCheck' );
+ if ( $wgRedirectOnLogin ) {
+ $this->mReturnTo = $wgRedirectOnLogin;
+ }
+
if( $wgEnableEmail ) {
$this->mEmail = $request->getText( 'wpEmail' );
} else {
@@ -593,7 +597,12 @@ class LoginForm {
*/
function mailPassword() {
global $wgUser, $wgOut, $wgAuth;
-
+
+ if ( wfReadOnly() ) {
+ $wgOut->readOnlyPage();
+ return false;
+ }
+
if( !$wgAuth->allowPasswordChange() ) {
$this->mainLoginForm( wfMsg( 'resetpass_forbidden' ) );
return;
@@ -654,7 +663,7 @@ class LoginForm {
* @private
*/
function mailPasswordInternal( $u, $throttle = true, $emailTitle = 'passwordremindertitle', $emailText = 'passwordremindertext' ) {
- global $wgServer, $wgScript, $wgUser;
+ global $wgServer, $wgScript, $wgUser, $wgNewPasswordExpiry;
if ( '' == $u->getEmail() ) {
return new WikiError( wfMsg( 'noemail', $u->getName() ) );
@@ -670,7 +679,8 @@ class LoginForm {
$u->setNewpassword( $np, $throttle );
$u->saveSettings();
- $m = wfMsg( $emailText, $ip, $u->getName(), $np, $wgServer . $wgScript );
+ $m = wfMsgExt( $emailText, array( 'parsemag' ), $ip, $u->getName(), $np,
+ $wgServer . $wgScript, round( $wgNewPasswordExpiry / 86400 ) );
$result = $u->sendMail( wfMsg( $emailTitle ), $m );
return $result;
@@ -968,6 +978,8 @@ class LoginForm {
* @return string
*/
function makeLanguageSelector() {
+ global $wgLang;
+
$msg = wfMsgForContent( 'loginlanguagelinks' );
if( $msg != '' && !wfEmptyMsg( 'loginlanguagelinks', $msg ) ) {
$langs = explode( "\n", $msg );
@@ -979,7 +991,7 @@ class LoginForm {
$links[] = $this->makeLanguageSelectorLink( $parts[0], $parts[1] );
}
}
- return count( $links ) > 0 ? wfMsgHtml( 'loginlanguagelabel', implode( ' | ', $links ) ) : '';
+ return count( $links ) > 0 ? wfMsgHtml( 'loginlanguagelabel', $wgLang->pipeList( $links ) ) : '';
} else {
return '';
}