本文整理匯總了PHP中KunenaUser::tryAuthorise方法的典型用法代碼示例。如果您正苦於以下問題:PHP KunenaUser::tryAuthorise方法的具體用法?PHP KunenaUser::tryAuthorise怎麽用?PHP KunenaUser::tryAuthorise使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類KunenaUser
的用法示例。
在下文中一共展示了KunenaUser::tryAuthorise方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: before
/**
* Load user profile.
*
* @return void
*
* @throws KunenaExceptionAuthorise
*/
protected function before()
{
parent::before();
// If profile integration is disabled, this view doesn't exist.
$integration = KunenaFactory::getProfile();
if (get_class($integration) == 'KunenaProfileNone')
{
throw new KunenaExceptionAuthorise(JText::_('COM_KUNENA_PROFILE_DISABLED'), 404);
}
$userid = $this->input->getInt('userid');
require_once KPATH_SITE . '/models/user.php';
$this->model = new KunenaModelUser(array(), $this->input);
$this->model->initialize($this->getOptions(), $this->getOptions()->get('embedded', false));
$this->state = $this->model->getState();
$this->me = KunenaUserHelper::getMyself();
$this->user = JFactory::getUser($userid);
$this->profile = KunenaUserHelper::get($userid);
$this->profile->tryAuthorise('read');
// Update profile hits.
if (!$this->profile->exists() || !$this->profile->isMyself())
{
$this->profile->uhits++;
$this->profile->save();
}
$this->headerText = JText::sprintf('COM_KUNENA_VIEW_USER_DEFAULT', $this->profile->getName());
}
示例2: before
/**
* Prepare ban form.
*
* @return void
*
* @throws KunenaExceptionAuthorise
*/
protected function before()
{
parent::before();
$userid = $this->input->getInt('userid');
$this->profile = KunenaUserHelper::get($userid);
$this->profile->tryAuthorise('ban');
$this->banInfo = KunenaUserBan::getInstanceByUserid($userid, true);
$this->headerText = $this->banInfo->exists() ? JText::_('COM_KUNENA_BAN_EDIT') : JText::_('COM_KUNENA_BAN_NEW');
}
示例3: before
/**
* Prepare user for editing.
*
* @return void
*
* @throws KunenaExceptionAuthorise
*/
protected function before()
{
parent::before();
// If profile integration is disabled, this view doesn't exist.
$integration = KunenaFactory::getProfile();
if (get_class($integration) == 'KunenaProfileNone') {
throw new KunenaExceptionAuthorise(JText::_('COM_KUNENA_PROFILE_DISABLED'), 404);
}
$userid = $this->input->getInt('userid');
$this->user = JFactory::getUser($userid);
$this->profile = KunenaUserHelper::get($userid);
$this->profile->tryAuthorise('edit');
$this->headerText = JText::sprintf('COM_KUNENA_VIEW_USER_DEFAULT', $this->profile->getName());
}