本文整理汇总了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;
}
示例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];
}
示例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"]];
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}