本文整理汇总了PHP中erConfigClassLhConfig类的典型用法代码示例。如果您正苦于以下问题:PHP erConfigClassLhConfig类的具体用法?PHP erConfigClassLhConfig怎么用?PHP erConfigClassLhConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了erConfigClassLhConfig类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: createDB
public static function createDB($client_id)
{
$cfg = erConfigClassLhConfig::getInstance();
self::deleteDB($client_id);
$db = ezcDbInstance::get();
$db->query('CREATE DATABASE ' . $cfg->getSetting('db', 'database_user_prefix') . $client_id . ';');
}
开发者ID:alisadali,项目名称:automated-hosting,代码行数:7,代码来源:mysql.php
示例2: __construct
public function __construct()
{
$this->memcache = new Memcache();
$hosts = erConfigClassLhConfig::getInstance()->getSetting('memecache', 'servers');
foreach ($hosts as $server) {
$this->memcache->addServer($server['host'], $server['port'], $server['weight']);
}
}
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:8,代码来源:lhmemcache.php
示例3: createDB
public static function createDB($client_id)
{
$cfg = erConfigClassLhConfig::getInstance();
$sock = new HTTPSocket();
$sock->connect('ssl://' . $cfg->getSetting('site', 'direct_admin_ip'), $cfg->getSetting('site', 'direct_admin_port'));
$sock->set_login($cfg->getSetting('site', 'direct_admin_user'), $cfg->getSetting('site', 'direct_admin_pass'));
$sock->set_method('POST');
$sock->query('/CMD_API_DATABASES', array('action' => 'create', 'name' => "client{$client_id}", 'userlist' => $cfg->getSetting('site', 'direct_admin_dbuser'), 'passwd' => $cfg->getSetting('site', 'direct_admin_dbpass'), 'passwd2' => $cfg->getSetting('site', 'direct_admin_dbpass')));
return $sock->fetch_body();
}
开发者ID:alisadali,项目名称:automated-hosting,代码行数:10,代码来源:directadmin.php
示例4: __construct
public function __construct()
{
try {
$params = erConfigClassLhConfig::getInstance()->getSetting('redis', 'server');
$this->redis = new Redis();
$this->redis->connect($params['host'], $params['port'], 2.5);
$this->redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);
} catch (Exception $e) {
// Do nothing
}
}
开发者ID:sudogitguy,项目名称:livehelperchat,代码行数:11,代码来源:lhredis.php
示例5: updateSiteAccess
public static function updateSiteAccess(stdClass $input)
{
$languages = self::getLanguages();
$languageData = $languages[$input->language];
$siteAccessData = erConfigClassLhConfig::getInstance()->getSetting('site_access_options', $input->siteaccess);
$siteAccessData['locale'] = $languageData['locale'];
$siteAccessData['content_language'] = $languageData['content_language'];
$siteAccessData['dir_language'] = $languageData['dir_language'];
$siteAccessData['theme'] = self::trimArrayElements(explode("\n", trim($input->theme)));
$siteAccessData['default_url']['module'] = $input->module;
$siteAccessData['default_url']['view'] = $input->view;
$cfgSite = erConfigClassLhConfig::getInstance();
$cfgSite->setSetting('site_access_options', $input->siteaccess, $siteAccessData);
$cfgSite->save();
}
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:15,代码来源:lhsiteaccessgenerator.php
示例6: setupInstance
public static function setupInstance($db)
{
if (isset($_SERVER['HTTP_HOST'])) {
$cfg = erConfigClassLhConfig::getInstance();
$subdomain = str_replace('.' . $cfg->getSetting('site', 'seller_domain'), '', $_SERVER['HTTP_HOST']);
$items = erLhcoreClassModelInstance::getList(array('filter' => array('address' => $subdomain)));
if (!empty($items)) {
erLhcoreClassInstance::$instanceChat = array_shift($items);
$db->query('USE ' . $cfg->getSetting('db', 'database_user_prefix') . erLhcoreClassInstance::$instanceChat->id);
} else {
header('Location: ' . $cfg->getSetting('site', 'seller_url'));
exit;
}
}
}
开发者ID:jabaxalapa,项目名称:automated-hosting,代码行数:15,代码来源:erlhcoreclassinstance.php
示例7: setupInstance
public static function setupInstance($db)
{
if (isset($_SERVER['HTTP_HOST'])) {
$cfg = erConfigClassLhConfig::getInstance();
$subdomain = str_replace('.' . $cfg->getSetting('site', 'seller_domain'), '', $_SERVER['HTTP_HOST']);
$session = erLhcoreClassInstance::getSession();
$q = $session->createFindQuery('erLhcoreClassModelInstance');
$q->where($q->expr->eq('address', $q->bindValue($subdomain)) . ' OR (full_domain = 1 AND ' . $q->expr->eq('address', $q->bindValue($_SERVER['HTTP_HOST'])) . ')');
$items = $session->find($q);
if (!empty($items)) {
erLhcoreClassInstance::$instanceChat = array_shift($items);
$db->query('USE ' . $cfg->getSetting('db', 'database_user_prefix') . erLhcoreClassInstance::$instanceChat->id);
} else {
header('Location: ' . $cfg->getSetting('site', 'seller_url'));
exit;
}
}
}
开发者ID:alisadali,项目名称:automated-hosting,代码行数:18,代码来源:erlhcoreclassinstance.php
示例8: sevabot
/**
* Arguments
* array('chat' => & $chat)
* */
public function sevabot($params)
{
$settings = (include 'extension/sevabot/settings/settings.ini.php');
// Format message content
$chat = $params['chat'];
$messages = array_reverse(erLhcoreClassModelmsg::getList(array('limit' => 5, 'sort' => 'id DESC', 'filter' => array('chat_id' => $chat->id))));
$messagesContent = '';
foreach ($messages as $msg) {
if ($msg->user_id == -1) {
$messagesContent .= date(erLhcoreClassModule::$dateDateHourFormat, $msg->time) . ' ' . erTranslationClassLhTranslation::getInstance()->getTranslation('chat/syncadmin', 'System assistant') . ': ' . htmlspecialchars($msg->msg) . "\n";
} else {
$messagesContent .= date(erLhcoreClassModule::$dateDateHourFormat, $msg->time) . ' ' . ($msg->user_id == 0 ? htmlspecialchars($chat->nick) : htmlspecialchars($msg->name_support)) . ': ' . htmlspecialchars($msg->msg) . "\n";
}
}
$cfgSite = erConfigClassLhConfig::getInstance();
$secretHash = $cfgSite->getSetting('site', 'secrethash');
$chatDataItems = $settings['chat'];
if (isset($settings['chat_dep'][$chat->dep_id]) && !empty($settings['chat_dep'][$chat->dep_id])) {
$chatDataItems = array_merge($chatDataItems, $settings['chat_dep'][$chat->dep_id]);
}
// Global notifications
foreach ($chatDataItems as $chatData) {
$veryfyEmail = sha1(sha1($chatData['email'] . $secretHash) . $secretHash);
$msgParsed = str_replace(array('{messages}', '{url_accept}', '{chat_id}', '{user_name}'), array($messagesContent, erLhcoreClassXMP::getBaseHost() . $_SERVER['HTTP_HOST'] . erLhcoreClassDesign::baseurl('chat/accept') . '/' . erLhcoreClassModelChatAccept::generateAcceptLink($chat) . '/' . $veryfyEmail . '/' . $chatData['email'], $chat->id, $chat->user_name), $settings['msg']);
$md5 = md5($chatData['chat_id'] . $msgParsed . $settings['sevabot_secret']);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $settings['url']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, array('md5' => $md5, 'msg' => $msgParsed, 'chat' => $chatData['chat_id']));
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
// Some hostings produces wargning...
$content = curl_exec($ch);
if ($content != 'OK') {
erLhcoreClassLog::write(print_r($content, true));
}
}
}
开发者ID:creativeprogramming,项目名称:livehelperchat-extensions,代码行数:46,代码来源:bootstrap.php
示例9:
?>
</div>
</div>
<?php
}
?>
</div>
<?php
}
?>
</div>
<?php
include_once erLhcoreClassDesign::designtpl('pagelayouts/parts/page_footer.tpl.php');
?>
</div>
</div>
<?php
if (erConfigClassLhConfig::getInstance()->getSetting('site', 'debug_output') == true) {
$debug = ezcDebug::getInstance();
echo $debug->generateOutput();
}
?>
</body>
</html>
开发者ID:sudogitguy,项目名称:livehelperchat,代码行数:31,代码来源:main.php
示例10: dirname
{
ezcBase::autoload($className);
}
ezcBase::addClassRepository(dirname(__FILE__) . '/', dirname(__FILE__) . '/lib/autoloads');
$input = new ezcConsoleInput();
$helpOption = $input->registerOption(new ezcConsoleOption('s', 'siteaccess', ezcConsoleInput::TYPE_STRING));
$cronjobPartOption = $input->registerOption(new ezcConsoleOption('c', 'cronjob', ezcConsoleInput::TYPE_STRING));
$cronjobPathOption = $input->registerOption(new ezcConsoleOption('p', 'path', ezcConsoleInput::TYPE_STRING));
$extensionPartOption = $input->registerOption(new ezcConsoleOption('e', 'extension', ezcConsoleInput::TYPE_STRING));
try {
$input->process();
} catch (ezcConsoleOptionException $e) {
die($e->getMessage());
}
ezcBaseInit::setCallback('ezcInitDatabaseInstance', 'erLhcoreClassLazyDatabaseConfiguration');
$instance = erLhcoreClassSystem::instance();
$instance->SiteAccess = $helpOption->value;
$instance->SiteDir = dirname(__FILE__) . '/';
$cfgSite = erConfigClassLhConfig::getInstance();
$defaultSiteAccess = $cfgSite->getSetting('site', 'default_site_access');
$optionsSiteAccess = $cfgSite->getSetting('site_access_options', $helpOption->value);
$instance->Language = $optionsSiteAccess['locale'];
$instance->ThemeSite = $optionsSiteAccess['theme'];
$instance->WWWDirLang = '/' . $helpOption->value;
// php cron.php -s site_admin -c cron/workflow
// php cron.php -s site_admin -e customstatus -c cron/customcron
if ($extensionPartOption->value) {
include_once 'extension/' . $extensionPartOption->value . '/modules/lh' . $cronjobPartOption->value . '.php';
} else {
include_once 'modules/lh' . $cronjobPartOption->value . '.php';
}
开发者ID:p4prawin,项目名称:livechat,代码行数:31,代码来源:cron.php
示例11: foreach
<?php
/**
* Iterates through all instances and executes callback timeout
* At the moment it's a simple foreach. In the future we may need to enahance this part
* with some queues etc.
*
* php cron.php -s site_admin -e instance -c cron/extensions_update
* */
$cfg = erConfigClassLhConfig::getInstance();
$db = ezcDbInstance::get();
foreach (erLhcoreClassModelInstance::getList(array('limit' => 1000000, 'filter' => array('status' => erLhcoreClassModelInstance::WORKING))) as $instance) {
echo "Executing request to update instance internal structure for extensions - ", $instance->id, "\n";
$secretHash = $cfg->getSetting('site', 'seller_secret_hash');
$hash = sha1($instance->id . 'extensions' . date('Ym') . $secretHash);
if ($instance->full_domain == 1) {
$url = erConfigClassLhConfig::getInstance()->getSetting('site', 'http_mode') . $instance->address . '/index.php/instance/extensionsstructure/' . $instance->id . '/' . date('Ym') . '/' . $hash;
} else {
$url = erConfigClassLhConfig::getInstance()->getSetting('site', 'http_mode') . $instance->address . '.' . $cfg->getSetting('site', 'seller_domain') . '/index.php/instance/extensionsstructure/' . $instance->id . '/' . date('Ym') . '/' . $hash;
}
$response = erLhcoreClassModelChatOnlineUser::executeRequest($url);
echo "Response:\n";
print_r($response);
echo PHP_EOL;
}
开发者ID:alisadali,项目名称:automated-hosting,代码行数:25,代码来源:extensions_update.php
示例12: array
}
if ($form->hasValidData('hattr') && !empty($form->hattr)) {
$inputData->hattr = $form->hattr;
}
$inputData->name_items = $form->name_items;
$stringParts = array();
foreach ($form->name_items as $key => $name_item) {
if (isset($inputData->values_req[$key]) && $inputData->values_req[$key] == 't' && ($inputData->value_show[$key] == 'b' || $inputData->value_show[$key] == (isset($additionalParams['offline']) ? 'off' : 'on')) && (!isset($valuesArray[$key]) || trim($valuesArray[$key]) == '')) {
$Errors[] = trim($name_item) . ' : ' . erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat', 'is required');
}
$stringParts[] = array('key' => $name_item, 'value' => isset($valuesArray[$key]) ? trim($valuesArray[$key]) : '');
}
$chat->additional_data = json_encode($stringParts);
}
if (erLhcoreClassModelChatConfig::fetch('session_captcha')->current_value == 1) {
if (!$form->hasValidData($nameField) || $form->{$nameField} == '' || $form->{$nameField} < time() - 600 || $hashCaptcha != sha1($_SERVER['REMOTE_ADDR'] . $form->{$nameField} . erConfigClassLhConfig::getInstance()->getSetting('site', 'secrethash'))) {
$Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat', 'Invalid captcha code, please enable Javascript!');
}
} else {
// Captcha validation
if (!$form->hasValidData($nameField) || $form->{$nameField} == '' || $form->{$nameField} < time() - 600) {
$Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat', 'Invalid captcha code, please enable Javascript!');
}
}
if ($form->hasValidData('operator') && erLhcoreClassModelUser::getUserCount(array('filter' => array('id' => $form->operator, 'disabled' => 0))) > 0) {
$inputData->operator = $chat->user_id = $form->operator;
}
if ($form->hasValidData('user_timezone')) {
$timezone_name = timezone_name_from_abbr(null, $form->user_timezone * 3600, true);
if ($timezone_name !== false) {
$chat->user_tz_identifier = $timezone_name;
开发者ID:p4prawin,项目名称:livechat,代码行数:31,代码来源:readoperatormessage.php
示例13: foreach
<?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();
开发者ID:sudogitguy,项目名称:livehelperchat,代码行数:31,代码来源:listchatconfig.php
示例14: htmlspecialchars
echo htmlspecialchars(erLhcoreClassModelChatConfig::fetch('application_name')->current_value);
?>
</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<link rel="icon" type="image/png" href="<?php
echo erLhcoreClassDesign::design('images/favicon.ico');
?>
" />
<link rel="shortcut icon" type="image/x-icon" href="<?php
echo erLhcoreClassDesign::design('images/favicon.ico');
?>
">
<meta name="Keywords" content="" />
<meta name="Description" content="<?php
echo erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'description');
?>
" />
<meta name="robots" content="noindex, nofollow">
<?php
include_once erLhcoreClassDesign::designtpl('pagelayouts/parts/copyright_meta.tpl.php');
?>
<?php
include_once erLhcoreClassDesign::designtpl('pagelayouts/parts/page_head_css.tpl.php');
include_once erLhcoreClassDesign::designtpl('pagelayouts/parts/page_head_css_admin_theme.tpl.php');
include_once erLhcoreClassDesign::designtpl('pagelayouts/parts/page_head_css_extension_multiinclude.tpl.php');
?>
<?php
开发者ID:detain,项目名称:livehelperchat,代码行数:31,代码来源:page_head.tpl.php
示例15: newChatInformWorkflow
public static function newChatInformWorkflow($options = array(), &$chat)
{
$chat->nc_cb_executed = 1;
$chat->updateThis();
if (in_array('mail', $options['options'])) {
erLhcoreClassChatMail::sendMailUnacceptedChat($chat);
}
if (in_array('xmp', $options['options'])) {
erLhcoreClassXMP::sendXMPMessage($chat);
}
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.new_chat', array('chat' => &$chat));
// Execute callback if it exists
$extensions = erConfigClassLhConfig::getInstance()->getSetting('site', 'extensions');
$instance = erLhcoreClassSystem::instance();
foreach ($extensions as $ext) {
$callbackFile = $instance->SiteDir . '/extension/' . $ext . '/callbacks/new_chat.php';
if (file_exists($callbackFile)) {
include $callbackFile;
}
}
}
开发者ID:Joeboyc2,项目名称:livehelperchat,代码行数:21,代码来源:lhchatworkflow.php
示例16: isset
<?php
if (erConfigClassLhConfig::getInstance()->getDirLanguage('dir_language') == 'ltr' || erConfigClassLhConfig::getInstance()->getDirLanguage('dir_language') == '') {
?>
<link rel="stylesheet" type="text/css" href="<?php
echo erLhcoreClassDesign::designCSS('vendor/bootstrap/css/bootstrap.min.css;vendor/bootstrap/css/bootstrap-theme.min.css;css/app.css;css/override.css;css/fontello.css;css/datepicker.css');
?>
" />
<?php
} else {
?>
<link rel="stylesheet" type="text/css" href="<?php
echo erLhcoreClassDesign::designCSS('vendor/bootstrap/css/bootstrap.min.css;vendor/bootstrap/css/bootstrap-theme.min.css;css/bootstrap-rtl.min.css;css/app.css;css/app-rtl.css;css/override_rtl.css;css/fontello.css;css/datepicker.css');
?>
" />
<?php
}
echo isset($Result['additional_header_css']) ? $Result['additional_header_css'] : '';
开发者ID:niravpatel2008,项目名称:north-american-nemesis-new,代码行数:18,代码来源:page_head_css.tpl.php
示例17: validateStartChat
/**
* Custom form fields validation
*/
public static function validateStartChat(&$inputForm, &$start_data_fields, &$chat, $additionalParams = array())
{
$validationFields = array();
// Dynamic form field
if ($inputForm->validate_start_chat == true) {
if (isset($start_data_fields['name_visible_in_popup']) && $start_data_fields['name_visible_in_popup'] == true && !isset($additionalParams['offline']) || isset($additionalParams['offline']) && isset($start_data_fields['offline_name_visible_in_popup']) && $start_data_fields['offline_name_visible_in_popup'] == true) {
$validationFields['Username'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw');
}
if (isset($start_data_fields['email_visible_in_popup']) && $start_data_fields['email_visible_in_popup'] == true || isset($additionalParams['offline'])) {
$validationFields['Email'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'validate_email');
}
if (isset($start_data_fields['message_visible_in_popup']) && $start_data_fields['message_visible_in_popup'] == true && !isset($additionalParams['offline']) || isset($additionalParams['offline']) && isset($start_data_fields['offline_message_visible_in_popup']) && $start_data_fields['offline_message_visible_in_popup'] == true) {
$validationFields['Question'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw');
}
if (isset($start_data_fields['phone_visible_in_popup']) && $start_data_fields['phone_visible_in_popup'] == true && !isset($additionalParams['offline']) || isset($additionalParams['offline']) && isset($start_data_fields['offline_phone_visible_in_popup']) && $start_data_fields['offline_phone_visible_in_popup'] == true) {
$validationFields['Phone'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw');
}
if (isset($start_data_fields['tos_visible_in_popup']) && $start_data_fields['tos_visible_in_popup'] == true && !isset($additionalParams['offline']) || isset($additionalParams['offline']) && isset($start_data_fields['offline_tos_visible_in_popup']) && $start_data_fields['offline_tos_visible_in_popup'] == true) {
$validationFields['AcceptTOS'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean');
}
} else {
if (isset($start_data_fields['name_visible_in_page_widget']) && $start_data_fields['name_visible_in_page_widget'] == true && !isset($additionalParams['offline']) || isset($additionalParams['offline']) && isset($start_data_fields['offline_name_visible_in_page_widget']) && $start_data_fields['offline_name_visible_in_page_widget'] == true) {
$validationFields['Username'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw');
}
if (isset($start_data_fields['email_visible_in_page_widget']) && $start_data_fields['email_visible_in_page_widget'] == true || isset($additionalParams['offline'])) {
$validationFields['Email'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'validate_email');
}
if (isset($start_data_fields['message_visible_in_page_widget']) && $start_data_fields['message_visible_in_page_widget'] == true && !isset($additionalParams['offline']) || isset($additionalParams['offline']) && isset($start_data_fields['offline_message_visible_in_page_widget']) && $start_data_fields['offline_message_visible_in_page_widget'] == true) {
$validationFields['Question'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw');
}
if (isset($start_data_fields['phone_visible_in_page_widget']) && $start_data_fields['phone_visible_in_page_widget'] == true && !isset($additionalParams['offline']) || isset($additionalParams['offline']) && isset($start_data_fields['offline_phone_visible_in_page_widget']) && $start_data_fields['offline_phone_visible_in_page_widget'] == true) {
$validationFields['Phone'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw');
}
if (isset($start_data_fields['tos_visible_in_page_widget']) && $start_data_fields['tos_visible_in_page_widget'] == true && !isset($additionalParams['offline']) || isset($additionalParams['offline']) && isset($start_data_fields['offline_tos_visible_in_page_widget']) && $start_data_fields['offline_tos_visible_in_page_widget'] == true) {
$validationFields['AcceptTOS'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean');
}
}
$validationFields['DepartamentID'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int', array('min_range' => -1));
$validationFields['DepartmentIDDefined'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int', array('min_range' => 1), FILTER_REQUIRE_ARRAY);
$validationFields['operator'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int', array('min_range' => 1));
$validationFields['user_timezone'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int');
$validationFields['keyUpStarted'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'int', array('min_range' => 1));
$validationFields['name_items'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY);
$validationFields['values_req'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string', null, FILTER_REQUIRE_ARRAY);
$validationFields['value_items'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY);
$validationFields['value_types'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY);
$validationFields['value_sizes'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY);
$validationFields['value_show'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string', null, FILTER_REQUIRE_ARRAY);
$validationFields['hattr'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string', null, FILTER_REQUIRE_ARRAY);
// Captcha stuff
if (erLhcoreClassModelChatConfig::fetch('session_captcha')->current_value == 1) {
// Start session if required only
$currentUser = erLhcoreClassUser::instance();
$hashCaptcha = isset($_SESSION[$_SERVER['REMOTE_ADDR']]['form']) ? $_SESSION[$_SERVER['REMOTE_ADDR']]['form'] : null;
$nameField = 'captcha_' . $hashCaptcha;
$validationFields[$nameField] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string');
} else {
$nameField = 'captcha_' . sha1(erLhcoreClassIPDetect::getIP() . $_POST['tscaptcha'] . erConfigClassLhConfig::getInstance()->getSetting('site', 'secrethash'));
$validationFields[$nameField] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string');
}
// Custom start chat fields
$validationFields['value_items_admin'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY);
$validationFields['via_hidden'] = new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY);
$form = new ezcInputForm(INPUT_POST, $validationFields);
$Errors = array();
if (erLhcoreClassModelChatBlockedUser::getCount(array('filter' => array('ip' => erLhcoreClassIPDetect::getIP()))) > 0) {
$Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat', 'You do not have permission to chat! Please contact site owner.');
}
/**
* IP Ranges block
* */
$ignorable_ip = erLhcoreClassModelChatConfig::fetch('banned_ip_range')->current_value;
if ($ignorable_ip != '' && erLhcoreClassIPDetect::isIgnored(erLhcoreClassIPDetect::getIP(), explode(',', $ignorable_ip))) {
$Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat', 'You do not have permission to chat! Please contact site owner.');
}
if (erLhcoreClassModelChatConfig::fetch('session_captcha')->current_value == 1) {
if (!$form->hasValidData($nameField) || $form->{$nameField} == '' || $form->{$nameField} < time() - 600 || $hashCaptcha != sha1($_SERVER['REMOTE_ADDR'] . $form->{$nameField} . erConfigClassLhConfig::getInstance()->getSetting('site', 'secrethash'))) {
$Errors['captcha'] = erTranslationClassLhTranslation::getInstance()->getTranslation("chat/startchat", "Your request was not processed as expected - but don't worry it was not your fault. Please re-submit your request. If you experience the same issue you will need to contact us via other means.");
}
} else {
// Captcha validation
if (!$form->hasValidData($nameField) || $form->{$nameField} == '' || $form->{$nameField} < time() - 600) {
$Errors['captcha'] = erTranslationClassLhTranslation::getInstance()->getTranslation("chat/startchat", "Your request was not processed as expected - but don't worry it was not your fault. Please re-submit your request. If you experience the same issue you will need to contact us via other means.");
}
}
if (isset($validationFields['Username'])) {
if (!$form->hasValidData('Username') || $form->Username == '' && ($start_data_fields['name_require_option'] == 'required' && !isset($additionalParams['offline']) || isset($additionalParams['offline']) && isset($start_data_fields['offline_name_require_option']) && $start_data_fields['offline_name_require_option'] == 'required')) {
$Errors['nick'] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat', 'Please enter your name');
} elseif ($form->hasValidData('Username')) {
$chat->nick = $inputForm->username = $form->Username;
}
if ($form->hasValidData('Username') && $form->Username != '' && strlen($form->Username) > 50) {
$Errors['nick'] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/startchat', 'Maximum 50 characters');
}
}
if (isset($validationFields['Email'])) {
if (!$form->hasValidData('Email') && $start_data_fields['email_require_option'] == 'required' || !$form->hasValidData('Email') && isset($additionalParams['offline'])) {
//.........这里部分代码省略.........
开发者ID:yhchiu,项目名称:livehelperchat,代码行数:101,代码来源:lhchatvalidator.php
示例18: step4
function step4()
{
$cfgSite = erConfigClassLhConfig::getInstance();
$cfgSite->save();
$msg = "Installation is complete. You can start by adding users and departments";
syslog(LOG_DEBUG, $msg);
}
开发者ID:detain,项目名称:livehelperchat,代码行数:7,代码来源:install.php
示例19: fetch
/**
* Open, parse, and return the template file.
*
* @param $file string the template file name
*/
function fetch($fileTemplate = null)
{
$instance = erLhcoreClassSystem::instance();
$port = isset($_SERVER['SERVER_PORT']) ? $_SERVER['SERVER_PORT'] : 80;
if (!$fileTemplate) {
$fileTemplate = $this->file;
}
if ($this->cacheEnabled == true && key_exists(md5($fileTemplate . $instance->WWWDirLang . $instance->Language . $port), $this->cacheTemplates)) {
try {
return $this->fetchExecute($this->cacheTemplates[md5($fileTemplate . $instance->WWWDirLang . $instance->Language . $port)]);
} catch (Exception $e) {
}
}
$cfg = erConfigClassLhConfig::getInstance();
$file = erLhcoreClassDesign::designtpl($fileTemplate);
if ($this->templatecompile == true) {
$contentFile = php_strip_whitespace($file);
// Compile templates - 3 level of inclusions
for ($i = 0; $i < 9; $i++) {
$Matches = array();
preg_match_all('/<\\?php(\\s*)include_once\\(erLhcoreClassDesign::designtpl\\(\'([a-zA-Z0-9-\\.-\\/\\_]+)\'\\)\\)(.*?)\\?\\>/i', $contentFile, $Matches);
foreach ($Matches[2] as $key => $Match) {
$contentFile = str_replace($Matches[0][$key], php_strip_whitespace(erLhcoreClassDesign::designtpl($Match)), $contentFile);
}
//Compile templates inclusions first level.
$Matches = array();
preg_match_all('/<\\?php(\\s*)include\\(erLhcoreClassDesign::designtpl\\(\'([a-zA-Z0-9-\\.-\\/\\_]+)\'\\)\\)(.*?)\\?\\>/i', $contentFile, $Matches);
foreach ($Matches[2] as $key => $Match) {
$contentFile = str_replace($Matches[0][$key], php_strip_whitespace(erLhcoreClassDesign::designtpl($Match)), $contentFile);
}
}
//Compile image css paths. Etc..
$Matches = array();
preg_match_all('/<\\?php echo erLhcoreClassDesign::design\\(\'([a-zA-Z0-9-\\.-\\/\\_]+)\'\\)(.*?)\\?\\>/i', $contentFile, $Matches);
foreach ($Matches[1] as $key => $Match) {
$contentFile = str_replace($Matches[0][$key], erLhcoreClassDesign::design($Match), $contentFile);
}
//Compile translations, pure translations
$Matches = array();
preg_match_all('/<\\?php echo erTranslationClassLhTranslation::getInstance\\(\\)->getTranslation\\(\'(.*?)\',\'(.*?)\'\\)(.*?)\\?\\>/i', $contentFile, $Matches);
foreach ($Matches[1] as $key => $TranslateContent) {
$contentFile = str_replace($Matches[0][$key], erTranslationClassLhTranslation::getInstance()->getTranslation($TranslateContent, $Matches[2][$key]), $contentFile);
}
//Translations used in logical conditions
$Matches = array();
preg_match_all('/erTranslationClassLhTranslation::getInstance\\(\\)->getTranslation\\(\'(.*?)\',\'(.*?)\'\\)/i', $contentFile, $Matches);
foreach ($Matches[1] as $key => $TranslateContent) {
$contentFile = str_replace($Matches[0][$key], '\'' . erTranslationClassLhTranslation::getInstance()->getTranslation($TranslateContent, $Matches[2][$key]) . '\'', $contentFile);
}
// Compile url addresses
$Matches = array();
preg_match_all('/<\\?php echo erLhcoreClassDesign::baseurl\\((.*?)\\)(.*?)\\?\\>/i', $contentFile, $Matches);
foreach ($Matches[1] as $key => $UrlAddress) {
$contentFile = str_replace($Matches[0][$key], erLhcoreClassDesign::baseurl(trim($UrlAddress, '\'')), $contentFile);
}
// Compile url direct addresses
$Matches = array();
preg_match_all('/<\\?php echo erLhcoreClassDesign::baseurldirect\\((.*?)\\)(.*?)\\?\\>/i', $contentFile, $Matches);
foreach ($Matches[1] as $key => $UrlAddress) {
$contentFile = str_replace($Matches[0][$key], erLhcoreClassDesign::baseurldirect(trim($UrlAddress, '\'')), $contentFile);
}
// Compile url direct addresses
$Matches = array();
preg_match_all('/<\\?php echo erLhcoreClassDesign::baseurlsite\\(\\)(.*?)\\?\\>/i', $contentFile, $Matches);
foreach ($Matches[1] as $key => $UrlAddress) {
$contentFile = str_replace($Matches[0][$key], erLhcoreClassDesign::baseurlsite(), $contentFile);
}
// Compile css url addresses
$Matches = array();
preg_match_all('/<\\?php echo erLhcoreClassDesign::designCSS\\((.*?)\\)(.*?)\\?\\>/i', $contentFile, $Matches);
foreach ($Matches[1] as $key => $UrlAddress) {
$contentFile = str_replace($Matches[0][$key], erLhcoreClassDesign::designCSS(trim($UrlAddress, '\'')), $contentFile);
}
// Compile css url addresses
$Matches = array();
preg_match_all('/<\\?php echo erLhcoreClassDesign::designJS\\((.*?)\\)(.*?)\\?\\>/i', $contentFile, $Matches);
foreach ($Matches[1] as $key => $UrlAddress) {
$contentFile = str_replace($Matches[0][$key], erLhcoreClassDesign::designJS(trim($UrlAddress, '\'')), $contentFile);
}
// Compile url addresses in logical operations
$Matches = array();
preg_match_all('/erLhcoreClassDesign::baseurl\\((.*?)\\)/i', $contentFile, $Matches);
foreach ($Matches[1] as $key => $UrlAddress) {
$contentFile = str_replace($Matches[0][$key], '\'' . erLhcoreClassDesign::baseurl(trim($UrlAddress, '\'')) . '\'', $contentFile);
}
// Compile url addresses in logical operations
$Matches = array();
preg_match_all('/erLhcoreClassDesign::baseurldirect\\((.*?)\\)/i', $contentFile, $Matches);
foreach ($Matches[1] as $key => $UrlAddress) {
$contentFile = str_replace($Matches[0][$key], '\'' . erLhcoreClassDesign::baseurldirect(trim($UrlAddress, '\'')) . '\'', $contentFile);
}
// Compile config settings, direct output
$Matches = array();
preg_match_all('/<\\?php echo erConfigClassLhConfig::getInstance\\(\\)->getSetting\\((\\s?)\'([a-zA-Z0-9-\\.-\\/\\_]+)\'(\\s?),(\\s?)\'([a-zA-Z0-9-\\.-\\/\\_]+)\'(\\s?)\\)(.*?)\\?\\>/i', $contentFile, $Matches);
foreach ($Matches[1] as $key => $UrlAddress) {
//.........这里部分代码省略.........
开发者ID:mdb-webdev,项目名称:livehelperchat,代码行数:101,代码来源:tpl.php
示例20: setupSMTP
public function setupSMTP($params)
{
$params['phpmailer']->Sender = erConfigClassLhConfig::getInstance()->getSetting('site', 'sender_mail');
$params['phpmailer']->From = erConfigClassLhConfig::getInstance()->getSetting('site', 'seller_mail');
$params['phpmailer']->FromName = erConfigClassLhConfig::getInstance()->getSetting('site', 'seller_title');
return array('status' => erLhcoreClassChatEvent
|
请发表评论