<?php $tpl = erLhcoreClassTemplate::getInstance('lhsystem/timezone.tpl.php'); $cfgSite = erConfigClassLhConfig::getInstance(); $timezone = $cfgSite->getSetting('site', 'time_zone'); $date_format = $cfgSite->getSetting('site', 'date_format'); $date_hour_format = $cfgSite->getSetting('site', 'date_hour_format'); $date_date_hour_format = $cfgSite->getSetting('site', 'date_date_hour_format'); if (isset($_POST['StoreTimeZoneSettings'])) { $definition = array('TimeZone' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'DateFormat' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'DateFullFormat' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'DateHourFormat' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw')); if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) { erLhcoreClassModule::redirect('system/timezone'); exit; } $form = new ezcInputForm(INPUT_POST, $definition); if ($form->hasValidData('TimeZone')) { $timezone = $form->TimeZone; } else { $timezone = ''; } if ($form->hasValidData('DateFormat')) { $date_format = $form->DateFormat; } else { $date_format = ''; } if ($form->hasValidData('DateFullFormat')) { $date_date_hour_format = $form->DateFullFormat; } else { $date_date_hour_format = ''; } if ($form->hasValidData('DateHourFormat')) {
<?php $tpl = erLhcoreClassTemplate::getInstance('lhdocshare/configuration.tpl.php'); $docSharer = erLhcoreClassModelChatConfig::fetch('doc_sharer'); $data = (array) $docSharer->data; if (isset($_POST['StoreConfiguration'])) { $definition = array('LibreOfficePath' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'SupportedExtensions' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'PdftoppmPath' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'HttpUserName' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'HttpGroupName' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'BackgroundProcess' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean'), 'MaxFileSize' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int', array('min_range' => 2)), 'PdftoppmLimit' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int', array('min_range' => 0))); $Errors = array(); $form = new ezcInputForm(INPUT_POST, $definition); $Errors = array(); if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) { erLhcoreClassModule::redirect('docshare/configuration'); exit; } if ($form->hasValidData('LibreOfficePath')) { $data['libre_office_path'] = $form->LibreOfficePath; } else { $data['libre_office_path'] = '/usr/bin/libreoffice'; } if ($form->hasValidData('PdftoppmPath')) { $data['pdftoppm_path'] = $form->PdftoppmPath; } else { $data['pdftoppm_path'] = '/usr/bin/pdftoppm'; } if ($form->hasValidData('PdftoppmLimit')) { $data['pdftoppm_limit'] = $form->PdftoppmLimit; } else { $data['pdftoppm_limit'] = '0'; } if ($form->hasValidData('HttpUserName')) { $data['http_user_name'] = $form->HttpUserName;
<?php header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"'); header('Content-type: text/javascript'); header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time() + 60 * 60 * 8) . ' GMT'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', false); header('Pragma: no-cache'); $tpl = erLhcoreClassTemplate::getInstance('lhchat/chatcheckstatus.tpl.php'); if (is_array($Params['user_parameters_unordered']['department'])) { erLhcoreClassChat::validateFilterIn($Params['user_parameters_unordered']['department']); $tpl->set('department', implode('/', $Params['user_parameters_unordered']['department'])); $tpl->set('department_array', $Params['user_parameters_unordered']['department']); } else { $tpl->set('department', false); $tpl->set('department_array', false); } $tpl->set('status', $Params['user_parameters_unordered']['status'] == 'true' ? true : false); if (erLhcoreClassModelChatConfig::fetch('track_is_online')->current_value) { $ignorable_ip = erLhcoreClassModelChatConfig::fetch('ignorable_ip')->current_value; if ($ignorable_ip == '' || !erLhcoreClassIPDetect::isIgnored(erLhcoreClassIPDetect::getIP(), explode(',', $ignorable_ip))) { if ((string) $Params['user_parameters_unordered']['vid'] != '') { $db = ezcDbInstance::get(); /** * Perhaps there is some pending operations for online visitor * */ $stmt = $db->prepare('SELECT operation FROM lh_chat_online_user WHERE vid = :vid'); $stmt->bindValue(':vid', (string) $Params['user_parameters_unordered']['vid']); $stmt->execute(); $operation = $stmt->fetch(PDO::FETCH_COLUMN);
<?php $tpl = erLhcoreClassTemplate::getInstance('lhtheme/import.tpl.php'); if (ezcInputForm::hasPostData()) { if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) { erLhcoreClassModule::redirect('theme/import'); exit; } if (erLhcoreClassSearchHandler::isFile('themefile', array('json'))) { $dir = 'var/tmpfiles/'; erLhcoreClassChatEventDispatcher::getInstance()->dispatch('theme.temppath', array('dir' => &$dir)); erLhcoreClassFileUpload::mkdirRecursive($dir); $filename = erLhcoreClassSearchHandler::moveUploadedFile('themefile', $dir); $content = file_get_contents($dir . $filename); unlink($dir . $filename); $data = json_decode($content); if ($data !== null) { $widgetTheme = new erLhAbstractModelWidgetTheme(); $data = (array) $data; $imgData = array(); if (isset($data['logo_image_data'])) { $imgData['logo_image'] = $data['logo_image_data']; unset($data['logo_image_data']); } if (isset($data['need_help_image_data'])) { $imgData['need_help_image'] = $data['need_help_image_data']; unset($data['need_help_image_data']); } if (isset($data['online_image_data'])) { $imgData['online_image'] = $data['online_image_data']; unset($data['online_image_data']);
<?php try { $tpl = erLhcoreClassTemplate::getInstance('lhinstance/invoices.tpl.php'); $pages = new lhPaginator(); $pages->items_total = erLhcoreClassModelInstanceInvoice::getCount(); $pages->translationContext = 'abstract/list'; $pages->serverURL = erLhcoreClassDesign::baseurl('instance/invoices'); $pages->setItemsPerPage(20); $pages->paginate(); $tpl->set('pages', $pages); $items = array(); if ($pages->items_total > 0) { $items = erLhcoreClassModelInstanceInvoice::getList(array('offset' => $pages->low, 'limit' => $pages->items_per_page)); } $tpl->set('items', $items); $tpl->set('pages', $pages); $Result['content'] = $tpl->fetch(); $Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/htmlcode', 'System configuration')), array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Invoices'))); } catch (Exception $e) { print_r($e); }
<?php $tpl = erLhcoreClassTemplate::getInstance('lhsystem/smtp.tpl.php'); $smtpData = erLhcoreClassModelChatConfig::fetch('smtp_data'); $data = (array) $smtpData->data; if (isset($_POST['StoreSMTPSettings']) || isset($_POST['StoreSMTPSettingsTest'])) { $definition = array('host' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'username' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'password' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'port' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'use_smtp' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean')); if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) { erLhcoreClassModule::redirect('system/smtp'); exit; } $Errors = array(); $form = new ezcInputForm(INPUT_POST, $definition); $Errors = array(); if ($form->hasValidData('host')) { $data['host'] = $form->host; } else { $data['host'] = ''; } if ($form->hasValidData('port')) { $data['port'] = $form->port; } else { $data['port'] = ''; } if ($form->hasValidData('use_smtp') && $form->use_smtp == true) { $data['use_smtp'] = 1; } else { $data['use_smtp'] = 0; } if ($form->hasValidData('username')) { $data['username'] = $form->username;
<?php $tpl = erLhcoreClassTemplate::getInstance('lhchatarchive/listarchivechats.tpl.php'); $archive = erLhcoreClassModelChatArchiveRange::fetch($Params['user_parameters']['id']); if (isset($_GET['doSearch'])) { $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'chat_search', 'format_filter' => true, 'use_override' => true, 'uparams' => $Params['user_parameters_unordered'])); $filterParams['is_search'] = true; } else { $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'chat_search', 'format_filter' => true, 'uparams' => $Params['user_parameters_unordered'])); $filterParams['is_search'] = false; } $append = erLhcoreClassSearchHandler::getURLAppendFromInput($filterParams['input_form']); // Set correct archive tables $archive->setArchiveTables(); $pages = new lhPaginator(); $pages->serverURL = erLhcoreClassDesign::baseurl('chatarchive/listarchivechats') . '/' . $archive->id . $append; $pages->items_total = erLhcoreClassChat::getCount($filterParams['filter'], erLhcoreClassModelChatArchiveRange::$archiveTable); $pages->setItemsPerPage(2); $pages->paginate(); $items = array(); if ($pages->items_total > 0) { try { $items = erLhcoreClassChat::getList(array_merge(array('offset' => $pages->low, 'limit' => $pages->items_per_page, 'sort' => 'id ASC'), $filterParams['filter']), 'erLhcoreClassModelChatArchive', erLhcoreClassModelChatArchiveRange::$archiveTable); } catch (Exception $e) { print_r($e->getMessage()); } } $filterParams['input_form']->form_action = erLhcoreClassDesign::baseurl('chatarchive/listarchivechats') . '/' . $archive->id; $tpl->set('input', $filterParams['input_form']); $tpl->set('items', $items); $tpl->set('archive', $archive);
<?php try { $chat = erLhcoreClassChat::getSession()->load('erLhcoreClassModelChat', $Params['user_parameters']['chat_id']); if ($chat->hash == $Params['user_parameters']['hash']) { $msg = erLhcoreClassModelmsg::fetch($Params['user_parameters']['msgid']); if ($msg->chat_id == $chat->id) { $tpl = erLhcoreClassTemplate::getInstance('lhchat/syncuser.tpl.php'); $tpl->set('messages', array((array) $msg)); $tpl->set('chat', $chat); $tpl->set('sync_mode', isset($Params['user_parameters_unordered']['mode']) ? $Params['user_parameters_unordered']['mode'] : ''); echo json_encode(array('msg' => $tpl->fetch(), 'error' => 'f')); exit; } } } catch (Exception $e) { } echo json_encode(array('error' => 't')); exit;
<?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) {
<?php $tpl = erLhcoreClassTemplate::getInstance('lhtheme/adminnewtheme.tpl.php'); $form = new erLhAbstractModelAdminTheme(); if (ezcInputForm::hasPostData()) { $Errors = erLhcoreClassThemeValidator::validateAdminTheme($form); if (!empty($Errors)) { $tpl->set('errors', $Errors); } else { $form->saveThis(); erLhcoreClassModule::redirect('theme/adminthemes'); exit; } } $tpl->set('form', $form); $Result['content'] = $tpl->fetch(); $Result['additional_footer_js'] = '<script src="' . erLhcoreClassDesign::designJS('js/admintheme.form.angular.js') . '"></script>'; $Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('theme/index'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('theme/index', 'Themes')), array('url' => erLhcoreClassDesign::baseurl('theme/adminthemes'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('lhtheme/admin', 'Admin themes')), array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('lhtheme/admin', 'New admin theme')));
<?php $tpl = erLhcoreClassTemplate::getInstance('lhchat/operatorschats.tpl.php'); if (isset($_GET['doSearch'])) { $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'chat_search', 'format_filter' => true, 'use_override' => true, 'uparams' => $Params['user_parameters_unordered'])); $filterParams['is_search'] = true; } else { $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'chat_search', 'format_filter' => true, 'uparams' => $Params['user_parameters_unordered'])); $filterParams['is_search'] = false; } if ($Params['user_parameters_unordered']['print'] == 1) { $tpl = erLhcoreClassTemplate::getInstance('lhchat/printchats.tpl.php'); $items = erLhcoreClassChat::getOperatorsChats(10000, 0, $filterParams['filter']); $tpl->set('items', $items); $Result['content'] = $tpl->fetch(); $Result['pagelayout'] = 'popup'; return; } if ($Params['user_parameters_unordered']['xls'] == 1) { erLhcoreClassChatExport::chatListExportXLS(erLhcoreClassChat::getOperatorsChats(10000, 0, $filterParams['filter'])); exit; } $append = erLhcoreClassSearchHandler::getURLAppendFromInput($filterParams['input_form']); $pages = new lhPaginator(); $pages->items_total = erLhcoreClassChat::getOperatorsChatsCount($filterParams['filter']); $pages->translationContext = 'chat/closedchats'; $pages->serverURL = erLhcoreClassDesign::baseurl('chat/operatorschats') . $append; $pages->paginate(); $tpl->set('pages', $pages); if ($pages->items_total > 0) { $items = erLhcoreClassChat::getOperatorsChats($pages->items_per_page, $pages->low, $filterParams['filter']);
<?php if (!isset($_SERVER['HTTP_X_CSRFTOKEN']) || !$currentUser->validateCSFRToken($_SERVER['HTTP_X_CSRFTOKEN'])) { echo json_encode(array('error' => 'true', 'result' => 'Invalid CSRF Token')); exit; } $definition = array('data' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::REQUIRED, 'unsafe_raw')); $form = new ezcInputForm(INPUT_POST, $definition); $Chat = erLhcoreClassChat::getSession()->load('erLhcoreClassModelChat', $Params['user_parameters']['chat_id']); $errorTpl = erLhcoreClassTemplate::getInstance('lhkernel/validation_error.tpl.php'); if (erLhcoreClassChat::hasAccessToRead($Chat)) { if ($form->hasValidData('data')) { $errors = array(); erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.before_save_remarks', array('chat' => &$Chat, 'errors' => &$errors)); if (empty($errors)) { $Chat->remarks = $form->data; $Chat->saveThis(); echo json_encode(array('error' => 'false')); exit; } else { $errorTpl->set('errors', $errors); echo json_encode(array('error' => 'true', 'result' => $errorTpl->fetch())); exit; } } else { $errorTpl->set('errors', array(erTranslationClassLhTranslation::getInstance()->getTranslation('chat/adminchat', 'Form data not valid'))); echo json_encode(array('error' => 'true', 'result' => $errorTpl->fetch())); exit; } } else { $errorTpl->set('errors', array(erTranslationClassLhTranslation::getInstance()->getTranslation('chat/adminchat', 'Has no access to this chat')));
<?php $response = erLhcoreClassChatEventDispatcher::getInstance()->dispatch('form.index', array()); $tpl = erLhcoreClassTemplate::getInstance('lhform/index.tpl.php'); $Result['content'] = $tpl->fetch(); $Result['path'] = array(array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('form/index', 'Form')));
<?php /** * This is optional if some extension AH decides to block usage of this module function completely * We don't do redirect here * */ $response = erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.statistic', array()); $tpl = erLhcoreClassTemplate::getInstance('lhstatistic/statistic.tpl.php'); $validTabs = array('active', 'total', 'last24', 'chatsstatistic'); $tab = isset($Params['user_parameters_unordered']['tab']) && in_array($Params['user_parameters_unordered']['tab'], $validTabs) ? $Params['user_parameters_unordered']['tab'] : 'active'; if ($tab == 'active') { if (isset($_GET['doSearch'])) { $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'chat_search', 'format_filter' => true, 'use_override' => true, 'uparams' => $Params['user_parameters_unordered'])); } else { $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'chat_search', 'format_filter' => true, 'uparams' => $Params['user_parameters_unordered'])); } $tpl->set('input', $filterParams['input_form']); if (isset($_GET['xmlavguser'])) { erLhcoreClassChatStatistic::exportAverageOfChatsDialogsByUser(30, $filterParams['filter']); exit; } $tpl->setArray(array('userStats' => erLhcoreClassChatStatistic::getRatingByUser(30, $filterParams['filter']), 'countryStats' => erLhcoreClassChatStatistic::getTopChatsByCountry(30, $filterParams['filter']), 'userChatsStats' => erLhcoreClassChatStatistic::numberOfChatsDialogsByUser(30, $filterParams['filter']), 'userChatsAverageStats' => erLhcoreClassChatStatistic::averageOfChatsDialogsByUser(30, $filterParams['filter']), 'userWaitTimeByOperator' => erLhcoreClassChatStatistic::avgWaitTimeyUser(30, $filterParams['filter']), 'numberOfChatsPerMonth' => erLhcoreClassChatStatistic::getNumberOfChatsPerMonth($filterParams['filter']), 'numberOfChatsPerWaitTimeMonth' => erLhcoreClassChatStatistic::getNumberOfChatsWaitTime($filterParams['filter']), 'numberOfChatsPerHour' => erLhcoreClassChatStatistic::getWorkLoadStatistic($filterParams['filter']), 'averageChatTime' => erLhcoreClassChatStatistic::getAverageChatduration(30, $filterParams['filter']), 'numberOfMsgByUser' => erLhcoreClassChatStatistic::numberOfMessagesByUser(30, $filterParams['filter']), 'urlappend' => erLhcoreClassSearchHandler::getURLAppendFromInput($filterParams['input_form']))); } elseif ($tab == 'chatsstatistic') { if (isset($_GET['doSearch'])) { $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'chatsstatistic_tab', 'format_filter' => true, 'use_override' => true, 'uparams' => $Params['user_parameters_unordered'])); } else { $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'chatsstatistic_tab', 'format_filter' => true, 'uparams' => $Params['user_parameters_unordered'])); } $tpl->set('input', $filterParams['input_form']); $tpl->set('groupby', $filterParams['input_form']->groupby == 1 ? 'Y.m.d' : 'Y.m'); if ($filterParams['input_form']->groupby == 1) {
<?php $currentUser = erLhcoreClassUser::instance(); $instance = erLhcoreClassSystem::instance(); if ($instance->SiteAccess != 'site_admin') { if ($currentUser->isLogged() && !empty($Params['user_parameters_unordered']['r'])) { header('Location: ' . erLhcoreClassDesign::baseurldirect('site_admin') . '/' . base64_decode(rawurldecode($Params['user_parameters_unordered']['r']))); exit; } $redirect = rawurldecode($Params['user_parameters_unordered']['r']); $redirectFull = $redirect != '' ? '/(r)/' . rawurlencode($redirect) : ''; header('Location: ' . erLhcoreClassDesign::baseurldirect('site_admin/user/login') . $redirectFull); exit; } $tpl = erLhcoreClassTemplate::getInstance('lhuser/login.tpl.php'); $redirect = ''; if (isset($_POST['redirect'])) { $redirect = $_POST['redirect']; $tpl->set('redirect_url', $redirect); } else { $redirect = rawurldecode($Params['user_parameters_unordered']['r']); $tpl->set('redirect_url', $redirect); } if (isset($_POST['Login'])) { if (!$currentUser->authenticate($_POST['Username'], $_POST['Password'], isset($_POST['rememberMe']) && $_POST['rememberMe'] == 1 ? true : false)) { $Error = erTranslationClassLhTranslation::getInstance()->getTranslation('user/login', 'Incorrect username or password'); $tpl->set('errors', array($Error)); } else { if ($redirect != '') { erLhcoreClassModule::redirect(base64_decode($redirect)); } else {
<?php $tpl = erLhcoreClassTemplate::getInstance('lhchat/getonlineuserinfo.tpl.php'); $onlineUser = erLhcoreClassModelChatOnlineUser::fetch($Params['user_parameters']['id']); $tpl->set('online_user', $onlineUser); echo $tpl->fetch(); exit;
<?php // For IE to support headers if chat is installed on different domain header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"'); $tpl = erLhcoreClassTemplate::getInstance('lhsurvey/fillwidget.tpl.php'); $embedMode = false; if ((string) $Params['user_parameters_unordered']['mode'] == 'embed') { $embedMode = true; } if (isset($Params['user_parameters_unordered']['theme']) && (int) $Params['user_parameters_unordered']['theme'] > 0) { try { $theme = erLhAbstractModelWidgetTheme::fetch($Params['user_parameters_unordered']['theme']); $Result['theme'] = $theme; $tpl->set('theme', $theme); } catch (Exception $e) { } } try { if (is_numeric((string) $Params['user_parameters_unordered']['chatid']) && $Params['user_parameters_unordered']['chatid'] > 0) { if ((string) $Params['user_parameters_unordered']['hash'] != '') { $hash = $Params['user_parameters_unordered']['hash']; } if (is_numeric($Params['user_parameters_unordered']['chatid'])) { $chat = erLhcoreClassModelChat::fetch($Params['user_parameters_unordered']['chatid']); } } else { if ((string) $Params['user_parameters_unordered']['hash'] != '') { list($chatID, $hash) = explode('_', $Params['user_parameters_unordered']['hash']); $chat = erLhcoreClassModelChat::fetch($chatID); } }
<?php $tpl = erLhcoreClassTemplate::getInstance('lhchat/listchatconfig.tpl.php'); if ($currentUser->hasAccessTo('lhchat', 'administrateconfig')) { if (isset($_POST['UpdateConfig'])) { foreach (erLhcoreClassModelChatConfig::getItems() as $item) { $ConfigData = erLhcoreClassModelChatConfig::fetch($item->identifier); switch ($ConfigData->type) { case erLhcoreClassModelChatConfig::SITE_ACCESS_PARAM_ON: $data = array(); foreach (erConfigClassLhConfig::getInstance()->getSetting('site', 'available_site_access') as $siteaccess) { $data[$siteaccess] = $_POST[$item->identifier . 'Value' . $siteaccess]; } $ConfigData->value = serialize($data); break; case erLhcoreClassModelChatConfig::SITE_ACCESS_PARAM_OFF: $ConfigData->value = isset($_POST[$item->identifier . 'ValueParam']) ? $_POST[$item->identifier . 'ValueParam'] : 0; break; default: break; } $ConfigData->saveThis(); } // Cleanup cache to recompile templates etc. $CacheManager = erConfigClassLhCacheConfig::getInstance(); $CacheManager->expireCache(); $tpl->set('updated', 'done'); } } $tpl->set('currentUser', $currentUser); $Result['content'] = $tpl->fetch();
<?php $tpl = erLhcoreClassTemplate::getInstance('lhinstance/edit.tpl.php'); $Instance = erLhcoreClassModelInstance::fetch((int) $Params['user_parameters']['instance_id']); $cfgSite = erConfigClassLhConfig::getInstance(); $tpl->set('locales', $cfgSite->getSetting('site', 'available_site_access')); if (isset($_POST['Cancel_departament'])) { erLhcoreClassModule::redirect('instance/list'); exit; } $modules = array('reporting_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Statistic supported'), 'atranslations_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Automatic translations supported'), 'cobrowse_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Co-Browse supported'), 'cobrowse_forms_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Co-Browse forms filling supported'), 'forms_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Forms supported'), 'cannedmsg_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Canned messages supported'), 'faq_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'FAQ supported'), 'reporting_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Reporting supported'), 'chatbox_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Chatbox supported'), 'browseoffers_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Browse offers supported'), 'questionnaire_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Questionnaire supported'), 'proactive_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Proactive supported'), 'screenshot_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Screenshot supported'), 'blocked_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'User blocking supported'), 'files_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Files supported'), 'sms_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'SMS chat supported'), 'onlinevisitortrck_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Online visitors list supported'), 'geoadjustment_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'GEO adjustment supporte'), 'chatremarks_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Chat notes supported'), 'autoresponder_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Autoresponder supported'), 'previouschats_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Previous chats supported'), 'footprint_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Footprint supported'), 'chat_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Chat supported'), 'speech_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Speech supported'), 'transfer_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Chat transfer supported'), 'operatorschat_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Chat between operators supported'), 'xmpp_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'XMPP supported'), 'offline_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Offline supported'), 'sugarcrm_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'SugarCRM supported'), 'full_xmpp_chat_supported' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Full XMPP chat supported'), 'full_xmpp_visitors_tracking' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Track online visitors in XMPP')); erLhcoreClassChatEventDispatcher::getInstance()->dispatch('instance.features_titles', array('features' => &$modules)); $tpl->set('modules_features', $modules); if (isset($_POST['ChangePassword'])) { $definition = array('InstancePassword' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'InstanceUsername' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw')); $form = new ezcInputForm(INPUT_POST, $definition); $Errors = array(); if ($form->hasValidData('InstancePassword') && $form->InstancePassword != '') { $Instance->setPassword($form->InstancePassword); $tpl->set('updated', true); } else { $tpl->set('errors', array('Password was not change')); } if ($form->hasValidData('InstanceUsername') && $form->InstanceUsername != '') { $Instance->setUsername($form->InstanceUsername); $tpl->set('updated', true); } else { $tpl->set('errors', array('Username was not change')); } } if (isset($_POST['UpdateUsers'])) {
<?php $tpl = erLhcoreClassTemplate::getInstance('lhform/collected.tpl.php'); $form = erLhAbstractModelForm::fetch((int) $Params['user_parameters']['form_id']); if (is_numeric($Params['user_parameters_unordered']['id']) && $Params['user_parameters_unordered']['action'] == 'delete') { // Delete selected canned message try { if (!$currentUser->validateCSFRToken($Params['user_parameters_unordered']['csfr'])) { die('Invalid CSRF Token'); exit; } $collected = erLhAbstractModelFormCollected::fetch((int) $Params['user_parameters_unordered']['id']); $collected->removeThis(); } catch (Exception $e) { // Do nothing } erLhcoreClassModule::redirect('form/collected', '/' . $form->id); exit; } $pages = new lhPaginator(); $pages->serverURL = erLhcoreClassDesign::baseurl('form/collected') . '/' . $form->id; $pages->items_total = erLhAbstractModelFormCollected::getCount(array('filter' => array('form_id' => $form->id))); $pages->setItemsPerPage(20); $pages->paginate(); $items = array(); if ($pages->items_total > 0) { $items = erLhAbstractModelFormCollected::getList(array('filter' => array('form_id' => $form->id), 'offset' => $pages->low, 'limit' => $pages->items_per_page, 'sort' => 'id DESC')); } $tpl->set('items', $items); $tpl->set('pages', $pages); $tpl->set('form', $form);
<?php $Question = erLhcoreClassModelQuestion::fetch((int) $Params['user_parameters']['id']); $response = erLhcoreClassChatEventDispatcher::getInstance()->dispatch('questionary.edit', array('questionary' => $Question)); $tpl = erLhcoreClassTemplate::getInstance('lhquestionary/edit.tpl.php'); $validTabs = array('answers', 'voting'); $tab = in_array((string) $Params['user_parameters_unordered']['tab'], $validTabs) ? (string) $Params['user_parameters_unordered']['tab'] : ''; $tpl->set('tab', $tab); if (isset($_POST['CancelAction'])) { erLhcoreClassModule::redirect('questionary/list'); exit; } if (isset($_POST['UpdateAction']) || isset($_POST['SaveAction'])) { $definition = array('Question' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'QuestionIntro' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'Location' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'Active' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean'), 'Priority' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int'), 'Revote' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int')); if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) { erLhcoreClassModule::redirect(); exit; } $form = new ezcInputForm(INPUT_POST, $definition); $Errors = array(); if (!$form->hasValidData('Question') || $form->Question == '') { $Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('questionary/edit', 'Please enter a question!'); } if ($form->hasValidData('QuestionIntro')) { $Question->question_intro = $form->QuestionIntro; } if ($form->hasValidData('Location')) { $Question->location = $form->Location; } else { $Question->location = ''; }
<?php $tpl = erLhcoreClassTemplate::getInstance('lhsystem/embedcode.tpl.php'); $cfgSite = erConfigClassLhConfig::getInstance(); $tpl->set('locales', $cfgSite->getSetting('site', 'available_site_access')); /** * Append user departments filter * */ $departmentParams = array(); $userDepartments = erLhcoreClassUserDep::parseUserDepartmetnsForFilter($currentUser->getUserID()); if ($userDepartments !== true) { $departmentParams['filterin']['id'] = $filter['filterin']['dep_id'] = $userDepartments; } $tpl->set('departmentParams', $departmentParams); $Result['content'] = $tpl->fetch(); $Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/htmlcode', 'System configuration')), array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/htmlcode', 'Embed code')));
<?php $tpl = erLhcoreClassTemplate::getInstance('lhchat/notificationsettings.tpl.php'); $Result['content'] = $tpl->fetch(); $Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/configuration', 'System configuration')), array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/configuration', 'New chat notification settings')));
<?php $tpl = erLhcoreClassTemplate::getInstance('lhdepartament/edit.tpl.php'); $Departament = erLhcoreClassDepartament::getSession()->load('erLhcoreClassModelDepartament', (int) $Params['user_parameters']['departament_id']); $userDepartments = true; /** * Append user departments filter * */ if ($currentUser->hasAccessTo('lhdepartment', 'manageall') !== true) { $userDepartments = erLhcoreClassUserDep::parseUserDepartmetnsForFilter($currentUser->getUserID()); if ($userDepartments !== true) { if (!in_array($Departament->id, $userDepartments)) { erLhcoreClassModule::redirect('departament/departaments'); exit; } } } if (isset($_POST['Cancel_departament'])) { erLhcoreClassModule::redirect('departament/departaments'); exit; } if (isset($_POST['Delete_departament'])) { if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token']) || !$currentUser->hasAccessTo('lhdepartament', 'delete') || !$Departament->can_delete) { erLhcoreClassModule::redirect('departament/departaments'); exit; } $Departament->removeThis(); erLhcoreClassModule::redirect('departament/departaments'); exit; } if (isset($_POST['Update_departament']) || isset($_POST['Save_departament'])) {
<?php $tpl = erLhcoreClassTemplate::getInstance('lhfile/list.tpl.php'); if (isset($_GET['doSearch'])) { $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'filelist', 'format_filter' => true, 'use_override' => true, 'uparams' => $Params['user_parameters_unordered'])); $filterParams['is_search'] = true; } else { $filterParams = erLhcoreClassSearchHandler::getParams(array('module' => 'chat', 'module_file' => 'filelist', 'format_filter' => true, 'uparams' => $Params['user_parameters_unordered'])); $filterParams['is_search'] = false; } $append = erLhcoreClassSearchHandler::getURLAppendFromInput($filterParams['input_form']); $pages = new lhPaginator(); $pages->serverURL = erLhcoreClassDesign::baseurl('file/list') . $append; $pages->items_total = erLhcoreClassChat::getCount($filterParams['filter'], 'lh_chat_file'); $pages->setItemsPerPage(20); $pages->paginate(); $items = array(); if ($pages->items_total > 0) { $items = erLhcoreClassChat::getList(array_merge(array('offset' => $pages->low, 'limit' => $pages->items_per_page, 'sort' => 'id DESC'), $filterParams['filter']), 'erLhcoreClassModelChatFile', 'lh_chat_file'); } $tpl->set('items', $items); $tpl->set('pages', $pages); $filterParams['input_form']->form_action = erLhcoreClassDesign::baseurl('file/list'); $tpl->set('input', $filterParams['input_form']); $Result['content'] = $tpl->fetch(); $Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/configuration', 'System configuration')), array('url' => erLhcoreClassDesign::baseurl('file/list'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('system/configuration', 'List of files')));
<?php header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"'); $tpl = erLhcoreClassTemplate::getInstance('lhchat/readoperatormessage.tpl.php'); $tpl->set('referer', ''); $tpl->set('referer_site', ''); $userInstance = erLhcoreClassModelChatOnlineUser::handleRequest(array('message_seen_timeout' => erLhcoreClassModelChatConfig::fetch('message_seen_timeout')->current_value, 'check_message_operator' => true, 'vid' => (string) $Params['user_parameters_unordered']['vid'])); $tpl->set('visitor', $userInstance); $inputData = new stdClass(); $inputData->username = ''; $inputData->question = ''; $inputData->email = ''; if (is_array($Params['user_parameters_unordered']['department']) && count($Params['user_parameters_unordered']['department']) == 1) { erLhcoreClassChat::validateFilterIn($Params['user_parameters_unordered']['department']); $inputData->departament_id = array_shift($Params['user_parameters_unordered']['department']); } else { $inputData->departament_id = 0; } if (is_array($Params['user_parameters_unordered']['department'])) { erLhcoreClassChat::validateFilterIn($Params['user_parameters_unordered']['department']); $inputData->departament_id_array = $Params['user_parameters_unordered']['department']; } $inputData->validate_start_chat = false; $inputData->operator = (int) $Params['user_parameters_unordered']['operator']; $inputData->name_items = array(); $inputData->value_items = array(); $inputData->value_types = array(); $inputData->value_sizes = array(); $inputData->hattr = array(); if ((string) $Params['user_parameters_unordered']['vid'] != '') { $inputData->vid = (string) $Params['user_parameters_unordered']['vid'];
<?php $tpl = erLhcoreClassTemplate::getInstance('lhchat/geoadjustment.tpl.php'); $geoData = erLhcoreClassModelChatConfig::fetch('geoadjustment_data'); $data = (array) $geoData->data; if (isset($_POST['SaveGeoAdjustment'])) { $definition = array('use_geo_adjustment' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean'), 'AvailableFor' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'OtherCountries' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'HideFor' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'OtherStatus' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'RestStatus' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'ApplyWidget' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean')); if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) { erLhcoreClassModule::redirect('xmp/configuration'); exit; } $Errors = array(); $form = new ezcInputForm(INPUT_POST, $definition); $Errors = array(); if ($form->hasValidData('use_geo_adjustment')) { $data['use_geo_adjustment'] = true; } else { $data['use_geo_adjustment'] = false; } if ($data['use_geo_adjustment']) { if ($form->hasValidData('AvailableFor')) { $data['available_for'] = $form->AvailableFor; } else { $data['available_for'] = ''; } if ($form->hasValidData('OtherCountries')) { $data['other_countries'] = $form->OtherCountries; } else { $data['other_countries'] = ''; } if ($form->hasValidData('HideFor')) {
<?php $tpl = erLhcoreClassTemplate::getInstance('lhdocshare/index.tpl.php'); $Result['content'] = $tpl->fetch(); $Result['path'] = array(array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('docshare/index', 'Documents sharer')));
<?php $faq = new erLhcoreClassModelFaq(); $response = erLhcoreClassChatEventDispatcher::getInstance()->dispatch('faq.new', array('faq' => $faq)); $tpl = erLhcoreClassTemplate::getInstance('lhfaq/new.tpl.php'); if (isset($_POST['Save'])) { if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) { erLhcoreClassModule::redirect(); exit; } $Errors = erLhcoreClassFaq::validateFaq($faq); if (count($Errors) == 0) { $faq->saveThis(); erLhcoreClassChatEventDispatcher::getInstance()->dispatch('faq.created', array('faq' => &$faq)); erLhcoreClassModule::redirect('faq/list'); exit; } else { $tpl->set('errors', $Errors); } } if (isset($_POST['Cancel'])) { erLhcoreClassModule::redirect('faq/list'); exit; } $tpl->set('faq', $faq); $Result['content'] = $tpl->fetch(); $Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('faq/list'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('faq/list', 'FAQ')), array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('faq/new', 'New question')));
} if (!isset($_SERVER['HTTP_X_CSRFTOKEN']) || !isset($_POST['csfr_token']) || $_POST['csfr_token'] != $_SERVER['HTTP_X_CSRFTOKEN']) { $Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('user/edit', 'Invalid CSRF token!'); } if (empty($Errors)) { $tpl = erLhcoreClassTemplate::getInstance('lhchat/sendmail.tpl.php'); $mailTemplate = erLhAbstractModelEmailTemplate::fetch(3); erLhcoreClassChatMail::prepareSendMail($mailTemplate); $mailTemplate->recipient = $form->email; $messages = array_reverse(erLhcoreClassModelmsg::getList(array('customfilter' => array('user_id != -1'), 'limit' => 500, 'sort' => 'id DESC', 'filter' => array('chat_id' => $chat->id)))); // Fetch chat messages $tpl = new erLhcoreClassTemplate('lhchat/messagelist/plain.tpl.php'); $tpl->set('chat', $chat); $tpl->set('messages', $messages); $mailTemplate->content = str_replace(array('{user_chat_nick}', '{messages_content}'), array($chat->nick, $tpl->fetch()), $mailTemplate->content); erLhcoreClassChatMail::sendMail($mailTemplate, $chat); echo json_encode(array('error' => 'false')); exit; } else { $tpl = erLhcoreClassTemplate::getInstance('lhkernel/validation_error.tpl.php'); $tpl->set('errors', $Errors); echo json_encode(array('error' => 'true', 'result' => $tpl->fetch())); exit; } } else { $tpl = erLhcoreClassTemplate::getInstance('lhchat/sendchat.tpl.php'); $tpl->set('chat', $chat); echo $tpl->fetch(); } } exit;