当前位置: 首页>>代码示例>>PHP>>正文


PHP EfrontUser::getUsersOnline方法代码示例

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


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

示例1: getMainScripts

    $mainScripts = getMainScripts();
    $smarty->assign("T_HEADER_MAIN_SCRIPTS", implode(",", $mainScripts));
    //Operation/file specific scripts
    $loadScripts = array_diff($loadScripts, $mainScripts);
    //Clear out duplicates
    $smarty->assign("T_HEADER_LOAD_SCRIPTS", implode(",", array_unique($loadScripts)));
    //array_unique, so it doesn't send duplicate entries
    if (in_array('news', array_merge($positions['leftList'], $positions['rightList'], $positions['centerList']))) {
        $smarty->assign("T_NEWS", news::getNews(0, true));
    }
    if (G_VERSIONTYPE == 'enterprise') {
        #cpp#ifdef ENTERPRISE
        require_once "../libraries/module_hcd_tools.php";
    }
    #cpp#endif
    if (EfrontUser::isOptionVisible('online_users') && in_array('online', array_merge($positions['leftList'], $positions['rightList'], $positions['centerList']))) {
        $smarty->assign("T_ONLINE_USERS_LIST", EfrontUser::getUsersOnline($GLOBALS['configuration']['autologout_time'] * 60));
    }
    $smarty->assign("T_CURRENT_USER", $currentUser);
    $smarty->load_filter('output', 'eF_template_setEditorOffset');
    $smarty->display('index.tpl');
} else {
    $smarty->load_filter('output', 'eF_template_setEditorOffset');
    $smarty->display('index.tpl');
}
$benchmark->set('smarty');
$benchmark->stop();
$output = $benchmark->display();
if (G_DEBUG) {
    echo $output;
}
开发者ID:bqq1986,项目名称:efront,代码行数:31,代码来源:index.php

示例2: lockSystem

 /**
  * Lock system
  *
  * This function locks down system, so that no users can login (for example when upgrading)
  * If $logoutUsers is set, it logs out connected users as well
  * <br/>Example:
  * <code>
  * EfrontSystem::lockSystem('The system is locked due to maintenance', 1);
  * </code>
  *
  * @param string $message The message to display on the index page
  * @param boolean $logoutUsers Whether to disconnect connected users
  * @since 3.6.0
  * @access public
  * @static
  */
 public static function lockSystem($message, $logoutUsers)
 {
     EfrontConfiguration::setValue('lock_message', $message);
     EfrontConfiguration::setValue('lock_down', 1);
     if ($logoutUsers) {
         $onlineUsers = EfrontUser::getUsersOnline();
         foreach ($onlineUsers as $value) {
             if ($value['login'] != $_SESSION['s_login']) {
                 $user = EfrontUserFactory::factory($value['login']);
                 $user->logout();
             }
         }
     }
 }
开发者ID:bqq1986,项目名称:efront,代码行数:30,代码来源:system.class.php

示例3: onPageFinishLoadingSmartyTpl

 public function onPageFinishLoadingSmartyTpl()
 {
     if (!isset($_SESSION['lesson_rooms'])) {
         $_SESSION['lesson_rooms'] = array();
     }
     $smarty = $this->getSmartyVar();
     $mainScripts = array_merge(array('../modules/module_chat/js/chat'), getMainScripts());
     $smarty->assign("T_HEADER_MAIN_SCRIPTS", implode(",", $mainScripts));
     if ($this->isPopup()) {
         $smarty->assign("T_CHAT_MODULE_STATUS", "OFF");
     } else {
         $smarty->assign("T_CHAT_MODULE_STATUS", "ON");
     }
     if (!$_SESSION['chatter']) {
         $currentUser = $this->getCurrentUser();
         $_SESSION['chatter'] = $currentUser->login;
         $_SESSION['utype'] = $currentUser->getType();
         $this->calculateCommonality($currentUser->login);
         eF_executeNew("INSERT IGNORE INTO module_chat_users (username ,timestamp_) VALUES ('" . $_SESSION['chatter'] . "', CURRENT_TIMESTAMP);");
     } else {
         $currentUser = $this->getCurrentUser();
         if ($_SESSION['chatter'] != $currentUser->login) {
             $_SESSION['chatter'] = $currentUser->login;
             $_SESSION['utype'] = $currentUser->getType();
             $this->calculateCommonality($currentUser->login);
             eF_executeNew("INSERT IGNORE INTO module_chat_users (username ,timestamp_) VALUES ('" . $_SESSION['chatter'] . "', CURRENT_TIMESTAMP);");
         }
     }
     $smarty->assign("T_CHAT_MODULE_BASEURL", $this->moduleBaseUrl);
     $smarty->assign("T_CHAT_MODULE_BASELINK", $this->moduleBaseLink);
     $smarty->assign("T_CHAT_MODULE_BASEDIR", $this->moduleBaseDir);
     $onlineUsers = EfrontUser::getUsersOnline();
     $smarty->assign("T_CHAT_MODULE_ONLINEUSERS", $onlineUsers);
     return $this->moduleBaseDir . "module_chat.tpl";
 }
开发者ID:jiangjunt,项目名称:efront_open_source,代码行数:35,代码来源:module_chat.class.php

示例4: rawurlencode

        //    echo $active_menu;
    }
    $smarty->assign("T_ACTIVE_MENU", $active_menu);
    $_SESSION['last_id'] = 0;
    // Each time the sidebar reloads you need to get the five last minuites
    $smarty->assign("T_MENU", $newMenu->menu);
    if ($currentUser->getType() != "administrator" && !isset($currentLesson)) {
        $smarty->assign("T_MENUCOUNT", $newMenu->menuCount - 1);
    } else {
        $smarty->assign("T_MENUCOUNT", $newMenu->menuCount);
    }
}
if (isset($GLOBALS['currentTheme']->options['sidebar_interface']) && $GLOBALS['currentTheme']->options['sidebar_interface'] < 2 || $GLOBALS['currentTheme']->options['sidebar_interface'] == 2 && $GLOBALS['currentTheme']->options['show_header'] == 2) {
    if (isset($GLOBALS['currentLesson']) && $GLOBALS['currentLesson']->options['online'] && $GLOBALS['currentLesson']->options['online'] == 1 || $_SESSION['s_type'] == 'administrator') {
        //$currentUser = EfrontUserFactory :: factory($_SESSION['s_login']);
        $onlineUsers = EfrontUser::getUsersOnline($GLOBALS['configuration']['autologout_time'] * 60);
        if (!$_SESSION['s_login']) {
            eF_redirect("index.php?message=" . rawurlencode(_INACTIVITYLOGOUT));
        }
        $size = sizeof($onlineUsers);
        if ($size) {
            $smarty->assign("T_ONLINE_USERS_COUNT", $size);
        }
        $smarty->assign("T_ONLINE_USERS_LIST", $onlineUsers);
    }
}
if (!isset($horizontal_inframe_version) || !$horizontal_inframe_version) {
    if (EfrontUser::isOptionVisible('messages')) {
        if ($currentUser->coreAccess['personal_messages'] || $currentUser->coreAccess['personal_messages'] != 'hidden') {
            $unreadMessages = $messages = eF_getTableData("f_personal_messages pm, f_folders ff", "count(*)", "pm.users_LOGIN='" . $_SESSION['s_login'] . "' and viewed='no' and f_folders_ID=ff.id and ff.name='Incoming'");
            $smarty->assign("T_UNREAD_MESSAGES", $messages[0]['count(*)']);
开发者ID:kaseya-university,项目名称:efront,代码行数:31,代码来源:new_sidebar.php

示例5: current

            $jsonValues['entity_id'] = current($entity);
            if ($newTime && is_numeric($newTime)) {
                $result = eF_executeNew("insert into users_to_content (users_LOGIN, content_ID, lessons_ID) values('" . $_SESSION['s_login'] . "', " . key($entity) . ", " . $_SESSION['s_lessons_ID'] . ") on duplicate key update total_time={$newTime}");
                $jsonValues['time_in_unit'] = EfrontTimes::formatTimeForReporting($newTime);
            } else {
                $jsonValues['old_time_in_unit'] = EfrontTimes::formatTimeForReporting(EfrontLesson::getUserActiveTimeInUnit($_SESSION['s_login'], key($entity)));
                $jsonValues['old_time_in_lesson'] = EfrontTimes::formatTimeForReporting(EfrontLesson::getUserActiveTimeInLesson($_SESSION['s_login'], $_SESSION['s_lessons_ID']));
            }
        }
        if (empty($_SESSION['last_periodic_check']) || time() - $_SESSION['last_periodic_check'] >= ceil($GLOBALS['configuration']['updater_period'] / 1000)) {
            $result = eF_executeNew("update user_times set time=time+(" . time() . "-timestamp_now),timestamp_now=" . time() . "\n\t\t\t\t\twhere session_expired = 0 and session_custom_identifier = '" . $_SESSION['s_custom_identifier'] . "' and users_LOGIN = '" . $_SESSION['s_login'] . "'\n\t\t\t\t\tand entity = '" . current($entity) . "' and entity_id = '" . key($entity) . "'");
            $_SESSION['last_periodic_check'] = time();
            //Check online users every 5 minutes
            if (empty($_SESSION['last_periodic_check_users']) || time() - $_SESSION['last_periodic_check_users'] >= 300) {
                $_SESSION['last_periodic_check_users'] = $_SESSION['last_periodic_check'];
                $jsonValues['online'] = EfrontUser::getUsersOnline($GLOBALS['configuration']['autologout_time'] * 60);
                $_SESSION['online_users'] = $jsonValues['online'];
            } else {
                $jsonValues['online'] = $_SESSION['online_users'];
            }
            //$messages = eF_getTableData("f_personal_messages pm, f_folders ff", "count(*)", "pm.users_LOGIN='".$_SESSION['s_login']."' and viewed='no' and f_folders_ID=ff.id and ff.name='Incoming'");
            //$jsonValues['messages'] = $messages[0]['count(*)'];
            $jsonValues['status'] = 1;
            echo json_encode($jsonValues);
        } else {
            echo json_encode(array('status' => 1, 'code' => 0));
        }
    }
} catch (Exception $e) {
    handleAjaxExceptions($e);
}
开发者ID:bqq1986,项目名称:efront,代码行数:31,代码来源:periodic_updater.php


注:本文中的EfrontUser::getUsersOnline方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。