示例#1
0
 protected function checkCanExecute(User $user)
 {
     // Must be logged in
     if ($user->isAnon()) {
         throw new UserNotLoggedIn('watchlistanontext', 'watchnologin');
     }
     parent::checkCanExecute($user);
 }
示例#2
0
 protected function checkCanExecute(User $user)
 {
     // Must be logged in
     if ($user->isAnon()) {
         throw new ErrorPageError('watchnologin', 'watchnologintext');
     }
     return parent::checkCanExecute($user);
 }
示例#3
0
 protected function checkCanExecute(User $user)
 {
     // Must be logged in
     if ($user->isAnon()) {
         $loginreqlink = Linker::linkKnown(SpecialPage::getTitleFor('Userlogin'), $this->msg('loginreqlink')->escaped(), array(), array('returnto' => $this->getPageTitle(), 'returntoquery' => 'action=' . $this->getName()));
         $reasonMsg = $this->msg('watchlistanontext')->rawParams($loginreqlink);
         throw new UserNotLoggedIn($reasonMsg, 'watchnologin');
     }
     return parent::checkCanExecute($user);
 }
示例#4
0
 protected function checkCanExecute(User $user)
 {
     parent::checkCanExecute($user);
     $oldimage = $this->getRequest()->getText('oldimage');
     if (strlen($oldimage) < 16 || strpos($oldimage, '/') !== false || strpos($oldimage, '\\') !== false) {
         throw new ErrorPageError('internalerror', 'unexpected', array('oldimage', $oldimage));
     }
     $this->oldFile = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName($this->getTitle(), $oldimage);
     if (!$this->oldFile->exists()) {
         throw new ErrorPageError('', 'filerevert-badversion');
     }
 }
示例#5
0
 protected function checkCanExecute(User $user)
 {
     parent::checkCanExecute($user);
     $oldvideo = $this->getRequest()->getText('oldvideo');
     if (strlen($oldvideo) < 16) {
         throw new ErrorPageError('internalerror', 'unexpected', array('oldvideo', $oldvideo));
     }
     $dbr = wfGetDB(DB_READ);
     $row = $dbr->selectRow('oldvideo', array('ov_url', 'ov_type', 'ov_timestamp', 'ov_url', 'ov_name'), array('ov_archive_name' => urldecode($oldvideo)), __METHOD__);
     if ($row === false) {
         throw new ErrorPageError('', 'filerevert-badversion');
     }
     $this->oldvideo = $row;
 }