Ejemplo n.º 1
0
    echo '	<input type="submit" value="' . _('Kill this session') . '" />';
    echo '</form>';
    echo '</div>';
    page_footer();
} else {
    page_header();
    $total = Abstract_Session::countByStatus();
    echo '<h1>' . sprintf(_('Sessions (total: %s)'), $total) . '</h1>';
    if ($total > $prefs->get('general', 'max_items_per_page')) {
        if (!isset($_GET['start']) || (!is_numeric($_GET['start']) || $_GET['start'] >= $total)) {
            $start = 0;
        } else {
            $start = $_GET['start'];
        }
        $pagechanger = get_pagechanger('sessions.php?', $prefs->get('general', 'max_items_per_page'), $total);
        $sessions = Abstract_Session::load_partial($prefs->get('general', 'max_items_per_page'), $start);
    } else {
        $sessions = Abstract_Session::load_all();
    }
    if (is_array($sessions) && count($sessions) > 0) {
        $buf = array();
        foreach ($sessions as $session) {
            $buf[$session->getAttribute('user_login')] = $session;
        }
        ksort($buf);
        $sessions = $buf;
        echo '<div>';
        if (isset($pagechanger)) {
            echo $pagechanger;
        }
        echo '<table style="width: 100%;" border="0" cellspacing="1" cellpadding="3"><tr><td style="vertical-align: top;">';
Ejemplo n.º 2
0
 public function sessions_list($offset_)
 {
     $this->check_authorized('viewStatus');
     $ret = array();
     $search_limit = $this->prefs->get('general', 'max_items_per_page');
     $sessions = Abstract_Session::load_partial($search_limit, $offset_);
     foreach ($sessions as $session) {
         $s = self::generate_session_array($session);
         $ret[$s['id']] = $s;
     }
     return $ret;
 }