本文整理汇总了PHP中CSocNetUser::SearchUser方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetUser::SearchUser方法的具体用法?PHP CSocNetUser::SearchUser怎么用?PHP CSocNetUser::SearchUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetUser
的用法示例。
在下文中一共展示了CSocNetUser::SearchUser方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SearchAttendees
public static function SearchAttendees($name = '', $Params = array())
{
if ($Params['checkDates'] !== false && isset($Params['from'])) {
$from = self::Date(self::Timestamp($Params['from']));
$to = isset($Params['to']) ? self::Date(self::Timestamp($Params['to'])) : $from;
} elseif (isset($Params['from'], $Params['to'])) {
$from = $Params['from'];
$to = $Params['to'];
}
$eventId = intVal($Params['eventId']);
if (!isset($Params['arFoundUsers'])) {
$Params['arFoundUsers'] = CSocNetUser::SearchUser($name);
}
$arUsers = array();
if (!is_array($Params['arFoundUsers']) || count($Params['arFoundUsers']) <= 0) {
if ($Params['addExternal'] !== false) {
if (check_email($name, true)) {
$arUsers[] = array('type' => 'ext', 'email' => htmlspecialcharsex($name));
} else {
$arUsers[] = array('type' => 'ext', 'name' => htmlspecialcharsex($name));
}
}
} else {
foreach ($Params['arFoundUsers'] as $userId => $userName) {
$userId = intVal($userId);
// if ($userId == $this->userId)
// $bAddCurUser = true;
//if ($userId <= 0 || in_array($userId, $arUsers) || $userId == $this->userId)
// continue;
$by = "id";
$order = "asc";
$r = CUser::GetList($by, $order, array("ID_EQUAL_EXACT" => $userId, "ACTIVE" => "Y"));
if (!($User = $r->Fetch())) {
continue;
}
$name = trim($User['NAME'] . ' ' . $User['LAST_NAME']);
if ($name == '') {
$name = trim($User['LOGIN']);
}
$arUsers[] = array('type' => 'int', 'id' => $userId, 'name' => $name, 'status' => 'Q', 'busy' => 'free');
}
}
return $arUsers;
}
示例2: array
$arFieldsFilter = array();
if (array_key_exists("FILTER", $_POST) && is_array($_POST["FILTER"]) && Count($_POST["FILTER"]) > 0) {
foreach ($_POST["FILTER"] as $key => $value) {
if (array_key_exists($key, $arResult["TaskFields"]) && $arResult["TaskFields"][$key]["FILTERABLE"]) {
if ($key == "TASKSTATUS") {
if ($_POST["TASK_PROP_STATUS"] == "active") {
$arFieldsFilter[$key] = "active";
} elseif ($_POST["TASK_PROP_STATUS"] == "selected") {
$arFieldsFilter[$key] = $value;
}
} elseif ($arResult["TaskFields"][$key]["TYPE"] == "user") {
if (array_key_exists("USER_TYPE_FILTER", $_POST) && is_array($_POST["USER_TYPE_FILTER"])) {
if ($_POST["USER_TYPE_FILTER"][$key] == "current") {
$arFieldsFilter[$key] = "current";
} elseif ($_POST["USER_TYPE_FILTER"][$key] == "selected") {
$arFoundUsers = CSocNetUser::SearchUser($value, true);
if ($arFoundUsers && is_array($arFoundUsers) && count($arFoundUsers) > 0) {
foreach ($arFoundUsers as $userID => $userName) {
$arFieldsFilter[$key] = IntVal($userID);
break;
}
}
}
}
} elseif ($arResult["TaskFields"][$key]["TYPE"] == "datetime") {
if (array_key_exists("DATE_TYPE_FILTER", $_POST) && is_array($_POST["DATE_TYPE_FILTER"])) {
if ($_POST["DATE_TYPE_FILTER"][$key] == "current") {
$arFieldsFilter[$key] = "current";
} elseif ($_POST["DATE_TYPE_FILTER"][$key] == "selected") {
$arFieldsFilter[$key] = $value;
}
示例3: IntVal
$arParams["ENTITY_TYPE"] = SONET_ENTITY_GROUP;
} else {
$arParams["TO_USER_ID"] = IntVal($_REQUEST["flt_to_user_id"]);
}
$arParams["USER_ID"] = IntVal($arParams["USER_ID"]);
if ($arParams["USER_ID"] <= 0) {
$arParams["USER_ID"] = IntVal($_REQUEST["flt_user_id"]);
}
if (is_array($_REQUEST["flt_created_by_id"])) {
$_REQUEST["flt_created_by_id"] = $_REQUEST["flt_created_by_id"][0];
}
preg_match('/^(\\d+)$/', $_REQUEST["flt_created_by_id"], $matches);
if (count($matches) > 0) {
$arParams["CREATED_BY_ID"] = $_REQUEST["flt_created_by_id"];
} else {
$arFoundUsers = CSocNetUser::SearchUser($_REQUEST["flt_created_by_id"], false);
if (is_array($arFoundUsers) && count($arFoundUsers) > 0) {
$arParams["CREATED_BY_ID"] = key($arFoundUsers);
}
}
$arParams["NAME_TEMPLATE"] = $arParams["NAME_TEMPLATE"] ? $arParams["NAME_TEMPLATE"] : CSite::GetNameFormat();
$arParams["NAME_TEMPLATE_WO_NOBR"] = str_replace(array("#NOBR#", "#/NOBR#"), array("", ""), $arParams["NAME_TEMPLATE"]);
$bUseLogin = $arParams['SHOW_LOGIN'] != "N" ? true : false;
if (StrLen($arParams["ENTITY_TYPE"]) <= 0) {
$arParams["ENTITY_TYPE"] = Trim($_REQUEST["flt_entity_type"]);
}
$arParams["AVATAR_SIZE_COMMON"] = isset($arParams["AVATAR_SIZE_COMMON"]) && intval($arParams["AVATAR_SIZE_COMMON"]) > 0 ? intval($arParams["AVATAR_SIZE_COMMON"]) : 58;
$arParams["AVATAR_SIZE"] = isset($arParams["AVATAR_SIZE"]) && intval($arParams["AVATAR_SIZE"]) > 0 ? intval($arParams["AVATAR_SIZE"]) : 50;
$arParams["AVATAR_SIZE_COMMENT"] = isset($arParams["AVATAR_SIZE_COMMENT"]) && intval($arParams["AVATAR_SIZE_COMMENT"]) > 0 ? intval($arParams["AVATAR_SIZE_COMMENT"]) : 39;
$arParams["USE_COMMENTS"] = isset($arParams["USE_COMMENTS"]) ? $arParams["USE_COMMENTS"] : "N";
$arParams["COMMENTS_IN_EVENT"] = isset($arParams["COMMENTS_IN_EVENT"]) && intval($arParams["COMMENTS_IN_EVENT"]) > 0 ? $arParams["COMMENTS_IN_EVENT"] : "3";
示例4: HandleUserSearch
function HandleUserSearch($name, $from, $to, $arFoundUsers = false, $eventId = false, &$bAddCurUser = false)
{
$eventId = intVal($eventId);
if ($arFoundUsers === false) {
$arFoundUsers = CSocNetUser::SearchUser($name);
}
if (!is_array($arFoundUsers) || count($arFoundUsers) <= 0) {
return array();
}
$arUsers = array();
foreach ($arFoundUsers as $userId => $userName) {
$userId = intVal($userId);
if ($userId == $this->userId) {
$bAddCurUser = true;
}
if ($userId <= 0 || in_array($userId, $arUsers) || $userId == $this->userId) {
continue;
}
$r = CUser::GetList($by = "id", $order = "asc", array("ID_EQUAL_EXACT" => $userId, "ACTIVE" => "Y"));
if (!($User = $r->Fetch())) {
continue;
}
$name = trim($User['NAME'] . ' ' . $User['LAST_NAME']);
if ($name == '') {
$name = trim($User['LOGIN']);
}
$arUsers[] = array('id' => $userId, 'name' => $name, 'status' => 'Q', 'busy' => $this->GetGuestAccessibility(array('userId' => $userId, 'from' => $from, 'to' => $to)));
}
return $arUsers;
}
示例5: array
$arUserIDs = array();
$arUsersList = array();
$arUsersListTmp = Explode(",", $_POST["users_list"]);
foreach ($arUsersListTmp as $userTmp) {
$userTmp = Trim($userTmp);
if (StrLen($userTmp) > 0) {
$arUsersList[] = $userTmp;
}
}
if ($arResult["TAB"] == "invite" && Count($arUsersList) <= 0) {
$errorMessage .= GetMessage("SONET_GCE_NO_USERS") . ". ";
$arResult["ErrorFields"][] = "USERS";
}
if (StrLen($errorMessage) <= 0) {
foreach ($arUsersList as $user) {
$arFoundUsers = CSocNetUser::SearchUser($user);
if ($arFoundUsers && is_array($arFoundUsers) && count($arFoundUsers) > 0) {
foreach ($arFoundUsers as $userID => $userName) {
if (intval($userID) > 0) {
$arUserIDs[] = $userID;
}
}
}
}
}
$arResult["POST"]["USER_IDS"] = $arUserIDs;
}
}
}
if ((!array_key_exists("TAB", $arResult) || $arResult["TAB"] == "edit") && strlen($errorMessage) <= 0) {
$arFields = array("NAME" => $_POST["GROUP_NAME"], "DESCRIPTION" => $_POST["GROUP_DESCRIPTION"], "VISIBLE" => $_POST["GROUP_VISIBLE"] == "Y" ? "Y" : "N", "OPENED" => $_POST["GROUP_OPENED"] == "Y" ? "Y" : "N", "CLOSED" => $_POST["GROUP_CLOSED"] == "Y" ? "Y" : "N", "SUBJECT_ID" => $_POST["GROUP_SUBJECT_ID"], "KEYWORDS" => $_POST["GROUP_KEYWORDS"], "IMAGE_ID" => $arImageID, "INITIATE_PERMS" => $_POST["GROUP_INITIATE_PERMS"], "SPAM_PERMS" => $_POST["GROUP_SPAM_PERMS"]);
示例6: Trim
$userTmp = Trim($userTmp);
if (StrLen($userTmp) > 0) {
$arUsersList[] = $userTmp;
}
}
if (!$arResult["bExtranet"]) {
if (Count($arUsersList) <= 0 && strlen($_POST[$arParams["IUS_INPUT_NAME_SUSPICIOUS"]]) <= 0) {
$errorMessage .= GetMessage("SONET_C33_NO_USERS") . ". ";
}
} elseif (Count($arUsersList) <= 0 && strlen($_POST["EMAILS"]) <= 0 && strlen($_POST[$arParams["IUS_INPUT_NAME_SUSPICIOUS_EXTRANET"]]) <= 0 && strlen($_POST[$arParams["IUS_INPUT_NAME_SUSPICIOUS"]]) <= 0) {
$errorMessage .= GetMessage("SONET_C33_NO_USERS") . ". ";
}
if (StrLen($errorMessage) <= 0) {
$arUsersIDByInput = array();
foreach ($arUsersList as $user) {
$arFoundUsers = CSocNetUser::SearchUser($user, $bIntranet);
if ($arFoundUsers && is_array($arFoundUsers) && count($arFoundUsers) > 0) {
foreach ($arFoundUsers as $userID => $userName) {
$userID = IntVal($userID);
if ($userID > 0) {
if (in_array($userID, $arUsersIDByInput)) {
continue;
}
$arUsersIDByInput[] = $userID;
$arUsersFull[] = array("ID" => $userID, "NAME_FORMATTED" => $userName);
}
}
} else {
$arErrorUsers[] = array($user, "");
$warningMessage .= Str_Replace("#NAME#", HtmlSpecialCharsEx($user), GetMessage("SONET_C33_NO_USER1") . ". ");
}
示例7: array
$arFields = array("MODIFIED_BY" => $GLOBALS["USER"]->GetID());
if ($bTextModified) {
$arFields["DETAIL_TEXT"] = $detailText;
}
$bTextModified = false;
$u = $_POST["PROPERTY_TaskAssignedTo"];
if (is_array($u)) {
if (count($u) > 0) {
$u1 = array_keys($u);
$u = $u[$u1[0]];
} else {
$u = "";
}
}
$r = array();
$arFoundUsers = CSocNetUser::SearchUser($u, true);
if ($arFoundUsers && is_array($arFoundUsers) && count($arFoundUsers) > 0) {
foreach ($arFoundUsers as $userID => $userName) {
$r[] = intval($userID);
}
}
$arFields["PROPERTY_TaskAssignedTo"] = count($r) > 0 ? $r[0] : 0;
if ($arFields["PROPERTY_TaskAssignedTo"] <= 0) {
$arResult["ErrorMessage"] .= str_replace("#FIELD#", GetMessage("INTE_TASKS_RESPONSIBLE"), GetMessage("INTE_TASKS_EMPTY_FIELD")) . "<br />";
}
if (strlen($arResult["ErrorMessage"]) <= 0) {
$arErrorsTmp = array();
CIntranetTasks::Update($arParams["TASK_ID"], $arFields, $arErrorsTmp);
if (count($arErrorsTmp) > 0) {
foreach ($arErrorsTmp as $e) {
$arResult["ErrorMessage"] .= $e["message"] . "<br />";