本文整理汇总了PHP中erLhcoreClassModule::redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassModule::redirect方法的具体用法?PHP erLhcoreClassModule::redirect怎么用?PHP erLhcoreClassModule::redirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类erLhcoreClassModule
的用法示例。
在下文中一共展示了erLhcoreClassModule::redirect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: paidChatWorkflow
/**
* Executes paid chat workflow
* */
public static function paidChatWorkflow($params)
{
$paidchatData = erLhcoreClassModelChatConfig::fetch('paidchat_data');
$data = (array) $paidchatData->data;
$mode = isset($params['mode']) ? $params['mode'] : 'chatwidgetchat';
if (isset($data['paidchat_enabled']) && $data['paidchat_enabled'] == 1) {
$secretHash = $data['paidchat_secret_hash'];
$hashVerify = sha1($secretHash . sha1($secretHash . $params['uparams']['phash']));
if ($hashVerify == $params['uparams']['pvhash']) {
$chatExisting = erLhcoreClassModelChatPaid::findOne(array('filter' => array('hash' => $params['uparams']['phash'])));
if ($chatExisting instanceof erLhcoreClassModelChatPaid) {
if ($chatExisting->chat_id > 0 && $chatExisting->chat instanceof erLhcoreClassModelChat) {
if ($chatExisting->chat->status == erLhcoreClassModelChat::STATUS_CLOSED_CHAT) {
if (isset($data['paidchat_read_denied']) && $data['paidchat_read_denied'] == 1) {
erLhcoreClassModule::redirect('paidchat/expiredchat', '/' . $chatExisting->id . '/(mode)/widget' . $params['append_mode'] . '/(pchat)/' . $chatExisting->id);
} else {
erLhcoreClassModule::redirect('chat/' . $mode, '/' . $chatExisting->chat->id . '/' . $chatExisting->chat->hash . '/(mode)/widget' . $params['append_mode'] . '/(pchat)/' . $chatExisting->id);
}
exit;
} else {
erLhcoreClassModule::redirect('chat/' . $mode, '/' . $chatExisting->chat->id . '/' . $chatExisting->chat->hash . '/(mode)/widget' . $params['append_mode'] . '/(pchat)/' . $chatExisting->id);
exit;
}
} elseif ($chatExisting->chat_id > 0) {
erLhcoreClassModule::redirect('paidchat/removedpaidchat');
exit;
}
} else {
return array('need_store' => true, 'hash' => $params['uparams']['phash']);
}
} else {
erLhcoreClassModule::redirect('paidchat/invalidhash', '/' . $chatExisting->chat->id . '/' . $chatExisting->chat->hash);
exit;
}
}
return array('need_store' => false);
}
示例2:
if (count($Errors) == 0) {
if (method_exists($objectData, 'saveThis')) {
$objectData->saveThis();
} else {
erLhcoreClassAbstract::getSession()->save($objectData);
}
if (method_exists($objectData, 'synchronizeAttribute')) {
$objectData->synchronizeAttribute();
erLhcoreClassAbstract::getSession()->update($objectData);
}
if (isset($_POST['SaveClient'])) {
erLhcoreClassModule::redirect('abstract/list', '/' . $Params['user_parameters']['identifier']);
exit;
}
if (isset($_POST['UpdateClient'])) {
erLhcoreClassModule::redirect('abstract/edit', '/' . $Params['user_parameters']['identifier'] . '/' . $objectData->id);
exit;
}
} else {
$tpl->set('errors', $Errors);
}
}
$tpl->set('object', $objectData);
$tpl->set('object_trans', $object_trans);
if (method_exists($objectData, 'customForm')) {
$tpl->set('custom_form', $objectData->customForm());
}
$tpl->set('identifier', $Params['user_parameters']['identifier']);
$Result['content'] = $tpl->fetch();
if (method_exists($objectData, 'dependCss')) {
$Result['additional_header_css'] = $objectData->dependCss();
示例3: array
<?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')) {
示例4: array
<?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']);
示例5: array
$Errors[] = 'Please enter valid date';
}
if ($form->hasValidData('AttrInt1')) {
$Instance->attr_int_1 = $form->AttrInt1;
}
if ($form->hasValidData('AttrInt2')) {
$Instance->attr_int_2 = $form->AttrInt2;
}
if ($form->hasValidData('AttrInt3')) {
$Instance->attr_int_3 = $form->AttrInt3;
}
if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
erLhcoreClassModule::redirect('instance/list');
exit;
}
if (count($Errors) == 0) {
$Instance->saveThis();
if (isset($_POST['Save_departament'])) {
erLhcoreClassModule::redirect('instance/list');
exit;
} else {
$tpl->set('updated', true);
}
} else {
$tpl->set('errors', $Errors);
}
}
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('instance.editinstance', array('instance' => &$Instance));
$tpl->set('instance', $Instance);
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('system/configuration'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('department/edit', 'System configuration')), array('url' => erLhcoreClassDesign::baseurl('instance/list'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Instances')), array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('instance/edit', 'Edit instance') . ' - ' . $Instance->address));
示例6: rawurlencode
$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 {
erLhcoreClassModule::redirect();
exit;
}
}
}
$pagelayout = erConfigClassLhConfig::getInstance()->getOverrideValue('site', 'login_pagelayout');
if ($pagelayout != null) {
$Result['pagelayout'] = 'login';
}
$Result['content'] = $tpl->fetch();
示例7: time
erLhcoreClassChat::getSession()->save($msg);
}
}
}
// Set chat attributes for transfer workflow logic
if ($chat->department !== false && $chat->department->department_transfer_id > 0) {
$chat->transfer_if_na = 1;
$chat->transfer_timeout_ts = time();
$chat->transfer_timeout_ac = $chat->department->transfer_timeout;
}
$chat->last_msg_id = $msg->id;
$chat->last_user_msg_time = time();
$chat->saveThis();
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.chat_started', array('chat' => &$chat));
// Redirect user
erLhcoreClassModule::redirect('chat/chatwidgetchat/' . $chat->id . '/' . $chat->hash . $modeAppendTheme . '/(cstarted)/chat_started_by_invitation_cb');
exit;
} else {
$tpl->set('errors', $Errors);
}
}
// User this only if not post
if (!ezcInputForm::hasPostData()) {
$definition = array('name' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY), 'value' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY), 'type' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string', null, FILTER_REQUIRE_ARRAY), 'size' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string', null, FILTER_REQUIRE_ARRAY), 'req' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string', null, FILTER_REQUIRE_ARRAY), 'sh' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string', null, FILTER_REQUIRE_ARRAY), 'hattr' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string', null, FILTER_REQUIRE_ARRAY));
$form = new ezcInputForm(INPUT_GET, $definition);
if ($form->hasValidData('name') && !empty($form->name)) {
$inputData->name_items = $form->name;
}
if ($form->hasValidData('sh') && !empty($form->sh)) {
$inputData->value_show = $form->sh;
}
示例8: die
$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);
$Result['content'] = $tpl->fetch();
示例9: die
}
if (count($Errors) == 0) {
$cannedMessage->msg = $form->Message;
$cannedMessage->user_id = $UserData->id;
$cannedMessage->saveThis();
$tpl->set('updated_canned', true);
} else {
$tpl->set('errors_canned', $Errors);
}
}
/**
* Delete canned message
* */
if (is_numeric($Params['user_parameters_unordered']['msg']) && $Params['user_parameters_unordered']['action'] == 'delete') {
if (!$currentUser->validateCSFRToken($Params['user_parameters_unordered']['csfr'])) {
die('Invalid CSRF Token');
exit;
}
try {
$cannedToDelete = erLhcoreClassModelCannedMsg::fetch($Params['user_parameters_unordered']['msg']);
if ($cannedToDelete->user_id == $UserData->id) {
$cannedToDelete->removeThis();
}
} catch (Exception $e) {
}
erLhcoreClassModule::redirect('user/account', '#canned');
exit;
}
$tpl->set('canned_msg', $cannedMessage);
}
$Result['content'] = $tpl->fetch();
示例10: array
<?php
$tpl = erLhcoreClassTemplate::getInstance('lhdocshare/edit.tpl.php');
$docShare = erLhcoreClassModelDocShare::fetch($Params['user_parameters']['id']);
if (isset($_POST['Update'])) {
if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
erLhcoreClassModule::redirect();
exit;
}
$Errors = erLhcoreClassDocShare::validateDocShare($docShare);
if (count($Errors) == 0) {
$docShare->saveThis();
erLhcoreClassDocShare::makeConversion($docShare);
$tpl->set('updated', true);
} else {
$tpl->set('errors', $Errors);
}
}
if (isset($_POST['Cancel'])) {
erLhcoreClassModule::redirect('docshare/list');
exit;
}
$tpl->set('docshare', $docShare);
$docSharer = erLhcoreClassModelChatConfig::fetch('doc_sharer');
$data = (array) $docSharer->data;
$tpl->set('share_data', $data);
$Result['content'] = $tpl->fetch();
$Result['path'] = array(array('url' => erLhcoreClassDesign::baseurl('docshare/index'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('docshare/index', 'Documents sharer')), array('url' => erLhcoreClassDesign::baseurl('docshare/list'), 'title' => erTranslationClassLhTranslation::getInstance()->getTranslation('docshare/list', 'Documents list')), array('title' => erTranslationClassLhTranslation::getInstance()->getTranslation('docshare/edit', 'Document edit')));
示例11: array
erLhcoreClassChat::getSession()->save($msg);
if ($chat->last_msg_id < $msg->id) {
$chat->last_msg_id = $msg->id;
}
}
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.auto_responder_triggered', array('chat' => &$chat));
$chat->saveThis();
}
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.chat_started', array('chat' => &$chat, 'msg' => $messageInitial));
erLhcoreClassChat::updateDepartmentStats($chat->department);
// Paid chat settings
if (isset($paidChatSettings)) {
erLhcoreClassChatPaid::processPaidChatWorkflow(array('chat' => $chat, 'paid_chat_params' => $paidChatSettings));
}
// Redirect user
erLhcoreClassModule::redirect('chat/chat/' . $chat->id . '/' . $chat->hash . $themeAppend);
exit;
}
} else {
// Show errors only if user is not switching form mode
if ($Params['user_parameters_unordered']['switchform'] != 'true' && !isset($_POST['switchLang'])) {
$tpl->set('errors', $Errors);
}
}
}
$tpl->set('start_data_fields', $startDataFields);
$definition = array('name' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY), 'value' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY), 'type' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string', null, FILTER_REQUIRE_ARRAY), 'size' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string', null, FILTER_REQUIRE_ARRAY), 'req' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string', null, FILTER_REQUIRE_ARRAY), 'sh' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string', null, FILTER_REQUIRE_ARRAY), 'hattr' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string', null, FILTER_REQUIRE_ARRAY), 'value_items_admin' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY), 'via_hidden' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY), 'encattr' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY), 'via_encrypted' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY));
$form = new ezcInputForm(INPUT_GET, $definition);
if ($form->hasValidData('name') && !empty($form->name)) {
$inputData->name_items = $form->name;
}
示例12: die
<?php
if (!$currentUser->validateCSFRToken($Params['user_parameters_unordered']['csfr'])) {
die('Invalid CSFR Token');
exit;
}
$question = erLhcoreClassQuestionary::getSession()->load('erLhcoreClassModelQuestion', $Params['user_parameters']['id']);
$question->removeThis();
erLhcoreClassModule::redirect('questionary/list');
exit;
示例13: is_numeric
$inputData->priority = is_numeric($Params['user_parameters_unordered']['priority']) ? (int) $Params['user_parameters_unordered']['priority'] : false;
// If chat was started based on key up, we do not need to store a message
// because user is still typing it. We start chat in the background just.
$inputData->key_up_started = isset($_POST['keyUpStarted']) && $_POST['keyUpStarted'] == 1;
// Perhaps it's direct argument
if ((string) $Params['user_parameters_unordered']['hash_resume'] != '') {
CSCacheAPC::getMem()->setSession('chat_hash_widget_resume', (string) $Params['user_parameters_unordered']['hash_resume'], true, true);
$inputData->hash_resume = (string) $Params['user_parameters_unordered']['hash_resume'];
}
if ((string) $Params['user_parameters_unordered']['vid'] != '') {
$inputData->vid = (string) $Params['user_parameters_unordered']['vid'];
}
// Reopen chat automatically if possible
if (erLhcoreClassModelChatConfig::fetch('automatically_reopen_chat')->current_value == 1 && erLhcoreClassModelChatConfig::fetch('reopen_chat_enabled')->current_value == 1 && ($reopenData = erLhcoreClassChat::canReopenDirectly(array('reopen_closed' => erLhcoreClassModelChatConfig::fetch('allow_reopen_closed')->current_value))) !== false) {
$sound = is_numeric($Params['user_parameters_unordered']['sound']) ? '/(sound)/' . $Params['user_parameters_unordered']['sound'] : '';
erLhcoreClassModule::redirect('chat/reopen', '/' . $reopenData['id'] . '/' . $reopenData['hash'] . '/(mode)/widget' . $modeAppend . $modeAppendTheme . $sound);
exit;
}
$chat = new erLhcoreClassModelChat();
// Assign department instantly
if ($inputData->departament_id > 0) {
$chat->dep_id = $inputData->departament_id;
$tpl->set('department', $chat->dep_id);
} else {
$tpl->set('department', false);
}
// Leave a message functionality
$leaveamessage = (string) $Params['user_parameters_unordered']['leaveamessage'] == 'true' || isset($startDataFields['force_leave_a_message']) && $startDataFields['force_leave_a_message'] == true ? true : false;
$tpl->set('forceoffline', false);
$additionalParams = array();
if ((string) $Params['user_parameters_unordered']['offline'] == 'true' && $leaveamessage == true) {
示例14: die
<?php
if (!$currentUser->validateCSFRToken($Params['user_parameters_unordered']['csfr'])) {
die('Invalid CSFR Token');
exit;
}
$question = erLhcoreClassModelQuestionOption::fetch((int) $Params['user_parameters']['id']);
$question->removeThis();
erLhcoreClassModule::redirect('questionary/edit', "/{$question->question_id}/(tab)/voting");
exit;
示例15: serialize
$geoLocationData->value = serialize($dataLocation);
$geoLocationData->saveThis();
exit;
}
if (isset($_POST['StoreGeoIPConfiguration'])) {
$definition = array('UseGeoIP' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'GeoDetectionEnabled' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'ServerVariableGEOIP_COUNTRY_CODE' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'ServerVariableGEOIP_COUNTRY_NAME' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'ServerVariableGEOIP_CITY' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'ServerVariableGEOIP_LATITUDE' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'ServerVariableGEOIP_REGION' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'ServerVariableGEOIP_LONGITUDE' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'locatorhqAPIKey' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'ipinfodbAPIKey' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'locatorhqUsername' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'locatorhqIP' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'MaxMindDetectionType' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'CityGeoLocation' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'));
$Errors = array();
$form = new ezcInputForm(INPUT_POST, $definition);
$Errors = array();
if ($form->hasValidData('GeoDetectionEnabled') && $form->GeoDetectionEnabled == true) {
$data['geo_detection_enabled'] = 1;
} else {
$data['geo_detection_enabled'] = 0;
}
if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
erLhcoreClassModule::redirect('chat/geoconfiguration');
exit;
}
if ($data['geo_detection_enabled'] == 1) {
if ($form->hasValidData('UseGeoIP')) {
if ($form->UseGeoIP == 'mod_geoip2') {
$data['geo_service_identifier'] = 'mod_geoip2';
if ($form->hasValidData('ServerVariableGEOIP_COUNTRY_CODE') && $form->ServerVariableGEOIP_COUNTRY_CODE != '' && isset($_SERVER[$form->ServerVariableGEOIP_COUNTRY_CODE])) {
$data['mod_geo_ip_country_code'] = $form->ServerVariableGEOIP_COUNTRY_CODE;
} else {
$Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'Country code variable does not exist!');
}
if ($form->hasValidData('ServerVariableGEOIP_COUNTRY_NAME') && $form->ServerVariableGEOIP_COUNTRY_NAME != '' && isset($_SERVER[$form->ServerVariableGEOIP_COUNTRY_NAME])) {
$data['mod_geo_ip_country_name'] = $form->ServerVariableGEOIP_COUNTRY_NAME;
} else {
$Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('chat/onlineusers', 'Country name variable does not exist!');