Beispiel #1
0
 /**
  * Constructor
  * @param webrequest $request A webrequest object passed by reference
  */
 function LoginForm(&$request)
 {
     global $wgLang, $wgAllowRealName, $wgEnableEmail;
     global $wgAuth;
     $this->mType = $request->getText('type');
     $this->mName = $request->getText('wpName');
     $this->mPassword = $request->getText('wpPassword');
     $this->mRetype = $request->getText('wpRetype');
     $this->mDomain = $request->getText('wpDomain');
     $this->mReturnTo = $request->getVal('returnto');
     $this->mCookieCheck = $request->getVal('wpCookieCheck');
     $this->mPosted = $request->wasPosted();
     $this->mCreateaccount = $request->getCheck('wpCreateaccount');
     $this->mCreateaccountMail = $request->getCheck('wpCreateaccountMail') && $wgEnableEmail;
     $this->mMailmypassword = $request->getCheck('wpMailmypassword') && $wgEnableEmail;
     $this->mLoginattempt = $request->getCheck('wpLoginattempt');
     $this->mAction = $request->getVal('action');
     $this->mRemember = $request->getCheck('wpRemember');
     $this->mLanguage = $request->getText('uselang');
     if ($wgEnableEmail) {
         $this->mEmail = $request->getText('wpEmail');
     } else {
         $this->mEmail = '';
     }
     if ($wgAllowRealName) {
         $this->mRealName = $request->getText('wpRealName');
     } else {
         $this->mRealName = '';
     }
     if (!$wgAuth->validDomain($this->mDomain)) {
         $this->mDomain = 'invaliddomain';
     }
     $wgAuth->setDomain($this->mDomain);
     # When switching accounts, it sucks to get automatically logged out
     if ($this->mReturnTo == $wgLang->specialPage('Userlogout')) {
         $this->mReturnTo = '';
     }
 }