当前位置: 首页>>代码示例>>PHP>>正文


PHP erLhcoreClassModelUser::fetch方法代码示例

本文整理汇总了PHP中erLhcoreClassModelUser::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassModelUser::fetch方法的具体用法?PHP erLhcoreClassModelUser::fetch怎么用?PHP erLhcoreClassModelUser::fetch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在erLhcoreClassModelUser的用法示例。


在下文中一共展示了erLhcoreClassModelUser::fetch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __get

 public function __get($var)
 {
     switch ($var) {
         case 'user':
             $this->user = erLhcoreClassModelUser::fetch($this->user_id);
             return $this->user;
             break;
         default:
             break;
     }
 }
开发者ID:sudogitguy,项目名称:livehelperchat,代码行数:11,代码来源:erlhcoreclassmodeluserdep.php

示例2: __get

 public function __get($var)
 {
     switch ($var) {
         case 'dep_group':
             $this->dep_group = erLhcoreClassModelDepartamentGroup::fetch($this->dep_group_id);
             return $this->dep_group;
             break;
         case 'user':
             $this->user = erLhcoreClassModelUser::fetch($this->user_id);
             return $this->user;
             break;
         default:
             break;
     }
 }
开发者ID:remdex,项目名称:livehelperchat,代码行数:15,代码来源:erlhcoreclassmodeldepartamentgroupuser.php

示例3: __get

 public function __get($var)
 {
     switch ($var) {
         case 'user':
             try {
                 $this->user = erLhcoreClassModelUser::fetch($this->user_id);
             } catch (Exception $e) {
                 $this->user = 'Not exist';
             }
             return $this->user;
             break;
         default:
             break;
     }
 }
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:15,代码来源:erlhcoreclassmodelgroupuser.php

示例4: __get

 public function __get($var)
 {
     switch ($var) {
         case 'user':
             $this->user = false;
             if ($this->user_id > 0) {
                 try {
                     $this->user = erLhcoreClassModelUser::fetch($this->user_id);
                 } catch (Exception $e) {
                     $this->user = false;
                 }
             }
             return $this->user;
             break;
         case 'department':
             $this->department = false;
             if ($this->department_id > 0) {
                 try {
                     $this->department = erLhcoreClassModelDepartament::fetch($this->department_id, true);
                 } catch (Exception $e) {
                     $this->department = false;
                 }
             }
             return $this->department;
             break;
         case 'msg_to_user':
             $this->msg_to_user = str_replace(array_keys($this->replaceData), array_values($this->replaceData), $this->msg);
             // If not all variables were replaced fallback to fallback message
             if (preg_match('/\\{[a-zA-Z0-9_]+\\}/i', $this->msg_to_user)) {
                 $this->msg_to_user = str_replace(array_keys($this->replaceData), array_values($this->replaceData), $this->fallback_msg);
             }
             return $this->msg_to_user;
             break;
         case 'message_title':
             if ($this->title != '') {
                 $this->message_title = $this->title;
             } else {
                 $this->message_title = $this->msg_to_user;
             }
             return $this->message_title;
             break;
         default:
             break;
     }
 }
开发者ID:niravpatel2008,项目名称:north-american-nemesis-new,代码行数:45,代码来源:erlhcoreclassmodelcannedmsg.php

示例5: __get

 public function __get($var)
 {
     switch ($var) {
         case 'user':
             $this->user = false;
             if ($this->user_id > 0) {
                 try {
                     $this->user = erLhcoreClassModelUser::fetch($this->user_id);
                 } catch (Exception $e) {
                     $this->user = false;
                 }
             }
             return $this->user;
             break;
         default:
             break;
     }
 }
开发者ID:sudogitguy,项目名称:livehelperchat,代码行数:18,代码来源:erlhcoreclassmodelcannedmsg.php

示例6: __get

 public function __get($var)
 {
     switch ($var) {
         case 'user':
             $this->user = erLhcoreClassModelUser::fetch($this->user_id);
             return $this->user;
             break;
         case 'lastactivity_ago':
             $this->lastactivity_ago = $this->user->lastactivity_ago;
             return $this->lastactivity_ago;
             break;
         case 'name_support':
             $this->name_support = $this->user->name_support;
             return $this->name_support;
             break;
         case 'name_official':
             $this->name_official = $this->user->name_official;
             return $this->name_official;
             break;
         case 'departments_names':
             $this->departments_names = array();
             $ids = $this->user->departments_ids;
             if ($ids != '') {
                 $parts = explode(',', $ids);
                 sort($parts);
                 foreach ($parts as $depId) {
                     if ($depId == 0) {
                         $this->departments_names[] = '∞';
                     } elseif ($depId > 0) {
                         try {
                             $dep = erLhcoreClassModelDepartament::fetch($depId, true);
                             $this->departments_names[] = $dep->name;
                         } catch (Exception $e) {
                         }
                     }
                 }
             }
             return $this->departments_names;
             break;
         default:
             break;
     }
 }
开发者ID:remdex,项目名称:livehelperchat,代码行数:43,代码来源:erlhcoreclassmodeluserdep.php

示例7: __get

 public function __get($var)
 {
     switch ($var) {
         case 'file_path_server':
             $this->file_path_server = $this->file_path . $this->name;
             return $this->file_path_server;
             break;
         case 'security_hash':
             $this->security_hash = md5($this->name . '_' . $this->chat_id);
             return $this->security_hash;
             break;
         case 'chat':
             $this->chat = false;
             if ($this->chat_id > 0) {
                 try {
                     $this->chat = erLhcoreClassModelChat::fetch($this->chat_id);
                 } catch (Exception $e) {
                     $this->chat = new erLhcoreClassModelChat();
                 }
             }
             return $this->chat;
             break;
         case 'user':
             $this->user = false;
             if ($this->user_id > 0) {
                 try {
                     $this->user = erLhcoreClassModelUser::fetch($this->user_id);
                 } catch (Exception $e) {
                     $this->user = false;
                 }
             }
             return $this->user;
             break;
         case 'date_front':
             $this->date_front = date(erLhcoreClassModule::$dateDateHourFormat, $this->date);
             return $this->date_front;
             break;
         default:
             break;
     }
 }
开发者ID:Topspot,项目名称:livehelperchat,代码行数:41,代码来源:erlhcoreclassmodelchatfile.php

示例8: __get

 public function __get($var)
 {
     switch ($var) {
         case 'ctime_front':
             $this->ctime_front = date('Ymd') == date('Ymd', $this->ctime) ? date(erLhcoreClassModule::$dateHourFormat, $this->ctime) : date(erLhcoreClassModule::$dateDateHourFormat, $this->ctime);
             return $this->ctime_front;
             break;
         case 'lactivity_front':
             $this->lactivity_front = date('Ymd') == date('Ymd', $this->lactivity) ? date(erLhcoreClassModule::$dateHourFormat, $this->lactivity) : date(erLhcoreClassModule::$dateDateHourFormat, $this->lactivity);
             return $this->lactivity_front;
             break;
         case 'user':
             $this->user = false;
             if ($this->user_id > 0) {
                 try {
                     $this->user = erLhcoreClassModelUser::fetch($this->user_id, true);
                 } catch (Exception $e) {
                     $this->user = false;
                 }
             }
             return $this->user;
             break;
         case 'username_plain':
             list($this->username_plain) = explode('@', $this->username);
             return $this->username_plain;
             break;
         case 'username_plain_edit':
             list($this->username_plain_edit) = explode('@', $this->username);
             $subdomain = erLhcoreClassModule::getExtensionInstance('erLhcoreClassExtensionXmppservice')->settings['subdomain'];
             if ($subdomain != '') {
                 $this->username_plain_edit = $this->str_lreplace('.' . $subdomain, '', $this->username_plain_edit);
             }
             return $this->username_plain_edit;
             break;
         default:
             break;
     }
 }
开发者ID:noikiy,项目名称:xmpp-chat,代码行数:38,代码来源:erlhcoreclassmodelxmppaccount.php

示例9: header

<?php

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept');
header('Content-Type: application/json');
try {
    erLhcoreClassRestAPIHandler::validateRequest();
    if (isset($_GET['user_id']) && is_numeric($_GET['user_id'])) {
        $userData = erLhcoreClassModelUser::fetch((int) $_GET['user_id']);
    } elseif (isset($_GET['username']) && !empty($_GET['username'])) {
        $userData = erLhcoreClassModelUser::findOne(array('filter' => array('username' => $_GET['username'])));
    } elseif (isset($_GET['email']) && !empty($_GET['email'])) {
        $userData = erLhcoreClassModelUser::findOne(array('filter' => array('email' => $_GET['email'])));
    }
    if (!$userData instanceof erLhcoreClassModelUser) {
        throw new Exception('User could not be found!');
    }
    if ($_GET['status'] == 'true') {
        $userData->hide_online = 0;
        $text = 'flash_on';
    } else {
        $text = 'flash_off';
        $userData->hide_online = 1;
    }
    $userData->operation_admin .= "\$('#online-offline-user').text('" . $text . "');";
    erLhcoreClassUser::getSession()->update($userData);
    erLhcoreClassUserDep::setHideOnlineStatus($userData);
    erLhcoreClassRestAPIHandler::outputResponse(array('offline' => $userData->hide_online));
    erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.operator_status_changed', array('user' => &$userData, 'reason' => 'rest_api'));
} catch (Exception $e) {
    echo json_encode(array('error' => true, 'result' => $e->getMessage()));
开发者ID:detain,项目名称:livehelperchat,代码行数:31,代码来源:setoperatorstatus.php

示例10: catch

<?php

$tpl = erLhcoreClassTemplate::getInstance('lhuser/edit.tpl.php');
try {
    $UserData = erLhcoreClassModelUser::fetch((int) $Params['user_parameters']['user_id']);
} catch (Exception $e) {
    erLhcoreClassModule::redirect('user/userlist');
    exit;
}
$tpl->set('tab', $Params['user_parameters_unordered']['tab'] == 'canned' ? 'tab_canned' : '');
if (isset($_POST['Update_account']) || isset($_POST['Save_account'])) {
    if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
        erLhcoreClassModule::redirect('user/edit', '/' . $UserData->id);
        exit;
    }
    $Errors = erLhcoreClassUserValidator::validateUserEdit($UserData);
    if (isset($_POST['DeletePhoto'])) {
        $UserData->removeFile();
    }
    $userPhotoErrors = erLhcoreClassUserValidator::validateUserPhoto($UserData);
    if ($userPhotoErrors !== false) {
        $Errors = array_merge($Errors, $userPhotoErrors);
    }
    if (count($Errors) == 0) {
        erLhcoreClassUser::getSession()->update($UserData);
        erLhcoreClassUserDep::setHideOnlineStatus($UserData);
        $UserData->setUserGroups();
        $CacheManager = erConfigClassLhCacheConfig::getInstance();
        $CacheManager->expireCache();
        erLhcoreClassChatEventDispatcher::getInstance()->dispatch('user.user_modified', array('userData' => &$UserData, 'password' => $UserData->password_front));
        if (isset($_POST['Save_account'])) {
开发者ID:detain,项目名称:livehelperchat,代码行数:31,代码来源:edit.php

示例11: rawurlencode

    $redirectHash = rawurlencode(rawurldecode($Params['user_parameters']['hash']));
    header('Location: ' . erLhcoreClassDesign::baseurldirect('site_admin/user/autologin') . '/' . $redirectHash . $redirectFull);
    exit;
}
$data = erLhcoreClassModelChatConfig::fetch('autologin_data')->data;
if ($data['enabled'] == 1) {
    $dataRequest = array('r' => base64_decode(rawurldecode($Params['user_parameters_unordered']['r'])), 'u' => rawurldecode($Params['user_parameters_unordered']['u']), 'l' => rawurldecode($Params['user_parameters_unordered']['l']), 't' => rawurldecode($Params['user_parameters_unordered']['t']));
    $dataRequest = array_filter($dataRequest);
    $validateHash = sha1($data['secret_hash'] . sha1($data['secret_hash'] . implode(',', $dataRequest)));
    if ($validateHash == $Params['user_parameters']['hash']) {
        if ($dataRequest['t'] > 0 && $dataRequest['t'] < time()) {
            die(erTranslationClassLhTranslation::getInstance()->getTranslation('users/autologin', 'Autologin hash has expired'));
        }
        try {
            if (is_numeric($dataRequest['u'])) {
                $userToLogin = erLhcoreClassModelUser::fetch((int) $dataRequest['u']);
            } else {
                $users = erLhcoreClassModelUser::getUserList(array('limit' => 1, 'filter' => array('username' => $dataRequest['l'])));
                if (!empty($users)) {
                    $userToLogin = array_shift($users);
                } else {
                    die(erTranslationClassLhTranslation::getInstance()->getTranslation('users/autologin', 'Could not find a user'));
                }
            }
        } catch (Exception $e) {
            die($e->getMessage());
        }
        if ($userToLogin instanceof erLhcoreClassModelUser) {
            erLhcoreClassUser::instance()->setLoggedUser($userToLogin->id);
            header('Location: ' . erLhcoreClassDesign::baseurldirect('site_admin') . '/' . ltrim($dataRequest['r'], '/'));
            exit;
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:31,代码来源:autologin.php

示例12: foreach

    ?>
','<?php 
    echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/statistic', 'Messages');
    ?>
']
		    <?php 
    foreach ($numberOfMsgByUser as $data) {
        $operator = '';
        if ($data['user_id'] == 0) {
            $operator = 'Visitor';
        } elseif ($data['user_id'] == -1) {
            $operator = 'System assistant';
        } elseif ($data['user_id'] == -2) {
            $operator = 'Virtual assistant';
        } else {
            $operatorObj = erLhcoreClassModelUser::fetch($data['user_id'], true);
            if (is_object($operatorObj)) {
                $operator = $operatorObj->username;
            } else {
                $operator = '[' . $data['user_id'] . ']';
            }
        }
        ?>
		    <?php 
        echo ',[\'' . htmlspecialchars($operator, ENT_QUOTES) . '\',' . $data['number_of_chats'] . ']';
        ?>
		    <?php 
    }
    ?>
		  ]);	   
		  var options = {
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:31,代码来源:active.tpl.php

示例13: __get

 public function __get($var)
 {
     switch ($var) {
         case 'time_created_front':
             $this->time_created_front = date('Ymd') == date('Ymd', $this->time) ? date(erLhcoreClassModule::$dateHourFormat, $this->time) : date(erLhcoreClassModule::$dateDateHourFormat, $this->time);
             return $this->time_created_front;
             break;
         case 'user_closed_ts_front':
             $this->user_closed_ts_front = date('Ymd') == date('Ymd', $this->user_closed_ts) ? date(erLhcoreClassModule::$dateHourFormat, $this->user_closed_ts) : date(erLhcoreClassModule::$dateDateHourFormat, $this->user_closed_ts);
             return $this->user_closed_ts_front;
             break;
         case 'is_operator_typing':
             $this->is_operator_typing = $this->operator_typing > time() - 60;
             // typing is considered if status did not changed for 30 seconds
             return $this->is_operator_typing;
             break;
         case 'is_user_typing':
             $this->is_user_typing = $this->user_typing > time() - 10;
             // typing is considered if status did not changed for 30 seconds
             return $this->is_user_typing;
             break;
         case 'wait_time_seconds':
             $this->wait_time_seconds = time() - $this->time;
             return $this->wait_time_seconds;
         case 'wait_time_front':
             $this->wait_time_front = erLhcoreClassChat::formatSeconds($this->wait_time);
             return $this->wait_time_front;
             break;
         case 'wait_time_pending':
             $this->wait_time_pending = erLhcoreClassChat::formatSeconds(time() - $this->time);
             return $this->wait_time_pending;
             break;
         case 'chat_duration_front':
             $this->chat_duration_front = erLhcoreClassChat::formatSeconds($this->chat_duration);
             return $this->chat_duration_front;
             break;
         case 'user_name':
             return $this->user_name = (string) $this->user;
             break;
         case 'plain_user_name':
             $this->plain_user_name = false;
             if ($this->user !== false) {
                 $this->plain_user_name = (string) $this->user->name_support;
             }
             return $this->plain_user_name;
             break;
         case 'user':
             $this->user = false;
             if ($this->user_id > 0) {
                 try {
                     $this->user = erLhcoreClassModelUser::fetch($this->user_id, true);
                 } catch (Exception $e) {
                     $this->user = false;
                 }
             }
             return $this->user;
             break;
         case 'operator_typing_user':
             $this->operator_typing_user = false;
             if ($this->operator_typing_id > 0) {
                 try {
                     $this->operator_typing_user = erLhcoreClassModelUser::fetch($this->operator_typing_id);
                 } catch (Exception $e) {
                     $this->operator_typing_user = false;
                 }
             }
             return $this->operator_typing_user;
             break;
         case 'online_user':
             $this->online_user = false;
             if ($this->online_user_id > 0) {
                 try {
                     $this->online_user = erLhcoreClassModelChatOnlineUser::fetch($this->online_user_id);
                 } catch (Exception $e) {
                     $this->online_user = false;
                 }
             }
             return $this->online_user;
             break;
         case 'department':
             $this->department = false;
             if ($this->dep_id > 0) {
                 try {
                     $this->department = erLhcoreClassModelDepartament::fetch($this->dep_id, true);
                 } catch (Exception $e) {
                 }
             }
             return $this->department;
             break;
         case 'department_name':
             return $this->department_name = (string) $this->department;
             break;
         case 'number_in_queue':
             $this->number_in_queue = 1;
             if ($this->status == self::STATUS_PENDING_CHAT) {
                 $this->number_in_queue = erLhcoreClassChat::getCount(array('filterlt' => array('id' => $this->id), 'filter' => array('dep_id' => $this->dep_id, 'status' => self::STATUS_PENDING_CHAT))) + 1;
             }
             return $this->number_in_queue;
             break;
         case 'screenshot':
//.........这里部分代码省略.........
开发者ID:kenjiro7,项目名称:livehelperchat,代码行数:101,代码来源:erlhcoreclassmodelchat.php

示例14: __get

 public function __get($var)
 {
     switch ($var) {
         case 'last_visit_front':
             return $this->last_visit_front = date(erLhcoreClassModule::$dateDateHourFormat, $this->last_visit);
             break;
         case 'first_visit_front':
             return $this->first_visit_front = date(erLhcoreClassModule::$dateDateHourFormat, $this->first_visit);
             break;
         case 'invitation':
             $this->invitation = false;
             if ($this->invitation_id > 0) {
                 try {
                     $this->invitation = erLhAbstractModelProactiveChatInvitation::fetch($this->invitation_id);
                 } catch (Exception $e) {
                     $this->invitation = false;
                 }
             }
             return $this->invitation;
             break;
         case 'has_message_from_operator':
             return $this->message_seen == 0 && $this->operator_message != '';
             break;
         case 'chat':
             $this->chat = false;
             if ($this->chat_id > 0) {
                 try {
                     $this->chat = erLhcoreClassModelChat::fetch($this->chat_id);
                 } catch (Exception $e) {
                     //
                 }
             }
             return $this->chat;
             break;
         case 'can_view_chat':
             $this->can_view_chat = false;
             $currentUser = erLhcoreClassUser::instance();
             if ($this->operator_user_id == $currentUser->getUserID()) {
                 $this->can_view_chat = true;
                 // Faster way
             } else {
                 if ($this->chat instanceof erLhcoreClassModelChat) {
                     $this->can_view_chat = erLhcoreClassChat::hasAccessToRead($this->chat);
                 }
             }
             return $this->can_view_chat;
             break;
         case 'operator_user':
             $this->operator_user = false;
             if ($this->operator_user_id > 0) {
                 try {
                     $this->operator_user = erLhcoreClassModelUser::fetch($this->operator_user_id);
                 } catch (Exception $e) {
                 }
             }
             return $this->operator_user;
             break;
         case 'operator_user_send':
             $this->operator_user_send = $this->operator_user !== false;
             return $this->operator_user_send;
             break;
         case 'operator_user_string':
             $this->operator_user_string = (string) $this->operator_user;
             return $this->operator_user_string;
             break;
         case 'time_on_site_front':
             $this->time_on_site_front = gmdate(erLhcoreClassModule::$dateHourFormat, $this->time_on_site);
             return $this->time_on_site_front;
             break;
         case 'tt_time_on_site_front':
             $this->tt_time_on_site_front = null;
             $diff = $this->tt_time_on_site;
             $days = floor($diff / (3600 * 24));
             $hours = floor(($diff - $days * 3600 * 24) / 3600);
             $minits = floor(($diff - $hours * 3600 - $days * 3600 * 24) / 60);
             $seconds = $diff - $hours * 3600 - $minits * 60 - $days * 3600 * 24;
             if ($days > 0) {
                 $this->tt_time_on_site_front = $days . ' d.';
             } elseif ($hours > 0) {
                 $this->tt_time_on_site_front = $hours . ' h.';
             } elseif ($minits > 0) {
                 $this->tt_time_on_site_front = $minits . ' m.';
             } elseif ($seconds >= 0) {
                 $this->tt_time_on_site_front = $seconds . ' s.';
             }
             return $this->tt_time_on_site_front;
             break;
         case 'last_visit_seconds_ago':
             $this->last_visit_seconds_ago = time() - $this->last_visit;
             return $this->last_visit_seconds_ago;
             break;
         case 'last_check_time_ago':
             $this->last_check_time_ago = time() - $this->last_check_time;
             return $this->last_check_time_ago;
             break;
         case 'visitor_tz_time':
             $this->visitor_tz_time = '-';
             if ($this->visitor_tz != '') {
                 $date = new DateTime(null, new DateTimeZone($this->visitor_tz));
                 $this->visitor_tz_time = $date->format(erLhcoreClassModule::$dateHourFormat);
//.........这里部分代码省略.........
开发者ID:sudogitguy,项目名称:livehelperchat,代码行数:101,代码来源:erlhcoreclassmodelchatonlineuser.php

示例15: __get

 public function __get($var)
 {
     switch ($var) {
         case 'survey':
             $this->survey = '';
             return $this->survey;
             break;
         case 'ftime_front':
             $this->ftime_front = date('Ymd') == date('Ymd', $this->ftime) ? date(erLhcoreClassModule::$dateHourFormat, $this->ftime) : date(erLhcoreClassModule::$dateDateHourFormat, $this->ftime);
             return $this->ftime_front;
             break;
         case 'user':
             try {
                 $this->user = erLhcoreClassModelUser::fetch($this->user_id, true);
             } catch (Exception $e) {
                 $this->user = false;
             }
             return $this->user;
             break;
         case 'is_filled':
             return !is_null($this->id);
             break;
         case 'department':
             $this->department = false;
             if ($this->dep_id > 0) {
                 try {
                     $this->department = erLhcoreClassModelDepartament::fetch($this->dep_id, true);
                 } catch (Exception $e) {
                 }
             }
             return $this->department;
             break;
         case 'department_name':
             return $this->department_name = (string) $this->department;
             break;
         case 'average_stars':
             return round($this->virtual_total_stars / $this->virtual_chats_number, 2);
             break;
         default:
             break;
     }
 }
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:42,代码来源:erlhabstractmodelsurveyitem.php


注:本文中的erLhcoreClassModelUser::fetch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。