• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP erLhcoreClassModelUserSetting类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中erLhcoreClassModelUserSetting的典型用法代码示例。如果您正苦于以下问题:PHP erLhcoreClassModelUserSetting类的具体用法?PHP erLhcoreClassModelUserSetting怎么用?PHP erLhcoreClassModelUserSetting使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了erLhcoreClassModelUserSetting类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getDirLanguage

 /**
  * This function should be used then value can be override by siteAccess
  * or user language has influence to returned value
  *
  * */
 public function getDirLanguage($attribute = 'dir_language')
 {
     $value = null;
     if ($this->hasSetting('site', $attribute)) {
         $value = $this->getSetting('site', $attribute);
     }
     $siteAccess = erLhcoreClassSystem::instance()->SiteAccess;
     if ($siteAccess == 'site_admin') {
         $valueOverride = $this->getSetting('site_access_options', $siteAccess);
         if (key_exists($attribute, $valueOverride)) {
             // User has not changed default site access language. So just return current value.
             if (erLhcoreClassModelUserSetting::getSetting('user_language', $valueOverride['locale']) == $valueOverride['locale']) {
                 return $valueOverride[$attribute];
             } else {
                 // User has changed default siteaccess language, we need to check does ltr or rtl matches
                 foreach ($this->getSetting('site', 'available_site_access') as $siteaccess) {
                     // Loop untill we find our locate siteaccess and check it's language direction
                     $siteAccessOptions = $this->getSetting('site_access_options', $siteaccess);
                     if ($siteAccessOptions['locale'] == erLhcoreClassModelUserSetting::getSetting('user_language', $valueOverride['locale'])) {
                         return $siteAccessOptions[$attribute];
                     }
                 }
             }
         }
     } else {
         $value = $this->getOverrideValue('site', $attribute);
     }
     return $value;
 }
开发者ID:detain,项目名称:livehelperchat,代码行数:34,代码来源:lhconfig.php


示例2: getSetting

 public static function getSetting($identifier, $default_value, $user_id = false, $noSession = false)
 {
     if ($user_id == false) {
         $currentUser = erLhcoreClassUser::instance();
         if ($currentUser->isLogged()) {
             $user_id = $currentUser->getUserID();
         }
     }
     if ($user_id !== false) {
         $value = CSCacheAPC::getMem()->getSession('settings_user_id_' . $user_id . '_' . $identifier, true);
         if ($value === false && ($value = CSCacheAPC::getMem()->restore('settings_user_id_' . $user_id . '_' . $identifier)) === false) {
             $value = $default_value;
             $list = self::getList(array('filter' => array('user_id' => $user_id, 'identifier' => $identifier)));
             if (count($list) > 0) {
                 $item = array_shift($list);
                 $value = $item->value;
             } else {
                 $item = new erLhcoreClassModelUserSetting();
                 $item->value = $default_value;
                 $item->user_id = $user_id;
                 $item->identifier = $identifier;
                 $item->saveThis();
             }
             CSCacheAPC::getMem()->store('settings_user_id_' . $user_id . '_' . $identifier, $value);
             CSCacheAPC::getMem()->setSession('settings_user_id_' . $user_id . '_' . $identifier, $value, true);
         }
     } else {
         $value = $default_value;
         if ($noSession === false && ($value = CSCacheAPC::getMem()->getSession('anonymous_' . $identifier)) === false) {
             $value = $default_value;
             CSCacheAPC::getMem()->setSession('anonymous_' . $identifier, $value);
         }
     }
     return $value;
 }
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:35,代码来源:erlhcoreclassmodelusersetting.php


示例3: loginBySSO

 public static function loginBySSO($params)
 {
     $settings = (include 'extension/singlesignon/settings/settings.ini.php');
     // Try to find operator by our logins
     if (isset($params[$settings['attr_map']['username']][0])) {
         $username = $params[$settings['attr_map']['username']][0];
         if (erLhcoreClassModelUser::userExists($username)) {
             $user = array_shift(erLhcoreClassModelUser::getUserList(array('limit' => 1, 'filter' => array('username'))));
             erLhcoreClassUser::instance()->setLoggedUser($user->id);
         } else {
             $user = new erLhcoreClassModelUser();
             foreach ($settings['attr_map'] as $attr => $ssoAttr) {
                 $user->{$attr} = $params[$settings['attr_map'][$attr]][0];
             }
             foreach ($settings['default_attributes'] as $attr => $value) {
                 $user->{$attr} = $value;
             }
             $user->password = sha1(erLhcoreClassModelForgotPassword::randomPassword() . rand(0, 1000) . microtime());
             $user->saveThis();
             // Set that users sees all pending chats
             erLhcoreClassModelUserSetting::setSetting('show_all_pending', 1, $user->id);
             // Set default departments
             erLhcoreClassUserDep::addUserDepartaments($settings['default_departments'], $user->id, $user);
             // Cleanup if previously existed
             erLhcoreClassModelGroupUser::removeUserFromGroups($user->id);
             // Assign user to default group
             foreach ($settings['default_user_groups'] as $group_id) {
                 $groupUser = new erLhcoreClassModelGroupUser();
                 $groupUser->group_id = $group_id;
                 $groupUser->user_id = $user->id;
                 $groupUser->saveThis();
             }
             erLhcoreClassUser::instance()->setLoggedUser($user->id);
         }
         return true;
     } else {
         throw new Exception('Username field not found');
     }
 }
开发者ID:creativeprogramming,项目名称:livehelperchat-extensions,代码行数:39,代码来源:lhsinglesingon.php


示例4: getSpeechInstance

 public static function getSpeechInstance(erLhcoreClassModelChat $chat)
 {
     $chatLanguageSession = null;
     $chatSpeech = erLhcoreClassModelSpeechChatLanguage::getList(array('filter' => array('chat_id' => $chat->id)));
     if (empty($chatSpeech)) {
         $chatLanguageSession = new erLhcoreClassModelSpeechChatLanguage();
         $chatLanguageSession->chat_id = $chat->id;
         $speechUserLanguage = erLhcoreClassModelUserSetting::getSetting('speech_language', '');
         $speechUserDialect = erLhcoreClassModelUserSetting::getSetting('speech_dialect', '');
         if ($speechUserLanguage != '' && $speechUserDialect != '') {
             $chatLanguageSession->dialect = $speechUserDialect;
             $chatLanguageSession->language_id = $speechUserLanguage;
         } else {
             $speechData = erLhcoreClassModelChatConfig::fetch('speech_data');
             $data = (array) $speechData->data;
             $chatLanguageSession->language_id = $data['language'];
             $chatLanguageSession->dialect = $data['dialect'];
         }
     } else {
         $chatLanguageSession = array_pop($chatSpeech);
     }
     return $chatLanguageSession;
 }
开发者ID:sirromas,项目名称:medical,代码行数:23,代码来源:lhspeech.php


示例5: catch

$modeAppend = '';
if ((string) $Params['user_parameters_unordered']['mode'] == 'embed') {
    $embedMode = true;
    $modeAppend = '/(mode)/embed';
}
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);
        $modeAppend .= '/(theme)/' . $theme->id;
    } catch (Exception $e) {
    }
}
if ($Params['user_parameters_unordered']['sound'] !== null && is_numeric($Params['user_parameters_unordered']['sound'])) {
    erLhcoreClassModelUserSetting::setSetting('chat_message', (int) $Params['user_parameters_unordered']['sound'] == 1 ? 1 : 0);
}
if ($Params['user_parameters_unordered']['cstarted'] !== null && $Params['user_parameters_unordered']['cstarted'] != '') {
    $Result['parent_messages'][] = 'lh_callback:' . (string) strip_tags($Params['user_parameters_unordered']['cstarted']);
}
try {
    $chat = erLhcoreClassChat::getSession()->load('erLhcoreClassModelChat', $Params['user_parameters']['chat_id']);
    erLhcoreClassChat::setTimeZoneByChat($chat);
    if ($chat->hash == $Params['user_parameters']['hash']) {
        $tpl->set('chat_id', $Params['user_parameters']['chat_id']);
        $tpl->set('hash', $Params['user_parameters']['hash']);
        $tpl->set('chat', $chat);
        $tpl->set('chat_widget_mode', true);
        $tpl->set('chat_embed_mode', $embedMode);
        $tpl->set('survey', is_numeric($Params['user_parameters_unordered']['survey']) ? (int) $Params['user_parameters_unordered']['survey'] : false);
        $Result['chat'] = $chat;
开发者ID:Justmfree,项目名称:livehelperchat,代码行数:31,代码来源:chatwidgetchat.php


示例6: explode

        $canListOnlineUsersAll = $currentUser->hasAccessTo('lhuser', 'userlistonlineall');
    }
    $pendingTabEnabled = erLhcoreClassModelUserSetting::getSetting('enable_pending_list', 1);
    $activeTabEnabled = erLhcoreClassModelUserSetting::getSetting('enable_active_list', 1);
    $closedTabEnabled = erLhcoreClassModelUserSetting::getSetting('enable_close_list', 0);
    $unreadTabEnabled = erLhcoreClassModelUserSetting::getSetting('enable_unread_list', 1);
    $frontTabsOrder = explode(',', 'dashboard,online_users,online_map');
    $browserNotification = (int) erLhcoreClassModelUserSetting::getSetting('new_user_bn', (int) 0);
    $soundUserNotification = (int) erLhcoreClassModelUserSetting::getSetting('new_user_sound', (int) 0);
    $onlineDepartment = (int) erLhcoreClassModelUserSetting::getSetting('o_department', (int) 0);
    $ouserTimeout = (int) erLhcoreClassModelUserSetting::getSetting('ouser_timeout', (int) 3600);
    $oupdTimeout = (int) erLhcoreClassModelUserSetting::getSetting('oupdate_timeout', (int) 10);
    $omaxRows = (int) erLhcoreClassModelUserSetting::getSetting('omax_rows', (int) 50);
    $ogroupBy = (string) erLhcoreClassModelUserSetting::getSetting('ogroup_by', 'none');
    $omapDepartment = (int) erLhcoreClassModelUserSetting::getSetting('omap_depid', 0);
    $omapMarkerTimeout = (int) erLhcoreClassModelUserSetting::getSetting('omap_mtimeout', 30);
    $onlineCheck = (int) '0';
    if ($onlineCheck > 0) {
        $onlineCheck = ",online_user:(ou.last_check_time_ago < " . ($onlineCheck + 3) . ")";
    } else {
        $onlineCheck = '';
    }
    ?>
<div ng-controller="OnlineCtrl as online" ng-init='groupByField = <?php 
    echo json_encode($ogroupBy);
    ?>
;online.maxRows=<?php 
    echo (int) $omaxRows;
    ?>
;online.updateTimeout=<?php 
    echo (int) $oupdTimeout;
开发者ID:niravpatel2008,项目名称:north-american-nemesis-new,代码行数:31,代码来源:5d0370c4f43d45420ba48ede3ad4b44f.php


示例7: array

    $tab = 'generalsettings';
}
if (isset($_POST['changeSiteAccess'])) {
    $input->siteaccess = $_POST['siteaccess'];
}
if (isset($_POST['StoreUserSettingsAction'])) {
    $definition = array('language' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'));
    if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
        erLhcoreClassModule::redirect('system/languages');
        exit;
    }
    $Errors = array();
    $form = new ezcInputForm(INPUT_POST, $definition);
    $Errors = array();
    if ($form->hasValidData('language') && !empty($form->language)) {
        erLhcoreClassModelUserSetting::setSetting('user_language', $form->language);
        // Redirect for change to take effect
        erLhcoreClassModule::redirect('system/languages', '/(updated)/true');
        exit;
    } else {
        $tpl->set('errors', array(erTranslationClassLhTranslation::getInstance()->getTranslation('system/languages', 'Please choose correct language')));
    }
}
if ($currentUser->hasAccessTo('lhsystem', 'configurelanguages')) {
    if (isset($_POST['StoreLanguageSettings'])) {
        $tab = 'generalsettings';
        $definition = array('siteaccess' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'language' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'theme' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'module' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'), 'view' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'string'));
        if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
            erLhcoreClassModule::redirect('system/languages');
            exit;
        }
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:31,代码来源:languages.php


示例8:

    $validateSpeechData = erLhcoreClassUserValidator::validateSpeech();
    erLhcoreClassModelUserSetting::setSetting('speech_language', $validateSpeechData['speech_language']);
    erLhcoreClassModelUserSetting::setSetting('speech_dialect', $validateSpeechData['speech_dialect']);
    $tpl->set('account_updated', 'done');
    $tpl->set('tab', 'tab_speech');
}
if (erLhcoreClassUser::instance()->hasAccessTo('lhuser', 'change_visibility_list') && isset($_POST['UpdateTabsSettings_account'])) {
    if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
        erLhcoreClassModule::redirect('user/account');
        exit;
    }
    $validateVisibilityListData = erLhcoreClassUserValidator::validateVisibilityList();
    erLhcoreClassModelUserSetting::setSetting('enable_pending_list', $validateVisibilityListData['enable_pending_list']);
    erLhcoreClassModelUserSetting::setSetting('enable_active_list', $validateVisibilityListData['enable_active_list']);
    erLhcoreClassModelUserSetting::setSetting('enable_close_list', $validateVisibilityListData['enable_close_list']);
    erLhcoreClassModelUserSetting::setSetting('enable_unread_list', $validateVisibilityListData['enable_unread_list']);
    $tpl->set('account_updated', 'done');
    $tpl->set('tab', 'tab_settings');
}
if (isset($_POST['Update'])) {
    if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
        erLhcoreClassModule::redirect('user/account');
        exit;
    }
    $Errors = erLhcoreClassUserValidator::validateAccount($UserData);
    if (isset($_POST['DeletePhoto'])) {
        $UserData->removeFile();
    }
    $userPhotoErrors = erLhcoreClassUserValidator::validateUserPhoto($UserData);
    if ($userPhotoErrors !== false) {
        $Errors = array_merge($Errors, $userPhotoErrors);
开发者ID:detain,项目名称:livehelperchat,代码行数:31,代码来源:account.php


示例9: session_write_close

$currentUser = erLhcoreClassUser::instance();
$onlineTimeout = (int) erLhcoreClassModelChatConfig::fetchCache('sync_sound_settings')->data['online_timeout'];
$canListOnlineUsers = false;
$canListOnlineUsersAll = false;
if (erLhcoreClassModelChatConfig::fetchCache('list_online_operators')->current_value == 1) {
    $canListOnlineUsers = $currentUser->hasAccessTo('lhuser', 'userlistonline');
    $canListOnlineUsersAll = $currentUser->hasAccessTo('lhuser', 'userlistonlineall');
}
// We do not need a session anymore
session_write_close();
$ReturnMessages = array();
$pendingTabEnabled = erLhcoreClassModelUserSetting::getSetting('enable_pending_list', 1);
$activeTabEnabled = erLhcoreClassModelUserSetting::getSetting('enable_active_list', 1);
$closedTabEnabled = erLhcoreClassModelUserSetting::getSetting('enable_close_list', 0);
$unreadTabEnabled = erLhcoreClassModelUserSetting::getSetting('enable_unread_list', 1);
$showAllPending = erLhcoreClassModelUserSetting::getSetting('show_all_pending', 1);
$showDepartmentsStats = $currentUser->hasAccessTo('lhuser', 'canseedepartmentstats');
if ($showDepartmentsStats == true) {
    /**
     * Departments stats
     * */
    $limitList = is_numeric($Params['user_parameters_unordered']['limitd']) ? (int) $Params['user_parameters_unordered']['limitd'] : 10;
    $filter = array('ignore_fields' => erLhcoreClassChat::$chatListIgnoreField);
    $filter['limit'] = $limitList;
    if (is_array($Params['user_parameters_unordered']['departmentd']) && !empty($Params['user_parameters_unordered']['departmentd'])) {
        erLhcoreClassChat::validateFilterIn($Params['user_parameters_unordered']['departmentd']);
        $filter['filterin']['id'] = $Params['user_parameters_unordered']['departmentd'];
    }
    $filter['sort'] = 'pending_chats_counter DESC';
    $departments = erLhcoreClassModelDepartament::getList($filter);
    erLhcoreClassChat::prefillGetAttributes($departments, array('id', 'name', 'pending_chats_counter', 'active_chats_counter'), array(), array('remove_all' => true));
开发者ID:kenjiro7,项目名称:livehelperchat,代码行数:31,代码来源:syncadmininterface.php


示例10: array

    } else {
        $tpl->set('errors', $Errors);
    }
}
if (isset($_POST['UpdatePending_account'])) {
    if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
        erLhcoreClassModule::redirect('user/account');
        exit;
    }
    $definition = array('showAllPendingEnabled' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean'));
    $form = new ezcInputForm(INPUT_POST, $definition);
    $Errors = array();
    if ($form->hasValidData('showAllPendingEnabled') && $form->showAllPendingEnabled == true) {
        erLhcoreClassModelUserSetting::setSetting('show_all_pending', 1, $UserData->id);
    } else {
        erLhcoreClassModelUserSetting::setSetting('show_all_pending', 0, $UserData->id);
    }
    $tpl->set('account_updated', 'done');
    $tpl->set('tab', 'tab_pending');
}
if (isset($_POST['UpdateDepartaments_account'])) {
    if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
        erLhcoreClassModule::redirect('user/userlist');
        exit;
    }
    $globalDepartament = array();
    if (isset($_POST['all_departments']) && $_POST['all_departments'] == 'on') {
        $UserData->all_departments = 1;
        $globalDepartament[] = 0;
    } else {
        $UserData->all_departments = 0;
开发者ID:nagyistoce,项目名称:livehelperchat,代码行数:31,代码来源:edit.php


示例11: foreach

			<form action="<?php 
    echo erLhcoreClassDesign::baseurl('system/languages');
    ?>
" method="post">
    				<?php 
    include erLhcoreClassDesign::designtpl('lhkernel/csfr_token.tpl.php');
    ?>
    				
    				<div class="form-group">
        				<label><?php 
    echo erTranslationClassLhTranslation::getInstance()->getTranslation('system/languages', 'Language');
    ?>
</label> 
        				<select name="language" class="form-control">
        					<?php 
    $userLanguage = erLhcoreClassModelUserSetting::getSetting('user_language', erLhcoreClassSystem::instance()->Language);
    foreach (erLhcoreClassSiteaccessGenerator::getLanguages() as $language) {
        ?>
        						<option value="<?php 
        echo $language['locale'];
        ?>
" <?php 
        $userLanguage == $language['locale'] ? print 'selected="selected"' : '';
        ?>
><?php 
        echo $language['locale'];
        ?>
</option>
        					<?php 
    }
    ?>
开发者ID:niravpatel2008,项目名称:north-american-nemesis-new,代码行数:31,代码来源:languages.tpl.php


示例12: array

$supportedWidgets = array('online_operators' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/dashboardwidgets', 'Online operators'), 'active_chats' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/dashboardwidgets', 'Active chats'), 'online_visitors' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/dashboardwidgets', 'Online visitors'), 'departments_stats' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/dashboardwidgets', 'Departments stats'), 'pending_chats' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/dashboardwidgets', 'Pending chats'), 'unread_chats' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/dashboardwidgets', 'Unread chats'), 'transfered_chats' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/dashboardwidgets', 'Transfered chats'), 'closed_chats' => erTranslationClassLhTranslation::getInstance()->getTranslation('chat/dashboardwidgets', 'Closed chats'));
erLhcoreClassChatEventDispatcher::getInstance()->dispatch('chat.dashboardwidgets', array('supported_widgets' => &$supportedWidgets));
if (ezcInputForm::hasPostData()) {
    $definition = array('WidgetsUser' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw', null, FILTER_REQUIRE_ARRAY));
    $form = new ezcInputForm(INPUT_POST, $definition);
    $Errors = array();
    if ($form->hasValidData('WidgetsUser') && !empty($form->WidgetsUser)) {
        // Add new widgets
        foreach ($form->WidgetsUser as $newUserWidget) {
            if (!in_array($newUserWidget, $widgetsUser)) {
                $dashboardOrderString = $newUserWidget . ',' . $dashboardOrderString;
                $widgetsUser[] = $newUserWidget;
            }
        }
        // Remove removed widgets
        foreach ($widgetsUser as $userWidget) {
            if (!in_array($userWidget, $form->WidgetsUser)) {
                $dashboardOrderString = str_replace($userWidget, '', $dashboardOrderString);
                unset($widgetsUser[array_search($userWidget, $widgetsUser)]);
            }
        }
        // Just cleanup
        $dashboardOrderString = str_replace(array(',,', ',,,', ',,,,', '|,', ',|'), array(',', ',', ',', '|', '|'), $dashboardOrderString);
        // Store settings in user scope now
        erLhcoreClassModelUserSetting::setSetting('dwo', $dashboardOrderString);
        $tpl->set('updated', true);
    }
}
$tpl->setArray(array('widgets' => $supportedWidgets, 'user_widgets' => $widgetsUser));
echo $tpl->fetch();
exit;
开发者ID:keramist,项目名称:livehelperchat,代码行数:31,代码来源:dashboardwidgets.php


示例13: array

active<?php 
    }
    ?>
" id="speech">

		<form action="<?php 
    echo erLhcoreClassDesign::baseurl('user/account');
    ?>
" method="post">

	  	<?php 
    include erLhcoreClassDesign::designtpl('lhkernel/csfr_token.tpl.php');
    ?>

	  	<?php 
    $dataSpeech = array('language' => (int) erLhcoreClassModelUserSetting::getSetting('speech_language', ''), 'dialect' => (int) erLhcoreClassModelUserSetting::getSetting('speech_dialect', ''), 'optional' => true);
    ?>
	  	
		<?php 
    include erLhcoreClassDesign::designtpl('lhspeech/speech_form_fields.tpl.php');
    ?>
		
		<input type="submit" class="btn btn-default" name="UpdateSpeech_account" value="<?php 
    echo erTranslationClassLhTranslation::getInstance()->getTranslation('user/account', 'Update');
    ?>
" />

		</form>
	</div>
  <?php 
}
开发者ID:oscarmp4,项目名称:livehelperchat,代码行数:31,代码来源:account.tpl.php


示例14: json_encode

<?php

// Make sure that we support variable which is setting now
// It was possible in another portal to cheat, and overload server without this type of checking
try {
    // Start session if required only
    $currentUser = erLhcoreClassUser::instance();
    if (!isset($_SERVER['HTTP_X_CSRFTOKEN']) || !$currentUser->validateCSFRToken($_SERVER['HTTP_X_CSRFTOKEN'])) {
        echo json_encode(array('error' => 'true', 'result' => 'Invalid CSRF Token'));
        exit;
    }
    $settingHandler = erLhcoreClassModelUserSettingOption::fetch($Params['user_parameters']['identifier']);
    // Never trust user input
    erLhcoreClassModelUserSetting::setSetting($Params['user_parameters']['identifier'], (string) $_POST['value']);
    exit;
} catch (Exception $e) {
    print_r($e);
}
exit;
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:19,代码来源:setsettingajaxraw.php


示例15: getInstance

 public static function getInstance()
 {
     if (is_null(self::$instance)) {
         $sysConfiguration = erLhcoreClassSystem::instance();
         $urlCfgDefault = ezcUrlConfiguration::getInstance();
         $urlCfgDefault->basedir = $sysConfiguration->WWWDir;
         $urlCfgDefault->script = $sysConfiguration->IndexFile;
         $urlCfgDefault->unorderedDelimiters = array('(', ')');
         $urlCfgDefault->orderedParameters = array();
         $urlCfgDefault->unorderedParameters = array();
         $urlCfgDefault->addOrderedParameter('siteaccess');
         $urlCfgDefault->addOrderedParameter('module');
         $urlCfgDefault->addOrderedParameter('function');
         $cfgSite = erConfigClassLhConfig::getInstance();
         $urlInstance = new erLhcoreClassURL(($cfgSite->getSetting('site', 'force_virtual_host', false) === false ? 'index.php' : '') . $sysConfiguration->RequestURI, $urlCfgDefault);
         $siteaccess = $urlInstance->getParam('siteaccess');
         $availableSiteaccess = $cfgSite->getSetting('site', 'available_site_access');
         $defaultSiteAccess = $cfgSite->getSetting('site', 'default_site_access');
         if ($defaultSiteAccess != $siteaccess && in_array($siteaccess, $availableSiteaccess)) {
             $optionsSiteAccess = $cfgSite->getSetting('site_access_options', $siteaccess);
             $sysConfiguration->Language = $siteaccess == 'site_admin' ? erLhcoreClassModelUserSetting::getSetting('user_language', $optionsSiteAccess['locale'], false, true) : $optionsSiteAccess['locale'];
             $sysConfiguration->ThemeSite = $optionsSiteAccess['theme'];
             $sysConfiguration->ContentLanguage = $optionsSiteAccess['content_language'];
             $sysConfiguration->WWWDirLang = '/' . $siteaccess;
             $sysConfiguration->SiteAccess = $siteaccess;
             if ($optionsSiteAccess['locale'] != 'en_EN') {
                 $urlInstance->setParam('module', $urlInstance->getParam('module'));
                 $urlInstance->setParam('function', $urlInstance->getParam('function'));
             }
             if (isset($_POST['switchLang']) && in_array($_POST['switchLang'], $availableSiteaccess)) {
                 $optionsSiteAccessOverride = $cfgSite->getSetting('site_access_options', $_POST['switchLang']);
                 $sysConfiguration->Language = $optionsSiteAccessOverride['locale'];
                 $sysConfiguration->SiteAccess = $_POST['switchLang'];
                 if ($defaultSiteAccess != $sysConfiguration->SiteAccess) {
                     $sysConfiguration->WWWDirLang = '/' . $sysConfiguration->SiteAccess;
                 } else {
                     $sysConfiguration->WWWDirLang = '';
                 }
             }
         } else {
             $optionsSiteAccess = $cfgSite->getSetting('site_access_options', $defaultSiteAccess);
             // Falling back
             $sysConfiguration->SiteAccess = $defaultSiteAccess;
             $sysConfiguration->Language = $siteaccess == 'site_admin' ? erLhcoreClassModelUserSetting::getSetting('user_language', $optionsSiteAccess['locale'], false, true) : $optionsSiteAccess['locale'];
             $sysConfiguration->ThemeSite = $optionsSiteAccess['theme'];
             $sysConfiguration->ContentLanguage = $optionsSiteAccess['content_language'];
             if (isset($_POST['switchLang']) && in_array($_POST['switchLang'], $availableSiteaccess)) {
                 $optionsSiteAccessOverride = $cfgSite->getSetting('site_access_options', $_POST['switchLang']);
                 $sysConfiguration->Language = $optionsSiteAccessOverride['locale'];
                 $sysConfiguration->SiteAccess = $_POST['switchLang'];
                 if ($defaultSiteAccess != $sysConfiguration->SiteAccess) {
                     $sysConfiguration->WWWDirLang = '/' . $sysConfiguration->SiteAccess;
                 }
             }
             // To reset possition counter
             $urlCfgDefault->removeOrderedParameter('siteaccess');
             $urlCfgDefault->removeOrderedParameter('module');
             $urlCfgDefault->removeOrderedParameter('function');
             // Reinit parameters
             $urlCfgDefault->addOrderedParameter('module');
             $urlCfgDefault->addOrderedParameter('function');
             //Apply default configuration
             $urlInstance->applyConfiguration($urlCfgDefault);
             if ($optionsSiteAccess['locale'] != 'en_EN') {
                 $urlInstance->setParam('module', $urlInstance->getParam('module'));
                 $urlInstance->setParam('function', $urlInstance->getParam('function'));
             }
         }
         self::$instance = $urlInstance;
     }
     return self::$instance;
 }
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:72,代码来源:lhurl.php


示例16: array

        erLhcoreClassModelUserSetting::setSetting('enable_pending_list', 0);
    }
    if ($form->hasValidData('activeTabEnabled') && $form->activeTabEnabled == true) {
        erLhcoreClassModelUserSetting::setSetting('enable_active_list', 1);
    } else {
        erLhcoreClassModelUserSetting::setSetting('enable_active_list', 0);
    }
    if ($form->hasValidData('closedTabEnabled') && $form->closedTabEnabled == true) {
        erLhcoreClassModelUserSetting::setSetting('enable_close_list', 1);
    } else {
        erLhcoreClassModelUserSetting::setSetting('enable_close_list', 0);
    }
    if ($form->hasValidData('unreadTabEnabled') && $form->unreadTabEnabled == true) {
        erLhcoreClassModelUserSetting::setSetting('enable_unread_list', 1);
    } else {
        erLhcoreClassModelUserSetting::setSetting('enable_unread_list', 0);
    }
    $tpl->set('account_updated', 'done');
    $tpl->set('tab', 'tab_settings');
}
if (isset($_POST['Update'])) {
    $definition = array('Password' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'Password1' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'Email' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::REQUIRED, 'validate_email'), 'Name' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::REQUIRED, 'unsafe_raw'), 'Surname' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::REQUIRED, 'unsafe_raw'), 'Username' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'JobTitle' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'Skype' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'XMPPUsername' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'UserTimeZone' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'unsafe_raw'), 'UserInvisible' => new ezcInputFormDefinitionElement(ezcInputFormDefinitionElement::OPTIONAL, 'boolean'));
    if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
        erLhcoreClassModule::redirect('user/account');
        exit;
    }
    $form = new ezcInputForm(INPUT_POST, $definition);
    $Errors = array();
    if (!$form->hasValidData('Username')) {
        $Errors[] = erTranslationClassLhTranslation::getInstance()->getTranslation('user/account', 'Please enter a username!');
    } elseif ($form->hasValidData('Username') && $form->Username != $UserData->username && !erLhcoreClassModelUser::userExists($form->Username)) {
开发者ID:sudogitguy,项目名称:livehelperchat,代码行数:31,代码来源:account.php


示例17: array

<?php

$departmentNames = array();
$departmentList = array();
$departments = erLhcoreClassModelDepartament::getList($departmentParams);
foreach ($departments as $department) {
    $departmentNames[$department->id] = $department->name;
    $departmentList[] = array('id' => $department->id, 'name' => $department->name);
}
$dashboardOrder = (string) erLhcoreClassModelUserSetting::getSetting('dwo', '');
if ($dashboardOrder == '') {
    $dashboardOrder = erLhcoreClassModelChatConfig::fetch('dashboard_order')->current_value;
}
$dashboardOrder = explode('|', $dashboardOrder);
$columnsTotal = count($dashboardOrder);
$columnSize = 12 / $columnsTotal;
?>
<div class="row" id="dashboard-body" ng-init='lhc.userDepartments=<?php 
echo json_encode($departmentList, JSON_HEX_APOS);
?>
;lhc.userDepartmentsNames=<?php 
echo json_encode($departmentNames, JSON_HEX_APOS);
?>
;lhc.setUpListNames(["actived","closedd","unreadd","pendingd","operatord","departmentd"])'>
     <a class="dashboard-configuration" onclick="return lhc.revealModal({'url':WWW_DIR_JAVASCRIPT +'chat/dashboardwidgets'})" title="<?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('chat/syncadmininterface', 'Configure dashboard');
?>
"><i class="material-icons mr-0">&#xE871;</i></a>
     <?php 
for ($i = 0; $i < $columnsTotal; $i++) {
    $widgets = array_filter(explode(',', $dashboardOrder[$i]));
开发者ID:keramist,项目名称:livehelperchat,代码行数:31,代码来源:index.tpl.php


示例18: array

    $Errors = erLhcoreClassUserValidator::validateUserNew($UserData, $userParams);
    if (count($Errors) == 0) {
        try {
            $db = ezcDbInstance::get();
            $db->beginTransaction();
            erLhcoreClassUser::getSession()->save($UserData);
            if (count($userParams['global_departament']) > 0) {
                erLhcoreClassUserDep::addUserDepartaments($userParams['global_departament'], $UserData->id, $UserData);
            }
            $UserData->setUserGroups();
            $userPhotoErrors = erLhcoreClassUserValidator::validateUserPhoto($UserData);
            if ($userPhotoErrors !== false && count($userPhotoErrors) == 0) {
                $UserData->saveThis();
            }
            erLhcoreClassModelDepartamentGroupUser::addUserDepartmentGroups($UserData, erLhcoreClassUserValidator::validateDepartmentsGroup($UserData));
            erLhcoreClassModelUserSetting::setSetting('show_all_pending', $userParams['show_all_pending'], $UserData->id);
            erLhcoreClassChatEventDispatcher::getInstance()->dispatch('user.user_created', array('userData' => &$UserData, 'password' => $UserData->password_front));
            $db->commit();
            erLhcoreClassModule::redirect('user/userlist');
            exit;
        } catch (Exception $e) {
            $tpl->set('errors', array($e->getMessage()));
            $UserData->removeFile();
            $db->rollback();
        }
    } else {
        $tpl->set('errors', $Errors);
    }
}
$tpl->set('user', $UserData);
$tpl->set('userDepartaments', $UserDepartaments);
开发者ID:remdex,项目名称:livehelperchat,代码行数:31,代码来源:new.php


示例19: array

$soundData = array(0 => false, 'repeat_sound' => 1, 'repeat_sound_delay' => 5, 'show_alert' => false, 'new_chat_sound_enabled' => true, 'new_message_sound_admin_enabled' => true, 'new_message_sound_user_enabled' => true, 'online_timeout' => 300, 'check_for_operator_msg' => 10, 'back_office_sinterval' => 10, 'chat_message_sinterval' => 3.5, 'long_polling_enabled' => false, 'polling_chat_message_sinterval' => 1.5, 'polling_back_office_sinterval' => 5, 'connection_timeout' => 30, 'browser_notification_message' => false);
?>
confLH.back_office_sinterval = <?php 
echo (int) ($soundData['back_office_sinterval'] * 1000);
?>
;confLH.chat_message_sinterval = <?php 
echo (int) ($soundData['chat_message_sinterval'] * 1000);
?>
;confLH.new_chat_sound_enabled = <?php 
echo (int) erLhcoreClassModelUserSetting::getSetting('new_chat_sound', (int) $soundData['new_chat_sound_enabled']);
?>
;confLH.new_message_sound_admin_enabled = <?php 
echo (int) erLhcoreClassModelUserSetting::getSetting('chat_message', (int) $soundData['new_message_sound_admin_enabled']);
?>
;confLH.new_message_sound_user_enabled = <?php 
echo (int) erLhcoreClassModelUserSetting::getSetting('chat_message', (int) $soundData['new_message_sound_user_enabled']);
?>
;confLH.new_message_browser_notification = <?php 
echo isset($soundData['browser_notification_message']) ? (int) $soundData['browser_notification_message'] : 0;
?>
;confLH.transLation = {'new_chat':'New chat request'};confLH.csrf_token = '<?php 
echo erLhcoreClassUser::instance()->getCSFRToken();
?>
';confLH.repeat_sound = <?php 
echo (int) $soundData['repeat_sound'];
?>
;confLH.repeat_sound_delay = <?php 
echo (int) $soundData['repeat_sound_delay'];
?>
;confLH.show_alert = <?php 
echo (int) $soundData['show_alert'];
开发者ID:niravpatel2008,项目名称:north-american-nemesis-new,代码行数:31,代码来源:500733b9b91c99814e3e4d967c2043b3.php


示例20:

<?php

$soundData = erLhcoreClassModelChatConfig::fetch('sync_sound_settings')->data;
$soundMessageEnabled = erLhcoreClassModelUserSetting::getSetting('chat_message', (int) $soundData['new_message_sound_admin_enabled']);
$soundNewChatEnabled = erLhcoreClassModelUserSetting::getSetting('new_chat_sound', (int) $soundData['new_chat_sound_enabled']);
$canChangeOnlineStatus = false;
$currentUser = erLhcoreClassUser::instance();
if ($currentUser->hasAccessTo('lhuser', 'changeonlinestatus')) {
    $canChangeOnlineStatus = true;
    if (!isset($UserData)) {
        $UserData = $currentUs 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP erLhcoreClassModule类代码示例发布时间:2022-05-23
下一篇:
PHP erLhcoreClassModelUser类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap