/**
  * Render the special page boddy
  * @param string $par The username
  */
 public function executeWhenAvailable($par = '')
 {
     $this->offset = $this->getRequest()->getVal('offset', false);
     if ($par) {
         // enter article history view
         $this->user = User::newFromName($par, false);
         if ($this->user && ($this->user->idForName() || User::isIP($par))) {
             // set page title as on desktop site - bug 66656
             $username = $this->user->getName();
             $out = $this->getOutput();
             $out->addModuleStyles(array('mobile.pagelist.styles', 'mobile.pagesummary.styles'));
             $out->setHTMLTitle($this->msg('pagetitle', $this->msg('contributions-title', $username)->plain())->inContentLanguage());
             if (User::isIP($par)) {
                 $this->renderHeaderBar($par);
             } else {
                 $this->renderHeaderBar($this->user->getUserPage());
             }
             $res = $this->doQuery();
             $out->addHtml(Html::openElement('div', array('class' => 'content-unstyled')));
             $this->showContributions($res);
             $out->addHtml(Html::closeElement('div'));
             return;
         }
     }
     $this->showPageNotFound();
 }
 static function createTemporaryUser($real_name, $email)
 {
     $user = new User();
     $maxid = User::getMaxID();
     $anonid = $maxid + 1;
     $username = "******";
     $user->setName($username);
     $real_name = strip_tags($real_name);
     // make sure this hasn't already been created
     while ($user->idForName() > 0) {
         $anonid = rand(0, 100000);
         $username = "******";
         $user->setName($username);
     }
     if ($real_name) {
         $user->setRealName($real_name);
     } else {
         $user->setRealName("Anonymous");
     }
     if ($email) {
         $user->setEmail($email);
     }
     $user->setPassword(WH_ANON_USER_PASSWORD);
     $user->setOption("disablemail", 1);
     $user->addToDatabase();
     return $user;
 }
 /**
  * Render the special page boddy
  * @param string $par The username
  */
 public function executeWhenAvailable($par = '')
 {
     $this->offset = $this->getRequest()->getVal('offset', false);
     if ($par) {
         // enter article history view
         $this->user = User::newFromName($par, false);
         if ($this->user && ($this->user->idForName() || User::isIP($par))) {
             // set page title as on desktop site - bug 66656
             $username = $this->user->getName();
             $out = $this->getOutput();
             $out->setHTMLTitle($this->msg('pagetitle', $this->msg('contributions-title', $username)->plain())->inContentLanguage());
             if (User::isIP($par)) {
                 $this->renderHeaderBar($par);
             } else {
                 $this->renderHeaderBar($this->user->getUserPage());
             }
             $res = $this->doQuery();
             $this->showContributions($res);
             return;
         }
     }
     $this->showPageNotFound();
 }