本文整理汇总了PHP中CExtranet::IsProfileViewableByID方法的典型用法代码示例。如果您正苦于以下问题:PHP CExtranet::IsProfileViewableByID方法的具体用法?PHP CExtranet::IsProfileViewableByID怎么用?PHP CExtranet::IsProfileViewableByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CExtranet
的用法示例。
在下文中一共展示了CExtranet::IsProfileViewableByID方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FilterViewableUsers
function FilterViewableUsers($var)
{
if (!CModule::IncludeModule("extranet") || CExtranet::IsIntranetUser() || CExtranet::IsProfileViewableByID($var["ID"], $GLOBALS["GROUP_SITE_ID"])) {
return true;
} else {
return false;
}
}
示例2: array
if ($arResult["Users"]["List"] == false) {
$arResult["Users"]["List"] = array();
}
$pu = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER"], array("user_id" => $arRequests["USER_ID"]));
$canViewProfile = CSocNetUserPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), $arRequests["USER_ID"], "viewprofile", CSocNetUser::IsCurrentUserModuleAdmin());
$arTmpUser = array("NAME" => htmlspecialcharsback($arRequests["USER_NAME"]), "LAST_NAME" => htmlspecialcharsback($arRequests["USER_LAST_NAME"]), "SECOND_NAME" => htmlspecialcharsback($arRequests["USER_SECOND_NAME"]), "LOGIN" => htmlspecialcharsback($arRequests["USER_LOGIN"]));
$strNameFormatted = CUser::FormatName($arParams['NAME_TEMPLATE'], $arTmpUser, $bUseLogin);
$arResult["Users"]["List"][] = array("ID" => $arRequests["ID"], "USER_ID" => $arRequests["USER_ID"], "USER_NAME" => $arRequests["USER_NAME"], "USER_LAST_NAME" => $arRequests["USER_LAST_NAME"], "USER_SECOND_NAME" => $arRequests["USER_SECOND_NAME"], "USER_LOGIN" => $arRequests["USER_LOGIN"], "USER_NAME_FORMATTED" => $strNameFormatted, "USER_PROFILE_URL" => $pu, "SHOW_PROFILE_LINK" => $canViewProfile, "PATH_TO_MESSAGES_CHAT" => str_replace("#user_id#", $arRequests["USER_ID"], $arParams["PATH_TO_MESSAGES_CHAT"]), "IS_ONLINE" => $arRequests["USER_IS_ONLINE"] == "Y", "IS_MODERATOR" => $arRequests["ROLE"] != SONET_ROLES_USER);
}
}
}
}
}
} else {
//user message part
if (CModule::IncludeModule('extranet') && !CExtranet::IsProfileViewableByID($arParams["USER_ID"]) && $arParams["USER_ID"] != $USER->GetID()) {
$dbMessages = CSocNetMessages::GetList(array(), array("FROM_USER_ID" => $arParams["USER_ID"], "TO_USER_ID" => $USER->GetID(), "MESSAGE_TYPE" => SONET_MESSAGE_PRIVATE), false, array("nTopCount" => 1), array("ID"));
if (!$dbMessages->Fetch()) {
$arResult["FatalError"] = GetMessage("SONET_P_USER_NO_USER") . ". ";
}
}
if (StrLen($arResult["FatalError"]) <= 0) {
$dbUser = CUser::GetByID($arParams["USER_ID"]);
$arResult["User"] = $dbUser->GetNext();
$arTmpUser = array('NAME' => $arResult["User"]["~NAME"], 'LAST_NAME' => $arResult["User"]["~LAST_NAME"], 'SECOND_NAME' => $arResult["User"]["~SECOND_NAME"], 'LOGIN' => $arResult["User"]["~LOGIN"]);
if (!is_array($arResult["User"])) {
$arResult["FatalError"] = GetMessage("SONET_P_USER_NO_USER") . ". ";
}
}
if (StrLen($arResult["FatalError"]) <= 0) {
if ($arParams["SET_TITLE"] == "Y") {
示例3: elseif
}
/********************************************************************
/Content search
********************************************************************/
/********************************************************************
Buziness-process
********************************************************************/
if ($componentPage == "bizproc_task") {
$componentPage = "bizproc_edit";
} elseif ($componentPage == "bizproc_task_list") {
$componentPage = "bizproc";
}
/********************************************************************
/Buziness-process
********************************************************************/
if (!in_array($componentPage, array("message_form_mess", "messages_chat", "messages_users_messages")) && IntVal($arResult["VARIABLES"]["user_id"]) > 0 && $arResult["VARIABLES"]["user_id"] != $USER->GetID() && $bExtranetEnabled && CModule::IncludeModule('extranet') && !CExtranet::IsProfileViewableByID($arResult["VARIABLES"]["user_id"])) {
if ($componentPage = "user_blog_post") {
if (isset($arResult["VARIABLES"]["post_id"]) && intval($arResult["VARIABLES"]["post_id"]) > 0) {
$rsLog = CSocNetLog::GetList(array(), array("EVENT_ID" => array("blog_post", "blog_post_important"), "SOURCE_ID" => intval($arResult["VARIABLES"]["post_id"])), false, false, array("ID"), array("CHECK_RIGHTS" => "Y"));
if ($arLog = $rsLog->Fetch()) {
$bAccessFound = true;
}
}
}
if (!$bAccessFound) {
ShowError(GetMessage("SONET_ACCESS_DENIED"));
return;
}
}
CUtil::InitJSCore(array("window", "ajax"));
$this->IncludeComponentTemplate($componentPage, array_key_exists($componentPage, $arCustomPagesPath) ? $arCustomPagesPath[$componentPage] : "");
示例4: elseif
********************************************************************/
/********************************************************************
Buziness-process
********************************************************************/
if ($componentPage == "bizproc_task")
$componentPage = "bizproc_edit";
elseif ($componentPage == "bizproc_task_list")
$componentPage = "bizproc";
/********************************************************************
/Buziness-process
********************************************************************/
if (IntVal($arResult["VARIABLES"]["user_id"]) > 0 && !in_array($componentPage, array("message_form_mess", "messages_chat", "messages_users_messages")))
if (CModule::IncludeModule('extranet') && !CExtranet::IsProfileViewableByID($arResult["VARIABLES"]["user_id"]) && $arResult["VARIABLES"]["user_id"] != $USER->GetID())
return;
CUtil::InitJSCore(array("window", "ajax"));
$this->IncludeComponentTemplate($componentPage, array_key_exists($componentPage, $arCustomPagesPath) ? $arCustomPagesPath[$componentPage] : "");
//top panel button to reindex
if($GLOBALS['USER']->IsAdmin())
{
$GLOBALS['APPLICATION']->AddPanelButton(array(
"HREF"=> $arResult["PATH_TO_USER_REINDEX"],
"ICON"=>"bx-panel-reindex-icon",
"ALT"=>GetMessage('SONET_PANEL_REINDEX_TITLE'),
"TEXT"=>GetMessage('SONET_PANEL_REINDEX'),
"MAIN_SORT"=>"1000",
"SORT"=>100
示例5: PrepareUserInfo
public static function PrepareUserInfo($userID, &$userInfo, $options = array())
{
$userID = intval($userID);
if ($userID <= 0) {
return false;
}
// Check if extranet user request intranet user info
if (IsModuleInstalled('extranet') && CModule::IncludeModule('extranet') && $userID != CCrmSecurityHelper::GetCurrentUserID() && !CExtranet::IsProfileViewableByID($userID)) {
return false;
}
$dbUser = CUser::GetList($by = 'ID', $order = 'ASC', array('ID' => $userID));
$arUser = $dbUser->Fetch();
if (!is_array($arUser)) {
return false;
}
if (!is_array($options)) {
$options = array();
}
$photoW = isset($options['PHOTO_WIDTH']) ? intval($options['PHOTO_WIDTH']) : 0;
$photoH = isset($options['PHOTO_HEIGHT']) ? intval($options['PHOTO_HEIGHT']) : 0;
$photoInfo = CFile::ResizeImageGet($arUser['PERSONAL_PHOTO'], array('width' => $photoW > 0 ? $photoW : 32, 'height' => $photoH > 0 ? $photoH : 32), BX_RESIZE_IMAGE_EXACT);
$nameTemplate = isset($options['NAME_TEMPLATE']) ? $options['NAME_TEMPLATE'] : '';
$userInfo['ID'] = $userID;
$userInfo['FULL_NAME'] = CUser::FormatName($nameTemplate !== '' ? $nameTemplate : CSite::GetNameFormat(false), $arUser, true, false);
$urlTemplate = isset($options['USER_PROFILE_URL_TEMPLATE']) ? $options['USER_PROFILE_URL_TEMPLATE'] : '';
$userInfo['USER_PROFILE'] = $urlTemplate !== '' ? CComponentEngine::MakePathFromTemplate($urlTemplate, array('user_id' => $userID)) : '';
$userInfo['WORK_POSITION'] = isset($arUser['WORK_POSITION']) ? $arUser['WORK_POSITION'] : '';
$userInfo['PERSONAL_PHOTO'] = isset($photoInfo['src']) ? $photoInfo['src'] : '';
return true;
}
示例6: elseif
$componentPage = "bizproc_edit";
}
elseif ($componentPage == "bizproc_task_list")
{
$componentPage = "bizproc";
}
/********************************************************************
/Buziness-process
********************************************************************/
if (
!in_array($componentPage, array("message_form_mess", "messages_chat", "messages_users_messages"))
&& IntVal($arResult["VARIABLES"]["user_id"]) > 0
&& $arResult["VARIABLES"]["user_id"] != $USER->GetID()
&& $bExtranetEnabled
&& CModule::IncludeModule('extranet')
&& !CExtranet::IsProfileViewableByID($arResult["VARIABLES"]["user_id"])
)
{
if ($componentPage = "user_blog_post")
{
if (
isset($arResult["VARIABLES"]["post_id"])
&& intval($arResult["VARIABLES"]["post_id"]) > 0
)
{
$rsLog = CSocNetLog::GetList(
array(),
array(
"EVENT_ID" => array("blog_post", "blog_post_important"),
"SOURCE_ID" => intval($arResult["VARIABLES"]["post_id"])
),