本文整理汇总了PHP中FormAction::checkCanExecute方法的典型用法代码示例。如果您正苦于以下问题:PHP FormAction::checkCanExecute方法的具体用法?PHP FormAction::checkCanExecute怎么用?PHP FormAction::checkCanExecute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormAction
的用法示例。
在下文中一共展示了FormAction::checkCanExecute方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkCanExecute
protected function checkCanExecute(User $user)
{
// Must be logged in
if ($user->isAnon()) {
throw new UserNotLoggedIn('watchlistanontext', 'watchnologin');
}
parent::checkCanExecute($user);
}
示例2: checkCanExecute
protected function checkCanExecute(User $user)
{
// Must be logged in
if ($user->isAnon()) {
throw new ErrorPageError('watchnologin', 'watchnologintext');
}
return parent::checkCanExecute($user);
}
示例3: checkCanExecute
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: checkCanExecute
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: checkCanExecute
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;
}