Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

sessioninfo.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: sessioninfo.php 9665 2002-07-09 07:25:42Z bf $
5 //
6 // Created on: <01-Nov-2000 14:34:30 bf>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27 // include_once( "classes/INIFile.php" );
28 // include_once( "classes/eztemplate.php" );
29 // include_once( "classes/ezlocale.php" );
30 // include_once( "classes/ezdatetime.php" );
31 // include_once( "classes/eztime.php" );
32 // include_once( "classes/ezhttptool.php" );
33
34 // include_once( "ezuser/classes/ezuser.php" );
35 // include_once( "ezuser/classes/ezusergroup.php" );
36
37 require( "kernel/ezuser/admin/admincheck.php" );
38
39
40 if ( isset( $Action ) && (string) $Action == "Delete" && count( $SessionArrayID ) > 0 )
41 {
42 foreach( $SessionArrayID as $sessionID )
43 {
44 $session = new eZSession( $sessionID );
45 $session->delete();
46 }
47 eZHTTPTool::header( "Location: /user/sessioninfo/" );
48 exit();
49 }
50
51 $ini =& eZINI::instance( 'site.ini' );
52 $Language = $ini->variable( "eZUserMain", "Language" );
53
54
55 $t = new eZTemplate( "kernel/ezuser/admin/" . $ini->variable( "eZUserMain", "AdminTemplateDir" ),
56 "kernel/ezuser/admin/" . "/intl", $Language, "sessioninfo.php" );
57 $t->setAllStrings();
58
59 $t->set_file( array(
60 "user_list_page" => "sessioninfo.tpl"
61 ) );
62
63 $t->set_block( "user_list_page", "user_item_tpl", "user_item" );
64
65 $t->set_block( "user_list_page", "group_item_tpl", "group_item" );
66
67 $user = new eZUser();
68
69 $userSessionList =& eZUser::currentUsers();
70
71 $t->set_var( "user_count", count( $userSessionList ) );
72
73 $locale = new eZLocale( $Language );
74
75 $i=0;
76 foreach( $userSessionList as $userSessionItem )
77 {
78 if ( ( $i %2 ) == 0 )
79 $t->set_var( "td_class", "bglight" );
80 else
81 $t->set_var( "td_class", "bgdark" );
82
83 $t->set_var( "first_name", $userSessionItem[0]->firstName() );
84 $t->set_var( "last_name", $userSessionItem[0]->lastName() );
85 $t->set_var( "email", $userSessionItem[0]->email() );
86 $t->set_var( "user_id", $userSessionItem[0]->id() );
87
88 $t->set_var( "session_id", $userSessionItem[1]->id() );
89
90 $t->set_var( "session_ip", $userSessionItem[1]->variable( "SessionIP" ) );
91
92 $idle = $userSessionItem[1]->idle();
93
94 if ( $idle == 0 )
95 $idle = 1;
96
97 $seconds = $idle % 60;
98 $minutes = ( ( $idle - $seconds ) / 60 ) % 60;
99 $hours = ( $idle - $seconds - ( $minutes * 60 ) ) / (60*60);
100 $time = eZLocale::addZero( $hours ) . ":" . eZLocale::addZero( $minutes ) . ":" . eZLocale::addZero( $seconds );
101
102 $t->set_var( "idle", $time );
103
104 $t->parse( "user_item", "user_item_tpl", true );
105 $i++;
106 }
107
108
109 $t->pparse( "output", "user_list_page" );
110
111 ?>
$session
$session
Definition: admin/articlelist.php:44
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZLocale
Definition: ezlocale.php:119
eZLocale\addZero
static addZero( $value)
Definition: ezlocale.php:524
eZSession
Definition: lib/ezsession/classes/ezsession.php:65
eZTemplate
Definition: eztemplate.php:107
eZUser
Definition: ezuser.php:76
eZUser\currentUsers
static currentUsers()
Definition: ezuser.php:946
$Action
$Action
Definition: companysearch.php:80
exit
exit
Definition: folder.php:81
$time
$time
Definition: homepage.php:327
$locale
$locale
Definition: sessioninfo.php:73
$t
$t
Definition: sessioninfo.php:55
$user
$user
Definition: sessioninfo.php:67
$i
$i
Definition: sessioninfo.php:75
$Language
$Language
Definition: sessioninfo.php:52
$ini
if(isset( $Action) &&(string) $Action=="Delete" &&count( $SessionArrayID) > 0) $ini
Definition: sessioninfo.php:51
$userSessionList
$userSessionList
Definition: sessioninfo.php:69
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.