本文整理汇总了PHP中erLhcoreClassUser类的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassUser类的具体用法?PHP erLhcoreClassUser怎么用?PHP erLhcoreClassUser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了erLhcoreClassUser类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __get
public function __get($var)
{
switch ($var) {
case 'left_menu':
$this->left_menu = '';
return $this->left_menu;
break;
case 'content_rendered':
return erLhcoreClassFormRenderer::renderForm($this);
break;
case 'xls_columns_data':
$parts = explode('||', $this->xls_columns);
$totalParts = array();
foreach ($parts as $part) {
$subParts = explode(';', $part);
$dataParts = array();
foreach ($subParts as $subPart) {
$data = explode('=', $subPart);
$dataParts[$data[0]] = $data[1];
}
$totalParts[] = $dataParts;
}
return $this->xls_columns_data = $totalParts;
break;
case 'hide_delete':
return $this->hide_delete = !erLhcoreClassUser::instance()->hasAccessTo('lhform', 'delete_fm');
break;
default:
break;
}
}
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:31,代码来源:erlhabstractmodelform.php
示例2: getList
public static function getList($paramsSearch = array())
{
$paramsDefault = array('limit' => 32, 'offset' => 0);
$params = array_merge($paramsDefault, $paramsSearch);
$session = erLhcoreClassUser::getSession();
$q = $session->createFindQuery('erLhcoreClassModelUserSetting');
$conditions = array();
if (isset($params['filter']) && count($params['filter']) > 0) {
foreach ($params['filter'] as $field => $fieldValue) {
$conditions[] = $q->expr->eq($field, $q->bindValue($fieldValue));
}
}
if (isset($params['filterin']) && count($params['filterin']) > 0) {
foreach ($params['filterin'] as $field => $fieldValue) {
$conditions[] = $q->expr->in($field, $fieldValue);
}
}
if (isset($params['filterlt']) && count($params['filterlt']) > 0) {
foreach ($params['filterlt'] as $field => $fieldValue) {
$conditions[] = $q->expr->lt($field, $q->bindValue($fieldValue));
}
}
if (isset($params['filtergt']) && count($params['filtergt']) > 0) {
foreach ($params['filtergt'] as $field => $fieldValue) {
$conditions[] = $q->expr->gt($field, $q->bindValue($fieldValue));
}
}
if (count($conditions) > 0) {
$q->where($conditions);
}
$q->limit($params['limit'], $params['offset']);
$q->orderBy(isset($params['sort']) ? $params['sort'] : 'identifier DESC');
$objects = $session->find($q, 'erLhcoreClassModelUserSettingOption');
return $objects;
}
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:35,代码来源:erlhcoreclassmodelusersettingoption.php
示例3: getTransferChats
public static function getTransferChats($params = array())
{
$db = ezcDbInstance::get();
$currentUser = erLhcoreClassUser::instance();
$limitationSQL = '';
if (isset($params['department_transfers']) && $params['department_transfers'] == true) {
$limitation = self::getDepartmentLimitation();
// Does not have any assigned department
if ($limitation === false) {
return array();
}
if ($limitation !== true) {
$limitationSQL = ' AND ' . $limitation;
}
$stmt = $db->prepare('SELECT lh_chat.*,lh_transfer.id as transfer_id FROM lh_chat INNER JOIN lh_transfer ON lh_transfer.chat_id = lh_chat.id WHERE transfer_user_id != :transfer_user_id ' . $limitationSQL . ' ORDER BY lh_transfer.id DESC');
$stmt->bindValue(':transfer_user_id', $currentUser->getUserID());
$stmt->setFetchMode(PDO::FETCH_ASSOC);
$stmt->execute();
$rows = $stmt->fetchAll();
} else {
$stmt = $db->prepare('SELECT lh_chat.*,lh_transfer.id as transfer_id FROM lh_chat INNER JOIN lh_transfer ON lh_transfer.chat_id = lh_chat.id WHERE lh_transfer.transfer_to_user_id = :user_id ORDER BY lh_transfer.id DESC');
$stmt->bindValue(':user_id', $currentUser->getUserID());
$stmt->setFetchMode(PDO::FETCH_ASSOC);
$stmt->execute();
$rows = $stmt->fetchAll();
}
return $rows;
}
开发者ID:detain,项目名称:livehelperchat,代码行数:28,代码来源:lhtransfer.php
示例4: validateAdminTheme
public static function validateAdminTheme(erLhAbstractModelAdminTheme &$clickform)
{
$definition = array('Name' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'header_content' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'header_css' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'static_content_name' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY), 'static_content_hash' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY), 'static_js_content_name' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY), 'static_js_content_hash' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY), 'static_css_content_name' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY), 'static_css_content_hash' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY));
$form = new ezcInputForm(INPUT_POST, $definition);
$Errors = array();
$currentUser = erLhcoreClassUser::instance();
if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
$Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('icclicktocallform/form', 'Invalid CSRF token!');
}
if (!$form->hasValidData('Name') || $form->Name == '') {
$Errors['Name'] = erTranslationClassLhTranslation::getInstance()->getTranslation('icclicktocallform/form', 'Please enter a name');
} else {
$clickform->name = $form->Name;
}
if ($form->hasValidData('header_content')) {
$clickform->header_content = $form->header_content;
}
if ($form->hasValidData('header_css')) {
$clickform->header_css = $form->header_css;
}
$resourcesArray = array('static_content', 'static_js_content', 'static_css_content');
$supportedExtensions = array('zip', 'doc', 'docx', 'ttf', 'pdf', 'xls', 'ico', 'gif', 'xlsx', 'jpg', 'jpeg', 'png', 'bmp', 'rar', '7z', 'css', 'js', 'eot', 'woff', 'woff2', 'svg');
// Validate resources
foreach ($resourcesArray as $resource) {
if ($form->hasValidData($resource . '_hash') && !empty($form->{$resource . '_hash'})) {
$customFields = $currentStaticResources = $clickform->{$resource . '_array'};
foreach ($form->{$resource . '_hash'} as $key => $customFieldType) {
if (!erLhcoreClassSearchHandler::isFile($resource . '_file_' . $key, $supportedExtensions) && !isset($currentStaticResources[$key]['file'])) {
$Errors[$resource . '_file_' . $key] = erTranslationClassLhTranslation::getInstance()->getTranslation('icclicktocallform/form', 'File not chosen for') . (isset($form->{$resource . '_name'}[$key]) ? ' - ' . htmlspecialchars($form->{$resource . '_name'}[$key]) : '');
}
}
// If there is no errors upload files
if (empty($Errors)) {
foreach ($form->{$resource . '_hash'} as $key => $customFieldType) {
$customFields[$key]['name'] = $form->{$resource . '_name'}[$key];
$customFields[$key]['hash'] = $key;
if (erLhcoreClassSearchHandler::isFile($resource . '_file_' . $key, $supportedExtensions)) {
// Check there is already uploaded file and remove it
$clickform->removeResource($resource, $key);
// Store new file if required
$dir = 'var/storageadmintheme/' . date('Y') . 'y/' . date('m') . '/' . date('d') . '/' . $clickform->id . '/';
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('admintheme.filedir', array('dir' => &$dir, 'storage_id' => $clickform->id));
erLhcoreClassFileUpload::mkdirRecursive($dir);
$customFields[$key]['file'] = erLhcoreClassSearchHandler::moveUploadedFile($resource . '_file_' . $key, $dir . '/', '.');
$customFields[$key]['file_dir'] = $dir;
}
}
$clickform->{$resource} = json_encode($customFields, JSON_HEX_APOS);
}
} else {
$clickform->{$resource} = '';
}
}
return $Errors;
}
开发者ID:detain,项目名称:livehelperchat,代码行数:55,代码来源:lhthemevalidator.php
示例5: deleteGroup
public static function deleteGroup($group_id)
{
$Group = erLhcoreClassUser::getSession()->load('erLhcoreClassModelGroup', $group_id);
erLhcoreClassUser::getSession()->delete($Group);
$q = ezcDbInstance::get()->createDeleteQuery();
// Transfered chats to user
$q->deleteFrom('lh_groupuser')->where($q->expr->eq('group_id', $group_id));
$stmt = $q->prepare();
$stmt->execute();
// Transfered chats to user
$q->deleteFrom('lh_grouprole')->where($q->expr->eq('group_id', $group_id));
$stmt = $q->prepare();
$stmt->execute();
}
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:14,代码来源:lhgroup.php
示例6: prepareSendMail
public static function prepareSendMail(erLhAbstractModelEmailTemplate &$sendMail)
{
$currentUser = erLhcoreClassUser::instance();
if ($currentUser->isLogged() == true) {
$userData = $currentUser->getUserData();
$sendMail->subject = str_replace(array('{name_surname}'), array($userData->name . ' ' . $userData->surname), $sendMail->subject);
$sendMail->from_name = str_replace(array('{name_surname}'), array($userData->name . ' ' . $userData->surname), $sendMail->from_name);
if (empty($sendMail->from_email)) {
$sendMail->from_email = $userData->email;
}
if (empty($sendMail->reply_to)) {
$sendMail->reply_to = $userData->email;
}
}
}
开发者ID:sirromas,项目名称:medical,代码行数:15,代码来源:lhchatmail.php
示例7: getCount
public static function getCount($params = array())
{
$session = erLhcoreClassUser::getSession('slave');
$q = $session->database->createSelectQuery();
$q->select("COUNT(id)")->from("lh_group");
if (isset($params['filter']) && count($params['filter']) > 0) {
$conditions = array();
foreach ($params['filter'] as $field => $fieldValue) {
$conditions[] = $q->expr->eq($field, $q->bindValue($fieldValue));
}
$q->where($conditions);
}
$stmt = $q->prepare();
$stmt->execute();
$result = $stmt->fetchColumn();
return $result;
}
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:17,代码来源:erlhcoreclassmodelgroup.php
示例8: addUserDepartaments
public static function addUserDepartaments($Departaments, $userID = false, $UserData = false)
{
$db = ezcDbInstance::get();
if ($userID === false) {
$currentUser = erLhcoreClassUser::instance();
$userID = $currentUser->getUserID();
}
$stmt = $db->prepare('DELETE FROM lh_userdep WHERE user_id = :user_id AND type = 0');
$stmt->bindValue(':user_id', $userID);
$stmt->execute();
foreach ($Departaments as $DepartamentID) {
$stmt = $db->prepare('INSERT INTO lh_userdep (user_id,dep_id,hide_online,last_activity,last_accepted,active_chats,type,dep_group_id) VALUES (:user_id,:dep_id,:hide_online,0,0,:active_chats,0,0)');
$stmt->bindValue(':user_id', $userID);
$stmt->bindValue(':dep_id', $DepartamentID);
$stmt->bindValue(':hide_online', $UserData->hide_online);
$stmt->bindValue(':active_chats', erLhcoreClassChat::getCount(array('filter' => array('user_id' => $UserData->id, 'status' => erLhcoreClassModelChat::STATUS_ACTIVE_CHAT))));
$stmt->execute();
}
if (isset($_SESSION['lhCacheUserDepartaments_' . $userID])) {
unset($_SESSION['lhCacheUserDepartaments_' . $userID]);
}
}
开发者ID:remdex,项目名称:livehelperchat,代码行数:22,代码来源:lhuserdep.php
示例9: loginBySSO
public static function loginBySSO($params)
{
$settings = (include 'extension/singlesignon/settings/settings.ini.php');
// Try to find operator by our logins
if (isset($params[$settings['attr_map']['username']][0])) {
$username = $params[$settings['attr_map']['username']][0];
if (erLhcoreClassModelUser::userExists($username)) {
$user = array_shift(erLhcoreClassModelUser::getUserList(array('limit' => 1, 'filter' => array('username'))));
erLhcoreClassUser::instance()->setLoggedUser($user->id);
} else {
$user = new erLhcoreClassModelUser();
foreach ($settings['attr_map'] as $attr => $ssoAttr) {
$user->{$attr} = $params[$settings['attr_map'][$attr]][0];
}
foreach ($settings['default_attributes'] as $attr => $value) {
$user->{$attr} = $value;
}
$user->password = sha1(erLhcoreClassModelForgotPassword::randomPassword() . rand(0, 1000) . microtime());
$user->saveThis();
// Set that users sees all pending chats
erLhcoreClassModelUserSetting::setSetting('show_all_pending', 1, $user->id);
// Set default departments
erLhcoreClassUserDep::addUserDepartaments($settings['default_departments'], $user->id, $user);
// Cleanup if previously existed
erLhcoreClassModelGroupUser::removeUserFromGroups($user->id);
// Assign user to default group
foreach ($settings['default_user_groups'] as $group_id) {
$groupUser = new erLhcoreClassModelGroupUser();
$groupUser->group_id = $group_id;
$groupUser->user_id = $user->id;
$groupUser->saveThis();
}
erLhcoreClassUser::instance()->setLoggedUser($user->id);
}
return true;
} else {
throw new Exception('Username field not found');
}
}
开发者ID:creativeprogramming,项目名称:livehelperchat-extensions,代码行数:39,代码来源:lhsinglesingon.php
示例10: echo
echo (int) ($soundData['chat_message_sinterval'] * 1000);
?>
;confLH.new_chat_sound_enabled = <?php
echo (int) erLhcoreClassModelUserSetting::getSetting('new_chat_sound', (int) $soundData['new_chat_sound_enabled']);
?>
;confLH.new_message_sound_admin_enabled = <?php
echo (int) erLhcoreClassModelUserSetting::getSetting('chat_message', (int) $soundData['new_message_sound_admin_enabled']);
?>
;confLH.new_message_sound_user_enabled = <?php
echo (int) erLhcoreClassModelUserSetting::getSetting('chat_message', (int) $soundData['new_message_sound_user_enabled']);
?>
;confLH.new_message_browser_notification = <?php
echo isset($soundData['browser_notification_message']) ? (int) $soundData['browser_notification_message'] : 0;
?>
;confLH.transLation = {'new_chat':'New chat request'};confLH.csrf_token = '<?php
echo erLhcoreClassUser::instance()->getCSFRToken();
?>
';confLH.repeat_sound = <?php
echo (int) $soundData['repeat_sound'];
?>
;confLH.repeat_sound_delay = <?php
echo (int) $soundData['repeat_sound_delay'];
?>
;confLH.show_alert = <?php
echo (int) $soundData['show_alert'];
?>
;</script><script type="text/javascript" src="/north-american-nemesis-new/chattool/cache/compiledtemplates/4079b29f9b336083f1a058bab4e0ccbb.js"></script><?php
echo isset($Result['additional_header_js']) ? $Result['additional_header_js'] : '';
?>
</head><body><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><span><a href="/north-american-nemesis-new/chattool/index.php/site_admin/" title="Home"><img src="/north-american-nemesis-new/chattool/design/defaulttheme/images/general/logo.png" alt="demox user chat" title="demox user chat"></a></span></div><div class="modal-body"><?php
echo $Result['content'];
开发者ID:niravpatel2008,项目名称:north-american-nemesis-new,代码行数:31,代码来源:500733b9b91c99814e3e4d967c2043b3.php
示例11:
<?php
include erLhcoreClassDesign::designtpl('lhchat/chat_tabs/chat_translation_pre.tpl.php');
if ($chat_translation_enabled == true && erLhcoreClassUser::instance()->hasAccessTo('lhtranslation', 'use')) {
?>
<?php
// This values comes from tab template
if ($dataChatTranslation['enable_translations'] && $dataChatTranslation['enable_translations'] == true) {
?>
<div role="tabpanel" class="tab-pane" id="main-user-info-translation-<?php
echo $chat->id;
?>
">
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<label><?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/translation', 'Visitor language');
?>
</label>
<?php
echo erLhcoreClassRenderHelper::renderCombobox(array('input_name' => 'chat_locale_' . $chat->id, 'optional_field' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/translation', 'Automatically detected'), 'selected_id' => $chat->chat_locale, 'css_class' => 'form-control', 'list_function' => 'erLhcoreClassTranslate::getSupportedLanguages'));
?>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<label><?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/translation', 'My language');
?>
开发者ID:p4prawin,项目名称:livechat,代码行数:31,代码来源:chat_translation.tpl.php
示例12: htmlspecialchars
<?php
$currentUser = erLhcoreClassUser::instance();
$UserData = $currentUser->getUserData(true);
?>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><?php
echo htmlspecialchars($UserData->name), ' ', htmlspecialchars($UserData->surname);
?>
<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="<?php
echo erLhcoreClassDesign::baseurl('user/account');
?>
" title="<?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout', 'Account');
?>
"><i class="glyphicon glyphicon-user"></i> <?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout', 'Account');
?>
</a></li>
<li><a href="<?php
echo erLhcoreClassDesign::baseurl('user/logout');
?>
" title="<?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout', 'Logout');
?>
"><i class="glyphicon glyphicon-log-out"></i> <?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('pagelayout/pagelayout', 'Logout');
?>
</a></li>
开发者ID:Joeboyc2,项目名称:livehelperchat,代码行数:31,代码来源:user_box.tpl.php
示例13:
<h1><?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('form/index', 'Form');
?>
</h1>
<ul class="circle small-list">
<li><a href="<?php
echo erLhcoreClassDesign::baseurl('abstract/list');
?>
/Form"><?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('form/index', 'List of forms');
?>
</a></li>
<?php
if (erLhcoreClassUser::instance()->hasAccessTo('lhform', 'generate_js')) {
?>
<li><a href="<?php
echo erLhcoreClassDesign::baseurl('form/embedcode');
?>
"><?php
echo erTranslationClassLhTranslation::getInstance()->getTranslation('form/index', 'Page embed code');
?>
</a></li>
<?php
}
?>
</ul>
开发者ID:sudogitguy,项目名称:livehelperchat,代码行数:27,代码来源:index.tpl.php
示例14: elseif
?>
<?php
} elseif ($tabItem == 'operator_remarks_tab') {
?>
<?php
include erLhcoreClassDesign::designtpl('lhchat/chat_tabs/operator_remarks_tab.tpl.php');
?>
<?php
} elseif ($tabItem == 'information_tab_user_files_tab') {
?>
<?php
$fileData = (array) erLhcoreClassModelChatConfig::fetch('file_configuration')->data;
?>
<?php
if (isset($fileData['active_admin_upload']) && $fileData['active_admin_upload'] == true && erLhcoreClassUser::instance()->hasAccessTo('lhfile', 'use_operator')) {
?>
<?php
include erLhcoreClassDesign::designtpl('lhchat/chat_tabs/information_tab_user_files_tab.tpl.php');
?>
<?php
}
?>
<?php
} elseif ($tabItem == 'operator_screenshot_tab') {
?>
<?php
include erLhcoreClassDesign::designtpl('lhchat/chat_tabs/operator_screenshot_tab.tpl.php');
?>
<?php
开发者ID:mdb-webdev,项目名称:livehelperchat,代码行数:31,代码来源:chat_tabs_container.tpl.php
示例15: VALUES
$db->query("INSERT INTO `lh_userdep` (`user_id`,`dep_id`,`last_activity`,`hide_online`,`last_accepted`,`active_chats`) VALUES ({$UserData->id},0,0,0,0,0)");
// Transfer chat
$db->query("CREATE TABLE IF NOT EXISTS `lh_transfer` (\n\t\t\t\t `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\t `chat_id` int(11) NOT NULL,\n\t\t\t\t `dep_id` int(11) NOT NULL,\n\t\t\t\t `transfer_user_id` int(11) NOT NULL,\n\t\t\t\t `from_dep_id` int(11) NOT NULL,\n\t\t\t\t `transfer_to_user_id` int(11) NOT NULL,\n\t\t\t\t PRIMARY KEY (`id`),\n\t\t\t\t KEY `dep_id` (`dep_id`),\n\t\t\t\t KEY `transfer_user_id_dep_id` (`transfer_user_id`,`dep_id`),\n\t\t\t\t KEY `transfer_to_user_id` (`transfer_to_user_id`)\n\t\t\t\t) DEFAULT CHARSET=utf8;");
// Remember user table
$db->query("CREATE TABLE IF NOT EXISTS `lh_users_remember` (\n\t\t\t\t `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\t `user_id` int(11) NOT NULL,\n\t\t\t\t `mtime` int(11) NOT NULL,\n\t\t\t\t PRIMARY KEY (`id`)\n\t\t\t\t) DEFAULT CHARSET=utf8;");
// Chat messages
$db->query("CREATE TABLE IF NOT EXISTS `lh_msg` (\n\t\t\t\t `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\t `msg` text NOT NULL,\n\t\t\t\t `time` int(11) NOT NULL,\n\t\t\t\t `chat_id` int(11) NOT NULL DEFAULT '0',\n\t\t\t\t `user_id` int(11) NOT NULL DEFAULT '0',\n\t\t\t\t `name_support` varchar(100) NOT NULL,\n\t\t\t\t PRIMARY KEY (`id`),\n\t\t\t\t KEY `chat_id_id` (`chat_id`, `id`)\n\t\t\t\t) DEFAULT CHARSET=utf8;");
// Forgot password table
$db->query("CREATE TABLE IF NOT EXISTS `lh_forgotpasswordhash` (\n `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,\n `user_id` INT NOT NULL ,\n `hash` VARCHAR( 40 ) NOT NULL ,\n `created` INT NOT NULL\n ) DEFAULT CHARSET=utf8;");
// User groups table
$db->query("CREATE TABLE IF NOT EXISTS `lh_groupuser` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `group_id` int(11) NOT NULL,\n `user_id` int(11) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `group_id` (`group_id`),\n KEY `user_id` (`user_id`),\n KEY `group_id_2` (`group_id`,`user_id`)\n ) DEFAULT CHARSET=utf8;");
// Assign admin user to admin group
$GroupUser = new erLhcoreClassModelGroupUser();
$GroupUser->group_id = $GroupData->id;
$GroupUser->user_id = $UserData->id;
erLhcoreClassUser::getSession()->save($GroupUser);
//Assign default role functions
$db->query("CREATE TABLE IF NOT EXISTS `lh_rolefunction` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `role_id` int(11) NOT NULL,\n `module` varchar(100) NOT NULL,\n `function` varchar(100) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `role_id` (`role_id`)\n ) DEFAULT CHARSET=utf8;");
// Admin role and function
$RoleFunction = new erLhcoreClassModelRoleFunction();
$RoleFunction->role_id = $Role->id;
$RoleFunction->module = '*';
$RoleFunction->function = '*';
erLhcoreClassRole::getSession()->save($RoleFunction);
// Operators rules and functions
$permissionsArray = array(array('module' => 'lhuser', 'function' => 'selfedit'), array('module' => 'lhuser', 'function' => 'changeonlinestatus'), array('module' => 'lhuser', 'function' => 'changeskypenick'), array('module' => 'lhuser', 'function' => 'personalcannedmsg'), array('module' => 'lhuser', 'function' => 'change_visibility_list'), array('module' => 'lhuser', 'function' => 'see_assigned_departments'), array('module' => 'lhchat', 'function' => 'use'), array('module' => 'lhchat', 'function' => 'chattabschrome'), array('module' => 'lhchat', 'function' => 'singlechatwindow'), array('module' => 'lhchat', 'function' => 'allowopenremotechat'), array('module' => 'lhchat', 'function' => 'allowchattabs'), array('module' => 'lhchat', 'function' => 'use_onlineusers'), array('module' => 'lhchat', 'function' => 'take_screenshot'), array('module' => 'lhfront', 'function' => 'use'), array('module' => 'lhsystem', 'function' => 'use'), array('module' => 'lhtranslation', 'function' => 'use'), array('module' => 'lhchat', 'function' => 'allowblockusers'), array('module' => 'lhsystem', 'function' => 'generatejs'), array('module' => 'lhsystem', 'function' => 'changelanguage'), array('module' => 'lhchat', 'function' => 'allowredirect'), array('module' => 'lhchat', 'function' => 'allowtransfer'), array('module' => 'lhchat', 'function' => 'administratecannedmsg'), array('module' => 'lhchat', 'function' => 'sees_all_online_visitors'), array('module' => 'lhpermission', 'function' => 'see_permissions'), array('module' => 'lhquestionary', 'function' => 'manage_questionary'), array('module' => 'lhfaq', 'function' => 'manage_faq'), array('module' => 'lhchatbox', 'function' => 'manage_chatbox'), array('module' => 'lhbrowseoffer', 'function' => 'manage_bo'), array('module' => 'lhxml', 'function' => '*'), array('module' => 'lhcobrowse', 'function' => 'browse'), array('module' => 'lhfile', 'function' => 'use_operator'), array('module' => 'lhfile', 'function' => 'file_delete_chat'), array('module' => 'lhspeech', 'function' => 'changedefaultlanguage'), array('module' => 'lhspeech', 'function' => 'use'), array('module' => 'lhspeech', 'function' => 'change_chat_recognition'));
foreach ($permissionsArray as $paramsPermission) {
$RoleFunctionOperator = new erLhcoreClassModelRoleFunction();
$RoleFunctionOperator->role_id = $RoleOperators->id;
$RoleFunctionOperator->module = $paramsPermission['module'];
$RoleFunctionOperator->function = $paramsPermission['function'];
开发者ID:p4prawin,项目名称:livechat,代码行数:31,代码来源:install.php
示例16: chats
$closedTabEnabled = (int) erLhcoreClassModelUserSetting::getSetting('enable_close_list', 0);
$unreadTabEnabled = (int) erLhcoreClassModelUserSetting::getSetting('enable_unread_list', 1);
?>
<div class="columns col-sm-4 col-md-3" id="right-column-page" ng-cloak><?php
$transfer_panel_container_pre_enabled = erLhcoreClassUser::instance()->hasAccessTo('lhchat', 'use');
if ($transfer_panel_container_pre_enabled == true) {
?>
<div role="tabpanel" ng-show="transfer_dep_chats.list.length > 0 || transfer_chats.list.length > 0"><!-- Nav tabs -->
<ul class="nav nav-pills" role="tablist"><li role="presentation" class="active"><a title="Chats transferred to you directly" href="#transferedperson" aria-controls="transferedperson" role="tab" data-toggle="tab"><i class="icon-user"></i><span class="tru-cnt"></span></a></li><li role="presentation"><a title="Transferred to your department" href="#transfereddep" aria-controls="transfereddep" role="tab" data-toggle="tab"><i class="icon-users"></i><span class="trd-cnt"></span></a></li></ul><!-- Tab panes -->
<div class="tab-content"><div role="tabpanel" class="tab-pane active" id="transferedperson"><div id="right-transfer-chats"><ul class="no-bullet small-list"><li ng-repeat="chat in transfer_chats.list"><img class="action-image right-action-hide" align="absmiddle" ng-click="lhc.startChatTransfer(chat.id,chat.nick,chat.transfer_id)" src="/design/defaulttheme/images/icons/accept.png" alt="Accept chat" title="Accept chat"><img class="action-image" align="absmiddle" ng-click="lhc.startChatNewWindowTransfer(chat.id,chat.nick,chat.transfer_id)" src="/design/defaulttheme/images/icons/application_add.png" alt="Open in a new window" title="Open in a new window"> {{chat.id}}. {{chat.nick}} ({{chat.time_front}})</li></ul><p ng-show="transfer_chats.list.length == 0">Empty...</p></div></div><div role="tabpanel" class="tab-pane" id="transfereddep"><div id="right-transfer-departments"><ul class="no-bullet small-list"><li ng-repeat="chat in transfer_dep_chats.list"><img class="action-image right-action-hide" align="absmiddle" ng-click="lhc.startChatTransfer(chat.id,chat.nick,chat.transfer_id)" src="/design/defaulttheme/images/icons/accept.png" alt="Accept chat" title="Accept chat"><img class="action-image" align="absmiddle" ng-click="lhc.startChatNewWindowTransfer(chat.id,chat.nick,chat.transfer_id)" src="/design/defaulttheme/images/icons/application_add.png" alt="Open in a new window" title="Open in a new window"> {{chat.id}}. {{chat.nick}} ({{chat.time_front}})</li></ul><p ng-show="transfer_dep_chats.list.length == 0">Empty...</p></div></div></div></div><?php
}
?>
<div class="panel panel-default panel-lhc" ng-show="pending_chats.list.length > 0 || active_chats.list.length > 0 || unread_chats.list.length > 0 || closed_chats.list.length > 0<?php
?>
"><?php
$basicChatEnabled = erLhcoreClassUser::instance()->hasAccessTo('lhchat', 'use');
if ($basicChatEnabled == true) {
if ($pendingTabEnabled == true) {
?>
<div class="panel-heading" ng-if="pending_chats.list.length > 0"><a href="/index.php/chat/pendingchats"><i class="icon-chat chat-pending"></i> Pending chats ({{pending_chats.list.length}}{{pending_chats.list.length == 10 ? '+' : ''}})</a><a title="collapse/expand" ng-click="lhc.toggleList('pending_chats_expanded')" ng-class="pending_chats_expanded == true ? 'icon-minus' : 'icon-plus'" class="fs18 pull-right"></a></div><div class="panel-body" id="right-pending-chats" ng-if="pending_chats.list.length > 0 && pending_chats_expanded == true"><ul class="list-unstyled"><li ng-repeat="chat in pending_chats.list track by chat.id"><span ng-if="chat.country_code != undefined"><img ng-src="/design/defaulttheme/images/flags/{{chat.country_code}}.png" alt="{{chat.country_name}}" title="{{chat.country_name}}" /></span><i class="icon-user icon-user-assigned" ng-show="chat.user_name" title="Assigned operator - {{chat.user_name}}"></i><a class="icon-info" title="ID - {{chat.id}}" ng-click="lhc.previewChat(chat.id)"></a><a class="icon-reply" title="Redirect user to contact form." ng-click="lhc.redirectContact(chat.id,'Are you sure?')" ></a><a class="right-action-hide icon-chat" ng-click="lhc.startChat(chat.id,chat.nick)" title="Accept chat"></a><a title="Open in a new window" class="icon-popup" ng-click="lhc.startChatNewWindow(chat.id,chat.nick)"></a>{{chat.nick}}, <small><i>{{chat.wait_time_pending}},</i></small> {{chat.department_name}}</li></ul><p ng-show="pending_chats.list.length == 0">Empty...</p></div><?php
}
}
if ($basicChatEnabled == true) {
if ($activeTabEnabled == true) {
?>
<div class="panel-heading" ng-if="active_chats.list.length > 0"><a href="/index.php/chat/activechats"><i class="icon-chat chat-active"></i> Active chats({{active_chats.list.length}}{{active_chats.list.length == 10 ? '+' : ''}})</a><a title="collapse/expand" ng-click="lhc.toggleList('active_chats_expanded')" ng-class="active_chats_expanded == true ? 'icon-minus' : 'icon-plus'" class="fs18 pull-right"></a></div><div class="panel-body" id="right-active-chats" ng-show="active_chats.list.length > 0 && active_chats_expanded == true"><ul class="list-unstyled"><li ng-repeat="chat in active_chats.list track by chat.id" ><span ng-if="chat.country_code != undefined"><img ng-src="/design/defaulttheme/images/flags/{{chat.country_code}}.png" alt="{{chat.country_name}}" title="{{chat.country_name}}" /></span><a class="icon-info" title="ID - {{chat.id}}, {{chat.user_name}}" ng-click="lhc.previewChat(chat.id)" ></a><a class="right-action-hide icon-chat" ng-click="lhc.startChat(chat.id,chat.nick)" title="Add chat"></a><a class="icon-popup" ng-click="lhc.startChatNewWindow(chat.id,chat.nick)" title="Open in a new window"></a> {{chat.nick}}, <small><i>{{chat.time_created_front}},</i></small> {{chat.department_name}}</li></ul><p ng-show="active_chats.list.length == 0">Empty...</p></div><?php
}
if ($unreadTabEnabled == true) {
?>
<div class="panel-heading" ng-if="unread_chats.list.length > 0"><a href="/index.php/chat/unreadchats"><i class="icon-comment chat-unread"></i> Unread messages ({{unread_chats.list.length}}{{unread_chats.list.length == 10 ? '+' : ''}})</a><a title="collapse/expand" ng-click="lhc.toggleList('unread_chats_expanded')" ng-class="unread_chats_expanded == true ? 'icon-minus' : 'icon-plus'" class="fs18 pull-right"></a></div><div class="panel-body" ng-if="unread_chats.list.length > 0 && unread_chats_expanded == true" id="right-unread-chats"><ul class="list-unstyled"><li ng-repeat="chat in unread_chats.list track by chat.id" ><span ng-if="chat.country_code != undefined"><img ng-src="/design/defaulttheme/images/flags/{{chat.country_code}}.png" alt="{{chat.country_name}}" title="{{chat.country_name}}" /></span><a class="icon-info" title="ID - {{chat.id}}" ng-click="lhc.previewChat(chat.id)" ></a><a class="right-action-hide icon-chat" ng-click="lhc.startChat(chat.id,chat.nick)" title="Add chat"></a><a class="icon-popup" ng-click="lhc.startChatNewWindow(chat.id,chat.nick)" title="Open in a new window"></a> {{chat.nick}}, {{chat.time_created_front}}, {{chat.department_name}} | <b>{{chat.unread_time.hours}} h. {{chat.unread_time.minits}} m. {{chat.unread_time.seconds}} s. ago.</b></li></ul><p ng-show="unread_chats.list.length == 0">Empty...</p></div><?php
}
开发者ID:sajawalsz,项目名称:WebDealerSolutions,代码行数:31,代码来源:98e8e1f0fd582583b3c13281183e5273.php
示例17: array
} else {
$UserData->invisible_mode = 0;
}
$globalDepartament = array();
if (isset($_POST['all_departments']) && $_POST['all_departments'] == 'on') {
$UserData->all_departments = 1;
$globalDepartament[] = 0;
} else {
$UserData->all_departments = 0;
}
if (count($Errors) == 0) {
$UserData->setPassword($form->Password);
$UserData->email = $form->Email;
$UserData->name = $form->Name;
$UserData->username = $form->Username;
erLhcoreClassUser::getSession()->save($UserData);
if (isset($_POST['UserDepartament']) && count($_POST['UserDepartament']) > 0) {
$globalDepartament = array_merge($_POST['UserDepartament'], $globalDepartament);
}
if (count($globalDepartament) > 0) {
erLhcoreClassUserDep::addUserDepartaments($globalDepartament, $UserData->id, $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();
}
// Store photo
if (isset($_FILES["UserPhoto"]) && is_uploaded_file($_FILES["UserPhoto"]["tmp_name"]) && $_FILES["UserPhoto"]["error"] == 0 && erLhcoreClassImageConverter::isPhoto('UserPhoto')) {
开发者ID:sudogitguy,项目名称:livehelperchat,代码行数:31,代码来源:new.php
示例18: erLhcoreClassModelCannedMsg
}
if (count($globalDepartament) > 0) {
erLhcoreClassUserDep::addUserDepartaments($globalDepartament, false, $UserData);
} else {
erLhcoreClassUserDep::addUserDepartaments(array(), false, $UserData);
}
$tpl->set('account_updated_departaments', 'done');
$tpl->set('tab', 'tab_departments');
}
// If already set during
|
请发表评论