当前位置: 首页>>代码示例>>PHP>>正文


PHP KunenaUser::isModerator方法代码示例

本文整理汇总了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;
 }
开发者ID:giabmf11,项目名称:Kunena-Forum,代码行数:13,代码来源:topic.php

示例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;
 }
开发者ID:densem-2013,项目名称:exikom,代码行数:15,代码来源:attachment.php

示例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;
 }
开发者ID:giabmf11,项目名称:Kunena-Forum,代码行数:28,代码来源:message.php

示例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;
 }
开发者ID:densem-2013,项目名称:exikom,代码行数:16,代码来源:category.php

示例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;
 }
开发者ID:madcsaba,项目名称:li-de,代码行数:13,代码来源:announcement.php

示例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;
	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:14,代码来源:message.php

示例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;
 }
开发者ID:laiello,项目名称:senluonirvana,代码行数:9,代码来源:attachment.php


注:本文中的KunenaUser::isModerator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。