本文整理汇总了PHP中HTTPRequest::getProject方法的典型用法代码示例。如果您正苦于以下问题:PHP HTTPRequest::getProject方法的具体用法?PHP HTTPRequest::getProject怎么用?PHP HTTPRequest::getProject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTTPRequest
的用法示例。
在下文中一共展示了HTTPRequest::getProject方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
public function process(HTTPRequest $request)
{
if (!PluginManager::instance()->isPluginAllowedForProject($this, $request->getProject()->getId())) {
$GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('plugin_svn_manage_repository', 'plugin_not_activated'));
$GLOBALS['Response']->redirect('/projects/' . $request->getProject()->getUnixNameMixedCase() . '/');
} else {
$this->getRouter()->route($request);
}
}
示例2: userIsAdmin
/**
* @param HTTPRequest $request
* @return bool
*/
public function userIsAdmin(HTTPRequest $request)
{
$user = $request->getCurrentUser();
$forge_user_manager = new User_ForgeUserGroupPermissionsManager(new User_ForgeUserGroupPermissionsDao());
$has_special_permission = $forge_user_manager->doesUserHavePermission($user, new User_ForgeUserGroupPermission_MediawikiAdminAllProjects());
return $has_special_permission || $user->isMember($request->getProject()->getID(), 'A');
}
示例3: assertUserIsProjectAdmin
private function assertUserIsProjectAdmin(ServiceMediawiki $service, HTTPRequest $request)
{
if (!$service->userIsAdmin($request->getCurrentUser())) {
$GLOBALS['Response']->redirect(MEDIAWIKI_BASE_URL . '/wiki/' . $request->getProject()->getUnixName());
}
}