本文整理汇总了PHP中erLhcoreClassUserDep::getUserDepartaments方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassUserDep::getUserDepartaments方法的具体用法?PHP erLhcoreClassUserDep::getUserDepartaments怎么用?PHP erLhcoreClassUserDep::getUserDepartaments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类erLhcoreClassUserDep
的用法示例。
在下文中一共展示了erLhcoreClassUserDep::getUserDepartaments方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDepartmentLimitation
public static function getDepartmentLimitation()
{
$currentUser = erLhcoreClassUser::instance();
$LimitationDepartament = '';
$userData = $currentUser->getUserData(true);
if ($userData->all_departments == 0) {
$userDepartaments = erLhcoreClassUserDep::getUserDepartaments($currentUser->getUserID());
if (count($userDepartaments) == 0) {
return false;
}
$LimitationDepartament = '(lh_transfer.dep_id IN (' . implode(',', $userDepartaments) . '))';
return $LimitationDepartament;
}
return true;
}
示例2: getOnlineOperators
public static function getOnlineOperators($currentUser, $canListOnlineUsersAll = false)
{
$LimitationDepartament = '';
$userData = $currentUser->getUserData(true);
$filter = array();
if ($userData->all_departments == 0 && $canListOnlineUsersAll == false) {
$userDepartaments = erLhcoreClassUserDep::getUserDepartaments($currentUser->getUserID());
if (count($userDepartaments) == 0) {
return array();
}
$index = array_search(-1, $userDepartaments);
if ($index !== false) {
unset($userDepartaments[$index]);
}
$filter['customfilter'][] = '(dep_id IN (' . implode(',', $userDepartaments) . ') OR user_id = ' . $currentUser->getUserID() . ')';
}
$filter['filtergt']['last_activity'] = time() - 120;
$filter['limit'] = 10;
$filter['sort'] = 'last_activity DESC';
$filter['groupby'] = 'user_id';
return self::getList($filter);
}
示例3: is_numeric
if ($showDepartmentsStats == true) {
/**
* Departments stats
* */
$limitList = is_numeric($Params['user_parameters_unordered']['limitd']) ? (int) $Params['user_parameters_unordered']['limitd'] : 10;
$filter = array('ignore_fields' => erLhcoreClassChat::$chatListIgnoreField);
$filter['limit'] = $limitList;
if (is_array($Params['user_parameters_unordered']['departmentd']) && !empty($Params['user_parameters_unordered']['departmentd'])) {
erLhcoreClassChat::validateFilterIn($Params['user_parameters_unordered']['departmentd']);
$filter['filterin']['id'] = $Params['user_parameters_unordered']['departmentd'];
}
// Add permission check if operator does not have permission to see all departments stats
if ($showDepartmentsStatsAll === false) {
$userData = $currentUser->getUserData(true);
if ($userData->all_departments == 0) {
$userDepartaments = erLhcoreClassUserDep::getUserDepartaments($currentUser->getUserID());
if (!empty($userDepartaments)) {
if (isset($filter['filterin']['id'])) {
$validDepartments = array_intersect($userDepartaments, $filter['filterin']['id']);
if (!empty($validDepartments)) {
$filter['filterin']['id'] = $validDepartments;
} else {
$filter['filterin']['id'] = array(-1);
}
} else {
$filter['filterin']['id'] = $userDepartaments;
}
} else {
$filter['filterin']['id'] = array(-1);
// No departments
}
示例4: hasAccessToRead
public static function hasAccessToRead($chat)
{
$currentUser = erLhcoreClassUser::instance();
$userData = $currentUser->getUserData(true);
if ($userData->all_departments == 0) {
/*
* --From now permission is strictly by assigned department, not by chat owner
*
* Finally decided to keep this check, it allows more advance permissions configuration
* */
if ($chat->user_id == $currentUser->getUserID()) {
return true;
}
$userDepartaments = erLhcoreClassUserDep::getUserDepartaments($currentUser->getUserID());
if (count($userDepartaments) == 0) {
return false;
}
if (in_array($chat->dep_id, $userDepartaments)) {
if ($currentUser->hasAccessTo('lhchat', 'allowopenremotechat') == true) {
return true;
} elseif ($chat->user_id == 0 || $chat->user_id == $currentUser->getUserID()) {
return true;
}
return false;
}
return false;
}
return true;
}
示例5:
?>
</h5>
<?php
if (isset($account_updated_departaments) && $account_updated_departaments == 'done') {
$msg = erTranslationClassLhTranslation::getInstance()->getTranslation('user/account', 'Account updated');
?>
<?php
include erLhcoreClassDesign::designtpl('lhkernel/alert_success.tpl.php');
?>
<?php
}
?>
<?php
$userDepartaments = erLhcoreClassUserDep::getUserDepartaments($user->id);
?>
<form action="<?php
echo erLhcoreClassDesign::baseurl('user/edit');
?>
/<?php
echo $user->id;
?>
#departments" method="post">
<?php
include erLhcoreClassDesign::designtpl('lhkernel/csfr_token.tpl.php');
?>
<label><input type="checkbox" value="on" name="all_departments" <?php
示例6: hasAccessToRead
/**
*
* @param erLhcoreClassModelChat $chat
*
* @return boolean
*/
public static function hasAccessToRead(erLhcoreClassModelChat $chat)
{
if (self::$apiKey->user->all_departments == 0) {
if ($chat->user_id == self::$apiKey->user->id) {
return true;
}
$userDepartaments = erLhcoreClassUserDep::getUserDepartaments(self::$apiKey->user->id);
if (count($userDepartaments) == 0) {
return false;
}
if (in_array($chat->dep_id, $userDepartaments)) {
if (self::hasAccessTo('lhchat', 'allowopenremotechat') == true || $chat->status == erLhcoreClassModelChat::STATUS_OPERATORS_CHAT) {
return true;
} elseif ($chat->user_id == 0 || $chat->user_id == self::$apiKey->user->id) {
return true;
}
return false;
}
return false;
}
return true;
}