本文整理汇总了PHP中erLhcoreClassUserDep::setHideOnlineStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassUserDep::setHideOnlineStatus方法的具体用法?PHP erLhcoreClassUserDep::setHideOnlineStatus怎么用?PHP erLhcoreClassUserDep::setHideOnlineStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类erLhcoreClassUserDep
的用法示例。
在下文中一共展示了erLhcoreClassUserDep::setHideOnlineStatus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$response = erLhcoreClassChatEventDispatcher::getInstance()->dispatch('user.edit.photo_resize_150', array('mime_type' => $file["data"]['mime_type'], 'user' => $UserData));
if ($response === false) {
erLhcoreClassImageConverter::getInstance()->converter->transform('photow_150', $UserData->file_path_server, $UserData->file_path_server);
chmod($UserData->file_path_server, 0644);
}
}
}
if (count($Errors) == 0) {
// Update password if neccesary
if ($form->hasInputField('Password') && $form->hasInputField('Password1') && $form->Password != '') {
$UserData->setPassword($form->Password);
}
$UserData->email = $form->Email;
$UserData->name = $form->Name;
erLhcoreClassUser::getSession()->update($UserData);
erLhcoreClassUserDep::setHideOnlineStatus($UserData);
erLhcoreClassModelGroupUser::removeUserFromGroups($UserData->id);
foreach ($UserData->user_groups_id as $group_id) {
$groupUser = new erLhcoreClassModelGroupUser();
$groupUser->group_id = $group_id;
$groupUser->user_id = $UserData->id;
$groupUser->saveThis();
}
$CacheManager = erConfigClassLhCacheConfig::getInstance();
$CacheManager->expireCache();
if (isset($_POST['Save_account'])) {
erLhcoreClassModule::redirect('user/userlist');
exit;
} else {
$tpl->set('updated', true);
}
示例2: handleOperatorPing
/**
* Handlers requests like
*
* May 08 23:02:11 [Warning] [default] [default] {"action":"ping","user":"remdex2@xmpp.livehelperchat.com/25304460891431118632139491"}
* May 08 23:02:14 [Warning] [default] [default] {"action":"disconnect","user":"remdex2","server":"xmpp.livehelperchat.com"}
* May 08 23:21:52 [Warning] [default] [default] {"action":"connect","user":"remdex2","server":"xmpp.livehelperchat.com"}
*/
public static function handleOperatorPing($jsonContent)
{
$params = json_decode($jsonContent, true);
$xmppService = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionXmppservice');
// If ping just update last action
if ($params['action'] == 'ping') {
// Parse user parts
$userParts = self::parseXMPPUser($params['user']);
// Fetches user id by xmpp username
$userId = self::getUserIDByXMPPUsername($userParts['xmppuser']);
// Updates last activity
if (is_numeric($userId)) {
self::updateActivityByUserId($userId, time() + $xmppService->settings['append_time']);
} else {
throw new Exception("Could not find LHC user by user - " . $userParts['xmppuser']);
}
} elseif ($params['action'] == 'disconnect' || $params['action'] == 'connect') {
// Fetches user id by xmpp username
$userId = self::getUserIDByXMPPUsername($params['user'] . '@' . $params['server']);
// Updates last activity to zero
if (is_numeric($userId)) {
self::updateActivityByUserId($userId, $params['action'] == 'connect' ? time() + $xmppService->settings['append_time'] : 0);
if ($params['action'] == 'connect') {
$userData = erLhcoreClassModelUser::fetch($userId);
if ($userData instanceof erLhcoreClassModelUser && $userData->hide_online == 1) {
$userData->hide_online = 0;
erLhcoreClassUser::getSession()->update($userData);
erLhcoreClassUserDep::setHideOnlineStatus($userData);
}
}
} else {
throw new Exception("Could not find LHC user by user - " . $params['user'] . '@' . $params['server']);
}
}
return true;
}