$query = array(
'returnto' => $this->mReturnTo,
'returntoquery' => $this->mReturnToQuery,
- );
+ 'title' => null,
+ ) + $this->mRequest->getQueryValues();
$url = $title->getFullURL( $query, false, PROTO_HTTPS );
if ( $wgSecureLogin && wfCanIPUseHTTPS( $this->getRequest()->getIP() ) ) {
$url = wfAppendQuery( $url, 'fromhttp=1' );
$status = $this->addNewaccountInternal();
if ( !$status->isGood() ) {
- $error = $this->getOutput()->parse( $status->getWikiText() );
- $this->mainLoginForm( $error );
+ $error = $status->getMessage();
+ $this->mainLoginForm( $error->toString() );
return;
}
# Create the account and abort if there's a problem doing so
$status = $this->addNewAccountInternal();
if ( !$status->isGood() ) {
- $error = $this->getOutput()->parse( $status->getWikiText() );
- $this->mainLoginForm( $error );
+ $error = $status->getMessage();
+ $this->mainLoginForm( $error->toString() );
return false;
}
if ( !wfRunHooks( 'AbortNewAccount', array( $u, &$abortError ) ) ) {
// Hook point to add extra creation throttles and blocks
wfDebug( "LoginForm::addNewAccountInternal: a hook blocked creation\n" );
- return Status::newFatal( new RawMessage( $abortError ) );
+ $abortError = new RawMessage( $abortError );
+ $abortError->text();
+ return Status::newFatal( $abortError );
}
// Hook point to check for exempt from account creation throttle
$template->set( 'remember', $user->getOption( 'rememberpassword' ) || $this->mRemember );
$template->set( 'cansecurelogin', ( $wgSecureLogin === true ) );
$template->set( 'stickhttps', (int)$this->mStickHTTPS );
-
- if ( $this->mType === 'signup' && $user->isLoggedIn() ) {
- $template->set( 'createAnother', true );
- } else {
- $template->set( 'createAnother', false );
- }
+ $template->set( 'loggedin', $user->isLoggedIn() );
+ $template->set( 'loggedinuser', $user->getName() );
if ( $this->mType == 'signup' ) {
if ( !self::getCreateaccountToken() ) {
* @return bool
*/
private function showCreateOrLoginLink( &$user ) {
- if ( $user->isLoggedIn() ) {
- return false;
- } elseif ( $this->mType == 'signup' ) {
+ if ( $this->mType == 'signup' ) {
return true;
} elseif ( $user->isAllowed( 'createaccount' ) ) {
return true;