本文整理汇总了PHP中erLhcoreClassModelChatConfig类的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassModelChatConfig类的具体用法?PHP erLhcoreClassModelChatConfig怎么用?PHP erLhcoreClassModelChatConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了erLhcoreClassModelChatConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setupSMTP
public static function setupSMTP(PHPMailer &$phpMailer)
{
// Allow extension override mail settings
$response = erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chatmail.setup_smtp', array('phpmailer' => &$phpMailer));
if ($response !== false && isset($response['status']) && $response['status'] == erLhcoreClassChatEventDispatcher::STOP_WORKFLOW) {
return;
}
$smtpData = erLhcoreClassModelChatConfig::fetch('smtp_data');
$data = (array) $smtpData->data;
if (isset($data['sender']) && $data['sender'] != '') {
$phpMailer->Sender = $data['sender'];
}
if ($phpMailer->From == 'root@localhost') {
$phpMailer->From = $data['default_from'];
}
if ($phpMailer->FromName == 'Root User') {
$phpMailer->FromName = $data['default_from_name'];
}
if (isset($data['use_smtp']) && $data['use_smtp'] == 1) {
$phpMailer->IsSMTP();
$phpMailer->Host = $data['host'];
$phpMailer->Port = $data['port'];
if ($data['username'] != '' && $data['password'] != '') {
$phpMailer->Username = $data['username'];
$phpMailer->Password = $data['password'];
$phpMailer->SMTPAuth = true;
$phpMailer->From = isset($data['default_from']) ? $data['default_from'] : $data['username'];
} else {
$phpMailer->From = '';
}
}
}
示例2: __get
public function __get($var)
{
switch ($var) {
case 'settings':
$this->settings = erLhcoreClassModelChatConfig::fetch('sugarcrm_data')->data;
return $this->settings;
break;
default:
break;
}
}
示例3: openChatWidget
/**
* Opening chat widget
* */
public static function openChatWidget($params)
{
try {
$chatPaid = erLhcoreClassModelChatPaid::fetch($params['pchat']);
$paidchatData = erLhcoreClassModelChatConfig::fetch('paidchat_data');
$data = (array) $paidchatData->data;
if ((!isset($data['paidchat_read_denied']) || $data['paidchat_read_denied'] == 0) && $chatPaid->chat_id == $params['chat']->id) {
$params['tpl']->set('paid_chat_params', array('allow_read' => true));
}
} catch (Exception $e) {
}
}
示例4: setupSMTP
public static function setupSMTP(PHPMailer &$phpMailer)
{
$smtpData = erLhcoreClassModelChatConfig::fetch('smtp_data');
$data = (array) $smtpData->data;
if (isset($data['use_smtp']) && $data['use_smtp'] == 1) {
$phpMailer->IsSMTP();
$phpMailer->Host = $data['host'];
$phpMailer->Port = $data['port'];
if ($data['username'] != '' && $data['password'] != '') {
$phpMailer->Username = $data['username'];
$phpMailer->Password = $data['password'];
$phpMailer->SMTPAuth = true;
}
}
}
示例5: getSpeechInstance
public static function getSpeechInstance(erLhcoreClassModelChat $chat)
{
$chatLanguageSession = null;
$chatSpeech = erLhcoreClassModelSpeechChatLanguage::getList(array('filter' => array('chat_id' => $chat->id)));
if (empty($chatSpeech)) {
$chatLanguageSession = new erLhcoreClassModelSpeechChatLanguage();
$chatLanguageSession->chat_id = $chat->id;
$speechUserLanguage = erLhcoreClassModelUserSetting::getSetting('speech_language', '');
$speechUserDialect = erLhcoreClassModelUserSetting::getSetting('speech_dialect', '');
if ($speechUserLanguage != '' && $speechUserDialect != '') {
$chatLanguageSession->dialect = $speechUserDialect;
$chatLanguageSession->language_id = $speechUserLanguage;
} else {
$speechData = erLhcoreClassModelChatConfig::fetch('speech_data');
$data = (array) $speechData->data;
$chatLanguageSession->language_id = $data['language'];
$chatLanguageSession->dialect = $data['dialect'];
}
} else {
$chatLanguageSession = array_pop($chatSpeech);
}
return $chatLanguageSession;
}
示例6: setupSMTP
public static function setupSMTP(PHPMailer &$phpMailer)
{
$smtpData = erLhcoreClassModelChatConfig::fetch('smtp_data');
$data = (array) $smtpData->data;
if (isset($data['use_smtp']) && $data['use_smtp'] == 1) {
$phpMailer->IsSMTP();
$phpMailer->Host = $data['host'];
$phpMailer->Port = $data['port'];
if ($data['username'] != '' && $data['password'] != '') {
$phpMailer->Username = $data['username'];
$phpMailer->Password = $data['password'];
$phpMailer->SMTPAuth = true;
}
}
if (isset($data['sender']) && $data['sender'] != '') {
$phpMailer->Sender = $data['sender'];
}
if ($phpMailer->From == 'root@localhost') {
$phpMailer->From = $data['default_from'];
}
if ($phpMailer->FromName == 'Root User') {
$phpMailer->FromName = $data['default_from_name'];
}
}
示例7: array
<?php
$currentUser = erLhcoreClassUser::instance();
$onlineTimeout = (int) erLhcoreClassModelChatConfig::fetchCache('sync_sound_settings')->data['online_timeout'];
$canListOnlineUsers = false;
$canListOnlineUsersAll = false;
if (erLhcoreClassModelChatConfig::fetchCache('list_online_operators')->current_value == 1) {
$canListOnlineUsers = $currentUser->hasAccessTo('lhuser', 'userlistonline');
$canListOnlineUsersAll = $currentUser->hasAccessTo('lhuser', 'userlistonlineall');
}
// We do not need a session anymore
session_write_close();
$ReturnMessages = array();
$pendingTabEnabled = erLhcoreClassModelUserSetting::getSetting('enable_pending_list', 1);
$activeTabEnabled = erLhcoreClassModelUserSetting::getSetting('enable_active_list', 1);
$closedTabEnabled = erLhcoreClassModelUserSetting::getSetting('enable_close_list', 0);
$unreadTabEnabled = erLhcoreClassModelUserSetting::getSetting('enable_unread_list', 1);
$showAllPending = erLhcoreClassModelUserSetting::getSetting('show_all_pending', 1);
$showDepartmentsStats = $currentUser->hasAccessTo('lhuser', 'canseedepartmentstats');
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'];
}
$filter['sort'] = 'pending_chats_counter DESC';
示例8: trim
<?php
$cfgSite = erConfigClassLhConfig::getInstance();
$secretHash = $cfgSite->getSetting('site', 'secrethash');
if ($Params['user_parameters']['validation_hash'] == sha1(sha1($Params['user_parameters']['email'] . $secretHash) . $secretHash)) {
$accept = erLhcoreClassModelChatAccept::fetchByHash($Params['user_parameters']['hash']);
if ($accept !== false) {
$chat_id = $accept->chat_id;
if ($accept->wused == 0) {
$userID = erLhcoreClassModelUser::fetchUserByEmail($Params['user_parameters']['email'], trim($Params['user_parameters']['email']) != '' ? trim($Params['user_parameters']['email']) : false);
if ($userID !== false && $accept->ctime > time() - erLhcoreClassModelChatConfig::fetch('accept_chat_link_timeout')->current_value) {
$accept->wused = 1;
$accept->saveThis();
erLhcoreClassUser::instance()->setLoggedUser($userID);
erLhcoreClassModule::redirect('chat/single', '/' . $chat_id);
exit;
} else {
erLhcoreClassModule::redirect('user/login', '/(r)/' . rawurlencode(base64_encode('chat/single/' . $chat_id)));
exit;
}
} else {
erLhcoreClassModule::redirect('user/login', '/(r)/' . rawurlencode(base64_encode('chat/single/' . $chat_id)));
exit;
}
erLhcoreClassModelChatAccept::cleanup();
}
}
erLhcoreClassModule::redirect('user/login');
exit;
示例9: isset
isset($dynamic_url_append) ? print $dynamic_url_append : '';
?>
" method="post" onsubmit="return lhinst.addCaptcha('<?php
echo time();
?>
',$(this))">
<h4><?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('faq/faqwidget', 'Type your question');
?>
</h4>
<div class="form-group">
<label><?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('faq/faqwidget', 'E-mail');
?>
:<?php
if (erLhcoreClassModelChatConfig::fetch('faq_email_required')->current_value == 1) {
?>
*<?php
}
?>
</label>
<input type="text" class="form-control" name="email" value="<?php
echo htmlspecialchars($item_new->email);
?>
" />
</div>
<div class="form-group">
<label><?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('faq/faqwidget', 'Question');
?>
示例10: json_encode
echo json_encode(array('third' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'User has not seen a message from the operator, or the message window is still open.'), 'msg_seen' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'Seen'), 'msg_not_seen' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'Unseen'), 'second' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'User has seen the message from the operator.'), 'first' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'User does not have any messages from the operator')), JSON_HEX_APOS);
?>
'>
<thead>
<tr>
<th width="5%" nowrap><a class="icon-clock" ng-click="online.predicate = 'last_visit'; online.reverse=!online.reverse" title="<?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'Last activity');
?>
" ></a><a class="icon-clock" ng-click="online.predicate = 'time_on_site'; online.reverse=!online.reverse" title="<?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'Time on site');
?>
"></a><a class="icon-clock" ng-click="online.predicate = 'visitor_tz_time'; online.reverse=!online.reverse" title="<?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'Visitor local time');
?>
"></a><?php
if (erLhcoreClassModelChatConfig::fetch('track_is_online')->current_value == 1) {
?>
<a class="icon-clock" ng-click="online.predicate = 'last_check_time'; online.reverse=!online.reverse" title="<?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'By user status on site');
?>
"></a><?php
}
?>
</th>
<th width="50%"><a href="" ng-click="online.predicate = 'current_page'; online.reverse=!online.reverse" /><?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'Page');
?>
</a></th>
<th width="30%"><a href="" ng-click="online.predicate = 'referrer'; online.reverse=!online.reverse" /><?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'Came from');
?>
示例11: isset
<?php
$is_root = !isset($_GET['nomenu']) || isset($_GET['nomenu']) && empty($_GET['nomenu']);
?>
<div class="row footer-row<?php
echo $is_root ? "" : " hidden";
?>
">
<div class="columns col-xs-12">
<p class="pull-right"><a target="_blank" href="http://livehelperchat.com">Live Helper Chat © <?php
echo date('Y');
?>
</a></p>
<p><a href="<?php
echo erLhcoreClassModelChatConfig::fetch('customer_site_url')->current_value;
?>
"><?php
echo htmlspecialchars(erLhcoreClassModelChatConfig::fetch('customer_company_name')->current_value);
?>
</a></p>
</div>
</div>
<?php
include_once erLhcoreClassDesign::designtpl('pagelayouts/parts/page_footer_js.tpl.php');
include_once erLhcoreClassDesign::designtpl('pagelayouts/parts/page_footer_js_extension_multiinclude.tpl.php');
示例12: array
<?php
$tpl = erLhcoreClassTemplate::getInstance('lhuser/autologinconfig.tpl.php');
$autologinData = erLhcoreClassModelChatConfig::fetch('autologin_data');
$data = (array) $autologinData->data;
if (isset($_POST['StoreAutologinSettings'])) {
$definition = array('secret_hash' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'enabled' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean'));
if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
erLhcoreClassModule::redirect('user/autologinconfig');
exit;
}
$Errors = array();
$form = new ezcInputForm(INPUT_POST, $definition);
$Errors = array();
try {
if ($form->hasValidData('secret_hash') && strlen($form->secret_hash) >= 10) {
$data['secret_hash'] = $form->secret_hash;
} else {
throw new Exception('Please enter secret hash');
}
if ($form->hasValidData('enabled') && $form->enabled == true) {
$data['enabled'] = 1;
} else {
$data['enabled'] = 0;
}
$autologinData->value = serialize($data);
$autologinData->saveThis();
$CacheManager = erConfigClassLhCacheConfig::getInstance();
$CacheManager->expireCache();
$tpl->set('updated', 'done');
} catch (Exception $e) {
示例13: header
if ($chat->hash == $Params['user_parameters']['hash'] && erLhcoreClassChat::canReopen($chat, true)) {
// Is IP blocked directly?
if (erLhcoreClassModelChatBlockedUser::getCount(array('filter' => array('ip' => erLhcoreClassIPDetect::getIP()))) > 0) {
header('Location: ' . $_SERVER['HTTP_REFERER']);
exit;
}
/**
* is IP range blocked
* */
$ignorable_ip = erLhcoreClassModelChatConfig::fetch('banned_ip_range')->current_value;
if ($ignorable_ip != '' && erLhcoreClassIPDetect::isIgnored(erLhcoreClassIPDetect::getIP(), explode(',', $ignorable_ip))) {
header('Location: ' . $_SERVER['HTTP_REFERER']);
exit;
}
if ($chat->status != erLhcoreClassModelChat::STATUS_ACTIVE_CHAT && $chat->status != erLhcoreClassModelChat::STATUS_PENDING_CHAT) {
if (erLhcoreClassModelChatConfig::fetch('reopen_as_new')->current_value == 1 || $chat->user_id == 0) {
// Reset to fresh state to workflow triggers to work
$chat->status = erLhcoreClassModelChat::STATUS_PENDING_CHAT;
$chat->nc_cb_executed = 0;
$chat->na_cb_executed = 0;
$chat->time = time();
// Set time to new
} else {
$chat->status = erLhcoreClassModelChat::STATUS_ACTIVE_CHAT;
}
$chat->updateThis();
}
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.user_reopened', array('chat' => &$chat));
if ($Params['user_parameters_unordered']['mode'] == 'widget') {
// Redirect user
erLhcoreClassModule::redirect('chat/chatwidgetchat', '/' . $chat->id . '/' . $chat->hash . $modeAppend . $modeAppendTheme);
示例14: onlineUserPageViewLogged
/**
* get's callend then online user does a pageview
*
* @param array $params
*/
public function onlineUserPageViewLogged($params)
{
if ($this->settings['enabled'] == true && $this->settings['online_visitors_tracking'] == true) {
$onlineOptions = erLhcoreClassModelChatConfig::fetch('xmppservice_options')->data;
if (isset($onlineOptions['track_online']) && $onlineOptions['track_online'] == true) {
if (($xmppAccount = erLhcoreClassModelXMPPAccount::findOne(array('filter' => array('type' => erLhcoreClassModelXMPPAccount::USER_TYPE_VISITOR, 'user_id' => $params['ou']->id)))) !== false) {
if ($this->settings['handler'] == 'rpc' && is_object($params['tpl']) && $this->settings['online_visitors_tracking'] == true) {
/**
* In the future then websockets will support attatch method this could be used
* */
/* $xmppAccount->attach_data = erLhcoreClassExtensionXmppserviceHandler::prebindSession(array(
'username' => $xmppAccount->username,
'password' => $xmppAccount->password,
'host' => $this->settings['prebind_host'] . $xmppAccount->username_plain,
)); */
$params['tpl']->set('xmppAccount', $xmppAccount);
}
// Forward this information to NodeJS server
erLhcoreClassExtensionXmppserviceHandler::onlineUserPageViewLogged(array('xmpp_account' => $xmppAccount, 'ou' => $params['ou'], 'host_login' => $this->settings['host_login'], 'node_api_server' => $this->settings['node_api_server'], 'handler' => $this->settings['handler'], 'xmpp_host' => $this->settings['xmpp_host'], 'rpc_server' => $this->settings['rpc_server'], 'rpc_username' => $this->settings['rpc_username'], 'rpc_password' => $this->settings['rpc_password'], 'rpc_account_host' => $this->settings['rpc_account_host']));
}
}
}
}
示例15: isset
$timeout = isset($Params['user_parameters_unordered']['timeout']) && is_numeric($Params['user_parameters_unordered']['timeout']) ? (int) $Params['user_parameters_unordered']['timeout'] : 30;
$maxrows = isset($Params['user_parameters_unordered']['maxrows']) && is_numeric($Params['user_parameters_unordered']['maxrows']) ? (int) $Params['user_parameters_unordered']['maxrows'] : 50;
$filter = array('offset' => 0, 'limit' => $maxrows, 'sort' => 'last_visit DESC', 'filtergt' => array('last_visit' => time() - $timeout));
$department = isset($Params['user_parameters_unordered']['department']) && is_numeric($Params['user_parameters_unordered']['department']) ? (int) $Params['user_parameters_unordered']['department'] : false;
if ($department !== false) {
$filter['filter']['dep_id'] = $department;
}
/**
* Append user departments filter
* */
$departmentParams = array();
$userDepartments = erLhcoreClassUserDep::parseUserDepartmetnsForFilter($currentUser->getUserID());
if ($userDepartments !== true) {
$departmentParams['filterin']['id'] = $userDepartments;
if (!$currentUser->hasAccessTo('lhchat', 'sees_all_online_visitors')) {
$filter['filterin']['dep_id'] = $userDepartments;
}
}
if ($is_ajax == true) {
$items = erLhcoreClassModelChatOnlineUser::getList($filter);
erLhcoreClassChat::prefillGetAttributes($items, array('online_attr_system_array', 'notes_intro', 'last_check_time_ago', 'visitor_tz_time', 'last_visit_seconds_ago', 'lastactivity_ago', 'time_on_site_front', 'can_view_chat', 'operator_user_send', 'operator_user_string', 'first_visit_front', 'last_visit_front'), array('notes', 'online_attr_system'), array('do_not_clean' => true));
echo json_encode(array_values($items));
exit;
}
$tpl->set('departmentParams', $departmentParams);
$tpl->set('tracking_enabled', erLhcoreClassModelChatConfig::fetch('track_online_visitors')->current_value == 1);
$tpl->set('geo_location_data', erLhcoreClassModelChatConfig::fetch('geo_location_data')->data);
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'Online visitors')));
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.onlineusers_path', array('result' => &$Result));
$Result['additional_footer_js'] = '<script src="' . erLhcoreClassDesign::designJS('js/angular.lhc.online.min.js') . '"></script>';