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


PHP CForumNew::GetPermissionUserDefault方法代码示例

本文整理汇总了PHP中CForumNew::GetPermissionUserDefault方法的典型用法代码示例。如果您正苦于以下问题:PHP CForumNew::GetPermissionUserDefault方法的具体用法?PHP CForumNew::GetPermissionUserDefault怎么用?PHP CForumNew::GetPermissionUserDefault使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CForumNew的用法示例。


在下文中一共展示了CForumNew::GetPermissionUserDefault方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: CanUserDeleteMessage

 function CanUserDeleteMessage($MID, $arUserGroups, $iUserID = 0, $ExternalPermission = false)
 {
     $MID = intVal($MID);
     $arMessage = CForumMessage::GetByIDEx($MID, array("GET_FORUM_INFO" => "Y", "GET_TOPIC_INFO" => "N", "FILTER" => "N"));
     $arForum = $arMessage["FORUM_INFO"];
     if ($arMessage) {
         $FID = intVal($arMessage["FORUM_ID"]);
         if (!CForumUser::IsLocked($iUserID)) {
             $strPerms = $ExternalPermission == false ? CForumNew::GetUserPermission($arForum["ID"], $arUserGroups) : $ExternalPermission;
         } else {
             $strPerms = CForumNew::GetPermissionUserDefault($arForum["ID"], $arUserGroups);
         }
         if ($strPerms >= "Y") {
             return true;
         } elseif ($arForum["ACTIVE"] != "Y") {
             return false;
         }
         return $strPerms >= "U" ? true : false;
     }
     return false;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:21,代码来源:message.php

示例2: ForumCurrUserPermissions

function ForumCurrUserPermissions($FID)
{
    static $arCache = array();
    if (!isset($arCache[$FID])) {
        if ($GLOBALS["USER"]->IsAdmin() || $GLOBALS["APPLICATION"]->GetGroupRight("forum") >= "W") {
            $result = "Y";
        } else {
            $strPerms = CForumNew::GetUserPermission($FID, $GLOBALS["USER"]->GetUserGroupArray());
            if ($strPerms <= "E") {
                $result = $strPerms;
            } elseif (CForumUser::IsLocked($GLOBALS["USER"]->GetID())) {
                $strPerms = CForumNew::GetPermissionUserDefault($GLOBALS["USER"]->GetID());
                $result = $strPerms >= "E" ? $strPerms : "E";
            } else {
                $result = $strPerms;
            }
        }
        $arCache[$FID] = $result;
    }
    return $arCache[$FID];
}
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:21,代码来源:include.php

示例3: ForumCurrUserPermissions

function ForumCurrUserPermissions($FID, $arAddParams = array())
{
    static $arCache = array();
    $arAddParams = is_array($arAddParams) ? $arAddParams : array();
    $arAddParams["PERMISSION"] = !!$arAddParams["PERMISSION"] ? $arAddParams["PERMISSION"] : '';
    if (!isset($arCache[$FID . $arAddParams["PERMISSION"]])) {
        if (CForumUser::IsAdmin()) {
            $result = "Y";
        } else {
            $strPerms = !!$arAddParams["PERMISSION"] ? $arAddParams["PERMISSION"] : CForumNew::GetUserPermission($FID, $GLOBALS["USER"]->GetUserGroupArray());
            if ($strPerms <= "E") {
                $result = $strPerms;
            } elseif (CForumUser::IsLocked($GLOBALS["USER"]->GetID())) {
                $strPerms = CForumNew::GetPermissionUserDefault($GLOBALS["USER"]->GetID());
                $result = $strPerms >= "E" ? $strPerms : "E";
            } else {
                $result = $strPerms;
            }
        }
        $arCache[$FID . $arAddParams["PERMISSION"]] = $result;
    }
    return $arCache[$FID . $arAddParams["PERMISSION"]];
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:23,代码来源:include.php

示例4: CanUserEditForum

 function CanUserEditForum($FID, $arUserGroups, $iUserID = 0, $ExternalPermission = false)
 {
     $FID = intVal($FID);
     $arUserGroups = !is_array($arUserGroups) ? array($arUserGroups) : $arUserGroups;
     if ($ExternalPermission === false && CForumUser::IsAdmin($arUserGroups)) {
         return true;
     } elseif (!CForumUser::IsLocked($iUserID)) {
         $strPerms = $ExternalPermission == false ? CForumNew::GetUserPermission($FID, $arUserGroups) : $ExternalPermission;
     } else {
         $strPerms = CForumNew::GetPermissionUserDefault($FID);
     }
     if ($strPerms >= "Y") {
         return true;
     }
     $arForum = CForumNew::GetByID($FID);
     if (!is_array($arForum) || $arForum["ACTIVE"] != "Y") {
         return false;
     }
     return $strPerms < "U" ? false : true;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:20,代码来源:forum_new.php

示例5: CanUserDeleteTopicMessage

 function CanUserDeleteTopicMessage($TID, $arUserGroups, $iUserID = 0, $ExternalPermission = false)
 {
     $TID = intVal($TID);
     $arTopic = CForumTopic::GetByID($TID);
     if ($arTopic) {
         if ($ExternalPermission === false && (in_array(1, $arUserGroups) || $GLOBALS["APPLICATION"]->GetGroupRight("forum", $arUserGroups) >= "W")) {
             return true;
         }
         if (!CForumUser::IsLocked($iUserID)) {
             $strPerms = $ExternalPermission == false ? CForumNew::GetUserPermission($arTopic["FORUM_ID"], $arUserGroups) : $ExternalPermission;
         } else {
             $strPerms = CForumNew::GetPermissionUserDefault($arTopic["FORUM_ID"]);
         }
         if ($strPerms >= "Y") {
             return true;
         } elseif ($strPerms < "U") {
             return false;
         }
         $arForum = CForumNew::GetByID($arTopic["FORUM_ID"]);
         return $arForum["ACTIVE"] == "Y" ? true : false;
     }
     return false;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:23,代码来源:topic.php

示例6: CanUserDeleteTopicMessage

 function CanUserDeleteTopicMessage($TID, $arUserGroups, $iUserID = 0, $ExternalPermission = false)
 {
     $TID = intVal($TID);
     $arTopic = CForumTopic::GetByID($TID);
     if ($arTopic) {
         if ($ExternalPermission === false && CForumUser::IsAdmin($arUserGroups)) {
             return true;
         }
         if (!CForumUser::IsLocked($iUserID)) {
             $strPerms = $ExternalPermission == false ? CForumNew::GetUserPermission($arTopic["FORUM_ID"], $arUserGroups) : $ExternalPermission;
         } else {
             $strPerms = CForumNew::GetPermissionUserDefault($arTopic["FORUM_ID"]);
         }
         if ($strPerms >= "Y") {
             return true;
         } elseif ($strPerms < "U") {
             return false;
         }
         $arForum = CForumNew::GetByID($arTopic["FORUM_ID"]);
         return $arForum["ACTIVE"] == "Y" ? true : false;
     }
     return false;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:23,代码来源:topic.php

示例7: CanUserEditForum

	public static function CanUserEditForum($FID, $arUserGroups, $iUserID = 0, $ExternalPermission = false)
	{
		$FID = intVal($FID);
		$arUserGroups = (!is_array($arUserGroups) ? array($arUserGroups) : $arUserGroups);
		if ($ExternalPermission === false && (in_array(1, $arUserGroups) || $GLOBALS["APPLICATION"]->GetGroupRight("forum", $arUserGroups) >= "W")):
			return true;
		elseif (!CForumUser::IsLocked($iUserID)):
			$strPerms = ($ExternalPermission == false ? CForumNew::GetUserPermission($FID, $arUserGroups) : $ExternalPermission);
		else:
			$strPerms = CForumNew::GetPermissionUserDefault($FID);
		endif;
		if ($strPerms >= "Y"):
			return true;
		endif;
		$arForum = CForumNew::GetByID($FID);
		if (!is_array($arForum) || $arForum["ACTIVE"] != "Y"):
			return false;
		endif;
		return ($strPerms < "U" ? false : true);
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:20,代码来源:forum_new.php

示例8: initPermission

 public function initPermission()
 {
     if (!array_key_exists($this->forum["ID"], self::$permissions)) {
         if (\CForumUser::IsAdmin($this->getUser()->getGroups())) {
             $result = "Y";
         } else {
             if ($this->forum["ACTIVE"] != "Y") {
                 $result = "A";
             } else {
                 if (\CForumUser::IsLocked($this->getUser()->getID())) {
                     $result = \CForumNew::GetPermissionUserDefault($this->forum["ID"]);
                 } else {
                     $result = \CForumNew::GetUserPermission($this->forum["ID"], $GLOBALS["USER"]->GetUserGroupArray());
                 }
             }
         }
         self::$permissions[$this->forum["ID"]] = $result;
     }
     $this->permission = self::$permissions[$this->forum["ID"]];
     $this->rights = array();
     return $this;
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:22,代码来源:entity.php


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