Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezuser/admin/userlist.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: userlist.php 9671 2002-07-14 14:11:58Z kaid $
5 //
6 // Created on: <20-Sep-2000 13:32:11 ce>
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/ezlist.php" );
30
31 $ini =& eZINI::instance( 'site.ini' );
32 $Language = $ini->variable( "eZUserMain", "Language" );
33 $errorIni = new eZINI( "kernel/ezuser/admin/intl/" . $Language . "/userlist.php.ini", false );
34
35 $Max = $ini->variable( "eZUserMain", "MaxUserList" );
36
37 // include_once( "ezuser/classes/ezuser.php" );
38 // include_once( "ezuser/classes/ezusergroup.php" );
39
40 require( "kernel/ezuser/admin/admincheck.php" );
41
42 $t = new eZTemplate( "kernel/ezuser/admin/" . $ini->variable( "eZUserMain", "AdminTemplateDir" ),
43 "kernel/ezuser/admin/" . "/intl", $Language, "userlist.php" );
44 $t->setAllStrings();
45
46 $t->set_file( "user_list_page", "userlist.tpl" );
47
48 $t->set_block( "user_list_page", "user_item_tpl", "user_item" );
49 $t->set_block( "user_item_tpl", "user_email_item_tpl", "user_email_item" );
50 $t->set_block( "user_item_tpl", "user_empty_email_item_tpl", "user_empty_email_item" );
51
52 $t->set_block( "user_list_page", "group_item_tpl", "group_item" );
53
54 $t->set_var( "site_style", $SiteDesign );
55 $t->set_var( "OldSearchText", "" );
56
57 $user = new eZUser();
58
59 $OrderBy = "name";
60
61 if( !isset( $LastName ) )
62 $LastName = false;
63 if( !isset( $FirstName ) )
64 $FirstName = false;
65 if( !isset( $Login ) )
66 $Login = false;
67 if( !isset( $EMail ) )
68 $EMail = false;
69 if( !isset( $Login ) )
70 $Login = false;
71 if( !isset( $SearchText ) )
72 $SearchText = false;
73
74 $LastName = addslashes(trim($LastName));
75 $FirstName = addslashes(trim($FirstName));
76 $Login = addslashes(trim($Login));
77 $EMail = addslashes(trim($EMail));
78 $SearchText = addslashes (trim ($SearchText) );
79
80 if ( !is_numeric( $Max ) )
81 $Max = 10;
82 if ( !is_numeric( $Index ) )
83 $Index = 0;
84
85 if ( isset( $Search ) && $SearchText != "" )
86 {
87 $userList = $user->search( $SearchText, $OrderBy );
88 $TotalTypes = count( $userList );
89 }
90 else if ( $FirstName != ""
91 or $LastName != ""
92 or $Login != ""
93 or $EMail != ""
94 )
95 {
96 $userList = $user->search( $SearchText, $OrderBy, $LastName, $FirstName, $EMail, $Login, $match);
97 $TotalTypes = count( $userList );
98 }
99 else if ( $GroupID == 0 )
100 {
101 $userList = $user->getAll( $OrderBy, true, false, $Max, $Index );
102 $TotalTypes = $user->getAllCount();
103 }
104 else
105 {
106 $usergroup = new eZUserGroup();
107 $userList = $usergroup->users( $GroupID, $OrderBy );
108 $TotalTypes = count( $userList );
109 }
110
111 $t->set_var( "user_count", count( $userList ) );
112 $t->set_var( "total_user_count", $TotalTypes );
113
114 if ( count( $userList ) == 0 )
115 {
116 $error = $errorIni->variable( "strings", "no_users" );
117 $t->set_var( "user_item", $error );
118 }
119 else
120 {
121 $i = 0;
122 foreach ( $userList as $userItem )
123 {
124 $t->set_var( "user_email_item", "" );
125 $t->set_var( "user_empty_email_item", "" );
126
127 if ( ( $i % 2 ) == 0 )
128 $t->set_var( "td_class", "bglight" );
129 else
130 $t->set_var( "td_class", "bgdark" );
131
132 $t->set_var( "first_name", $userItem->firstName() );
133 $t->set_var( "last_name", $userItem->lastName() );
134 $t->set_var( "login_name", $userItem->login() );
135 $email = $userItem->email();
136 if ( empty( $email ) )
137 {
138 $t->parse( "user_empty_email_item", "user_empty_email_item_tpl" );
139 }
140 else
141 {
142 $t->set_var( "email", $email );
143 $t->parse( "user_email_item", "user_email_item_tpl" );
144 }
145 $t->set_var( "email", $userItem->email() );
146 $t->set_var( "user_id", $userItem->id() );
147
148 // if ( $userItem->infoSubscription( ) == true )
149 // {
150 // print( $userItem->email() . "<br>" );
151 // }
152
153 $t->parse( "user_item", "user_item_tpl", true );
154 $i++;
155 }
156 }
157
158 eZList::drawNavigator( $t, $TotalTypes, $Max, $Index, "user_list_page" );
159
160 $group = new eZUserGroup();
161 $groupList = $group->getAll();
162
163
164 foreach ( $groupList as $groupItem )
165 {
166
167 // print( $GroupID . " " . $groupItem->id() . "<br>" );
168
169 if ( $groupItem->id() == $GroupID )
170 {
171 $t->set_var( "is_selected", "selected" );
172 }
173 else
174 {
175 $t->set_var( "is_selected", "" );
176 }
177 $t->set_var( "group_name", $groupItem->name() );
178 $t->set_var( "group_id", $groupItem->id() );
179
180 $t->parse( "group_item", "group_item_tpl", true );
181 }
182
183 $t->set_var( "current_group_id", $GroupID );
184 $t->set_var( "sort_order", $OrderBy );
185
186 $t->pparse( "output", "user_list_page" );
187
188 ?>
$i
$i
Definition: admin/adlist.php:91
eZINI
Reads and writes .ini style configuration files.
eZList\drawNavigator
static drawNavigator(&$t, $total_types, $max_types, $index, $parent=false, $variables=false)
Definition: ezlist.php:401
eZTemplate
Definition: eztemplate.php:107
eZUserGroup
Definition: ezusergroup.php:66
eZUser
Definition: ezuser.php:76
$Index
$Index
Definition: eZPBINIFile.php:499
$error
$error
Definition: ezarticle/admin/categoryedit.php:51
$SiteDesign
$SiteDesign
Definition: ezbulkmail/user/datasupplier.php:31
$Max
$Max
Definition: ezuser/admin/userlist.php:35
$OrderBy
$OrderBy
Definition: ezuser/admin/userlist.php:59
$t
$t
Definition: ezuser/admin/userlist.php:42
$errorIni
$errorIni
Definition: ezuser/admin/userlist.php:33
$TotalTypes
$TotalTypes
Definition: ezuser/admin/userlist.php:108
$user
$user
Definition: ezuser/admin/userlist.php:57
$LastName
$LastName
Definition: ezuser/admin/userlist.php:74
$userList
$userList
Definition: ezuser/admin/userlist.php:107
$EMail
$EMail
Definition: ezuser/admin/userlist.php:77
$FirstName
$FirstName
Definition: ezuser/admin/userlist.php:75
$groupList
$groupList
Definition: ezuser/admin/userlist.php:161
$Language
$Language
Definition: ezuser/admin/userlist.php:32
$ini
$ini
Definition: ezuser/admin/userlist.php:31
$SearchText
$SearchText
Definition: ezuser/admin/userlist.php:78
$group
$group
Definition: ezuser/admin/userlist.php:160
$Login
$Login
Definition: ezuser/admin/userlist.php:76
$GroupID
$GroupID
Definition: rssheadlines.php:51
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.