示例#1
0
 /**
  * Inject whazawhoo
  * @fixme if multiple thingies insert a header, could break
  * @param QuickTemplate $template
  * @return bool true to keep running callbacks
  */
 function injectUserCreate(&$template)
 {
     global $wgCaptchaTriggers, $wgOut, $wgUser;
     if ($wgCaptchaTriggers['createaccount']) {
         $this->action = 'usercreate';
         if ($wgUser->isAllowed('skipcaptcha')) {
             wfDebug("ConfirmEdit: user group allows skipping captcha on account creation\n");
             return true;
         }
         $captcha = "<div class='captcha'>" . $wgOut->parse($this->getMessage('createaccount')) . $this->getForm() . "</div>\n";
         // for older MediaWiki versions
         if (is_callable(array($template, 'extend'))) {
             $template->extend('extrafields', $captcha);
         } else {
             $template->set('header', $captcha);
         }
     }
     return true;
 }
 /**
  * Decide if the login/usercreate page should be overwritten by a mobile only
  * special specialpage. If not, do some changes to the template.
  * @param QuickTemplate $tpl Login or Usercreate template
  * @param String $mode Is this function called in context of UserCreate or UserLogin?
  */
 public static function changeUserLoginCreateForm(&$tpl)
 {
     $context = MobileContext::singleton();
     // otherwise just(tm) add a logoheader, if there is any
     $mfLogo = $context->getMFConfig()->get('MobileFrontendLogo');
     // do nothing in desktop mode
     if ($context->shouldDisplayMobileView() && $mfLogo) {
         $tpl->extend('formheader', Html::openElement('div', array('class' => 'watermark')) . Html::element('img', array('src' => $mfLogo, 'alt' => '')) . Html::closeElement('div'));
     }
 }
示例#3
0
 /**
  * Inject whazawhoo
  * @fixme if multiple thingies insert a header, could break
  * @param QuickTemplate $template
  * @return bool true to keep running callbacks
  */
 function injectUserCreate(&$template)
 {
     global $wgCaptchaTriggers, $wgOut, $wgUser;
     if ($wgCaptchaTriggers['createaccount']) {
         $this->action = 'usercreate';
         if ($wgUser->isAllowed('skipcaptcha')) {
             wfDebug("ConfirmEdit: user group allows skipping captcha on account creation\n");
             return true;
         }
         LoggerFactory::getInstance('authmanager')->info('Captcha shown on account creation', array('event' => 'captcha.display', 'type' => 'accountcreation'));
         $captcha = "<div class='captcha'>" . $wgOut->parse($this->getMessage('createaccount')) . $this->getForm($wgOut) . "</div>\n";
         // for older MediaWiki versions
         if (is_callable(array($template, 'extend'))) {
             $template->extend('extrafields', $captcha);
         } else {
             $template->set('header', $captcha);
         }
     }
     return true;
 }