本文整理汇总了PHP中KunenaUser::isModerator方法的典型用法代码示例。如果您正苦于以下问题:PHP KunenaUser::isModerator方法的具体用法?PHP KunenaUser::isModerator怎么用?PHP KunenaUser::isModerator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KunenaUser
的用法示例。
在下文中一共展示了KunenaUser::isModerator方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: authoriseUnlocked
/**
* @param KunenaUser $user
*
* @return null|string
*/
protected function authoriseUnlocked(KunenaUser $user)
{
// Check that topic is not locked or user is a moderator
if ($this->locked && !$user->isModerator($this->getCategory())) {
return new KunenaExceptionAuthorise(JText::_('COM_KUNENA_POST_ERROR_TOPIC_LOCKED'), 403);
}
return null;
}
示例2: authoriseOwn
/**
* @param KunenaUser $user
*
* @return KunenaExceptionAuthorise|null
*
* @since K4.0
*/
protected function authoriseOwn(KunenaUser $user)
{
// Checks if attachment is users own or user is moderator in the category (or global)
if ($user->userid && $this->userid != $user->userid && !$user->isModerator($this->getMessage()->getCategory())) {
return new KunenaExceptionAuthorise(JText::_('COM_KUNENA_ATTACHMENT_NO_ACCESS'), 403);
}
return null;
}
示例3: authoriseAttachmentsFile
/**
* Check if user has the right to upload file attachment
*
* @param KunenaUser $user
* @return KunenaExceptionAuthorise|NULL
*/
protected function authoriseAttachmentsFile(KunenaUser $user)
{
if (empty(KunenaFactory::getConfig()->file_upload)) {
return new KunenaExceptionAuthorise(JText::_('COM_KUNENA_POST_ATTACHMENTS_NOT_ALLOWED'), 403);
}
if (KunenaFactory::getConfig()->file_upload == 'admin') {
if (!$user->isAdmin()) {
return new KunenaExceptionAuthorise(JText::_('COM_KUNENA_POST_ATTACHMENTS_FILE_ONLY_FOR_ADMINISTRATORS'), 403);
}
}
if (KunenaFactory::getConfig()->file_upload == 'registered') {
if (!$user->userid) {
return new KunenaExceptionAuthorise(JText::_('COM_KUNENA_POST_ATTACHMENTS_FILE_ONLY_FOR_REGISTERED_USERS'), 403);
}
}
if (KunenaFactory::getConfig()->file_upload == 'moderator') {
if (!$user->isModerator()) {
return new KunenaExceptionAuthorise(JText::_('COM_KUNENA_POST_ATTACHMENTS_FILE_ONLY_FOR_MODERATORS'), 403);
}
}
return null;
}
示例4: authoriseGlobalModerate
/**
* @param KunenaUser $user
*
* @return KunenaExceptionAuthorise|null
*/
protected function authoriseGlobalModerate(KunenaUser $user)
{
// Check that user is a global moderator
if (!$user->userid) {
return new KunenaExceptionAuthorise(JText::_('COM_KUNENA_POST_NOT_GLOBAL_MODERATOR'), 401);
}
if (!$user->isModerator()) {
return new KunenaExceptionAuthorise(JText::_('COM_KUNENA_POST_NOT_GLOBAL_MODERATOR'), 403);
}
return null;
}
示例5: authoriseWrite
/**
* @param KunenaUser $user
*
* @return null|string
*/
protected function authoriseWrite(KunenaUser $user)
{
// Check that user is global moderator
if (!$user->userid || !$user->isModerator()) {
return JText::_('COM_KUNENA_POST_NOT_MODERATOR');
}
return null;
}
示例6: authoriseDelete
/**
* @param KunenaUser $user
*
* @return bool
*/
protected function authoriseDelete(KunenaUser $user) {
$config = KunenaFactory::getConfig();
if (!$user->isModerator($this->getCategory())
&& $config->userdeletetmessage != '2' && ($config->userdeletetmessage == '0' || $this->getTopic()->last_post_id != $this->id)) {
$this->setError (JText::_ ( 'COM_KUNENA_POST_ERROR_DELETE_REPLY_AFTER' ) );
return false;
}
return true;
}
示例7: authoriseOwn
protected function authoriseOwn(KunenaUser $user)
{
// Checks if attachment is users own or user is moderator in the category (or global)
if ($user->userid && $this->userid != $user->userid && !$user->isModerator($this->getMessage()->getCategory())) {
$this->setError(JText::_('COM_KUNENA_NO_ACCESS'));
return false;
}
return true;
}