function execute() { global $wgRequest, $wgHooks, $wgOut; $this->setHeaders(); if (session_id() == '') { wfSetupSession(); } $form = new AjaxLoginForm($wgRequest); $form->executeAsPage(); }
?> </h2> <h2 class="headline signup"><?php echo wfMsg('cnw-auth-headline2'); ?> </h2> <p class="creative login"><?php echo wfMsg('cnw-auth-creative'); ?> </p> <p class="creative signup"><?php echo wfMsg('cnw-auth-signup-creative'); ?> </p> <?php echo AjaxLoginForm::getTemplateForCombinedForms()->render('ComboAjaxLogin'); ?> <p class="signup-msg"> <?php echo wfMsg('cnw-signup-prompt'); ?> <a href="#"><?php echo wfMsg('cnw-call-to-signup'); ?> </a> </p> <p class="login-msg"> <?php echo wfMsg('cnw-login-prompt'); ?> <a href="#"><?php
/** * Generates a template with the login form and registration form already filled into * it and other settings populated as well. This template can then be executed with * different EasyTemplates to give different results such as one view for ajax dialogs * and one view for standalone pages (such as Special:Signup). */ public static function getTemplateForCombinedForms($static = false, $lastmsg = "", &$ajaxLoginForm = "") { global $wgRequest; // Setup the data for the templates, similar to GetComboAjaxLogin. if (session_id() == '') { wfSetupSession(); } // TODO: Invstigate why this was here. //if ($wgRequest->getCheck( 'wpCreateaccount' )) { // return "error"; //} $tmpl = new EasyTemplate(dirname(__FILE__) . '/templates/'); $response = new AjaxResponse(); $type = $wgRequest->getVal('type', ''); if (!wfReadOnly()) { if (empty($ajaxLoginForm)) { $ajaxLoginForm = new AjaxLoginForm($wgRequest); } $ajaxLoginForm->execute($type); if (!empty($ajaxLoginForm->ajaxTemplate)) { $lastmsg = $ajaxLoginForm->ajaxTemplate->data['message']; $tmpl->set('message', $ajaxLoginForm->ajaxTemplate->data['message']); $tmpl->set('messagetype', $ajaxLoginForm->ajaxTemplate->data['messagetype']); } $tmpl->set("registerAjax", $ajaxLoginForm->ajaxRender()); } $isReadOnly = wfReadOnly() ? 1 : 0; $tmpl->set("isReadOnly", $isReadOnly); if (!LoginForm::getLoginToken()) { LoginForm::setLoginToken(); } $tmpl->set("loginToken", LoginForm::getLoginToken()); if (!LoginForm::getCreateaccountToken()) { LoginForm::setCreateaccountToken(); } $tmpl->set("createToken", LoginForm::getCreateaccountToken()); // Use the existing settings to generate the login portion of the form, which will then // be fed back into the bigger template in this case (it is not always fed into ComboAjaxLogin template). $returnto = $wgRequest->getVal('returnto', ''); if (!($returnto == '')) { $returnto = "&returnto=" . wfUrlencode($returnto); } $returntoquery = $wgRequest->getVal('returntoquery', ''); if (!($returntoquery == '')) { $returntoquery = "&returntoquery=" . wfUrlencode($returntoquery); } $loginaction = Skin::makeSpecialUrl('Signup', "type=login&action=submitlogin" . $returnto . $returntoquery); $signupaction = Skin::makeSpecialUrl('Signup', "type=signup" . $returnto . $returntoquery); $tmpl->set("loginaction", $loginaction); $tmpl->set("signupaction", $signupaction); $tmpl->set("loginerror", $lastmsg); $tmpl->set("actiontype", $type); $tmpl->set("showRegister", false); $tmpl->set("showLogin", false); if ($static) { if (strtolower($type) == "login") { $tmpl->set("showLogin", true); } else { if (!$isReadOnly) { $tmpl->set("showRegister", true); } } } $tmpl->set("ajaxLoginComponent", $tmpl->render('AjaxLoginComponent')); return $tmpl; }