public function processForm($request) { if ($request->getText('register') == "true") { $acc = new TMWAccount(); $acc->setUsername($request->getText('username')); $acc->setPassword1($request->getText('password1')); $acc->setPassword2($request->getText('password2')); $acc->setEMail($request->getText('email')); $acc->setGender($request->getText('gender')); $this->err = $acc->validate(); global $wgCaptchaClass; global $wgCaptchaClass, $wgConfirmAccountCaptchas; if ($wgConfirmAccountCaptchas) { $captcha = new $wgCaptchaClass(); if (!$captcha->passCaptcha()) { $this->err[] = "The captcha was incorrect!"; } } if (count($this->err) > 0) { return false; } // create the account if (!$acc->createAccount()) { $this->err[] = "The was an unknown error while creating the account"; return false; } else { self::showSuccess(); return true; } } return false; }
/** * Add "x email-tmwed open account requests" notice * @param $notice * @return bool */ public static function tmwAccountsNotice(OutputPage &$out, Skin &$skin) { global $wgTMWAccountNotice; $context = $out->getContext(); if (!$wgTMWAccountNotice || !$context->getUser()->isAllowed('tmwaccount')) { return true; } # Only show on some special pages $title = $context->getTitle(); if (!$title->isSpecial('Recentchanges') && !$title->isSpecial('Watchlist')) { return true; } $count = TMWAccount::getOpenEmailTMWedCount('*'); if ($count > 0) { $out->prependHtml('<div id="mw-tmwaccount-msg" class="plainlinks mw-tmwaccount-bar">' . $out->parse(wfMsgExt('tmwaccount-newrequests', 'parsemag', $count), false) . '</div>'); } return true; }