XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
main.php
Go to the documentation of this file.
1 <?php
2 // $Id: main.php 10926 2013-01-27 09:15:07Z beckmi $
3 // ------------------------------------------------------------------------ //
4 // XOOPS - PHP Content Management System //
5 // Copyright (c) 2000 XOOPS.org //
6 // <http://www.xoops.org/> //
7 // ------------------------------------------------------------------------ //
8 // This program is free software; you can redistribute it and/or modify //
9 // it under the terms of the GNU General Public License as published by //
10 // the Free Software Foundation; either version 2 of the License, or //
11 // (at your option) any later version. //
12 // //
13 // You may not change or alter any portion of this comment or credits //
14 // of supporting developers from this source code or any supporting //
15 // source code which is considered copyrighted (c) material of the //
16 // original comment or credit authors. //
17 // //
18 // This program is distributed in the hope that it will be useful, //
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
21 // GNU General Public License for more details. //
22 // //
23 // You should have received a copy of the GNU General Public License //
24 // along with this program; if not, write to the Free Software //
25 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //
26 // ------------------------------------------------------------------------ //
27 // Author: Kazumi Ono (AKA onokazu) //
28 // URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ //
29 // Project: The XOOPS Project //
30 // ------------------------------------------------------------------------- //
31 
32 
33 // Check users rights
34 if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) exit( _NOPERM );
35 
36 include_once XOOPS_ROOT_PATH . "/modules/system/admin/users/users.php";
37 // Get Action type
38 $op = system_CleanVars ( $_REQUEST, 'op', 'default', 'string' );
39 
40 $member_handler =& xoops_gethandler('member', 'system');
41 // Define main template
42 $xoopsOption['template_main'] = 'system_users.html';
43 // Call Header
45 
47 // Define Stylesheet
48 $xoTheme->addStylesheet( XOOPS_URL . '/modules/system/css/admin.css');
49 $xoTheme->addStylesheet( XOOPS_URL . '/modules/system/css/ui/' . xoops_getModuleOption('jquery_theme', 'system') . '/ui.all.css');
50 // Define scripts
51 $xoTheme->addScript('modules/system/js/admin.js');
52 // Define Breadcrumb and tips
53 $xoBreadCrumb->addLink( _AM_SYSTEM_USERS_NAV_MAIN, system_adminVersion('users', 'adminpath') );
54 
56 switch ($op) {
57 
58  // Edit user
59  case 'users_edit':
60  // Assign Breadcrumb menu
61  $xoBreadCrumb->addHelp( system_adminVersion('users', 'help') . '#edit' );
63  $xoBreadCrumb->render();
64  form_user(false, $uid);
65  break;
66 
67  // Add user
68  case 'users_add':
69  // Assign Breadcrumb menu
70  $xoBreadCrumb->addHelp( system_adminVersion('users', 'help') . '#add' );
72  $xoBreadCrumb->render();
73  form_user(true);
74  break;
75 
76  // Delete user
77  case 'users_delete':
78  $xoBreadCrumb->render();
79  $user =& $member_handler->getUser($uid);
80  if (isset($_REQUEST['ok']) && $_REQUEST['ok'] == 1)
81  {
82  if (!$GLOBALS['xoopsSecurity']->check()) {
83  redirect_header("admin.php?fct=users", 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
84  }
85 
86  $groups = $user->getGroups();
87  if (in_array(XOOPS_GROUP_ADMIN, $groups)) {
88  xoops_error( sprintf( _AM_SYSTEM_USERS_NO_ADMINSUPP, $user->getVar("uname")) );
89  } elseif (!$member_handler->deleteUser($user)) {
90  xoops_error( sprintf( _AM_SYSTEM_USERS_NO_SUPP, $user->getVar("uname")) );
91  } else {
92  $online_handler =& xoops_gethandler('online');
93  $online_handler->destroy($uid);
94  // RMV-NOTIFY
96  redirect_header("admin.php?fct=users",1,_AM_SYSTEM_DBUPDATED);
97  }
98  } else {
99  //Assign Breadcrumb menu
100  $xoBreadCrumb->addHelp( system_adminVersion('users', 'help') . '#delete' );
102  $xoBreadCrumb->render();
103  xoops_confirm(array('ok' => 1, 'uid' => $uid, 'op' => 'users_delete'), $_SERVER['REQUEST_URI'], sprintf(_AM_SYSTEM_USERS_FORM_SURE_DEL, $user->getVar('uname')));
104  }
105  break;
106 
107  // Delete users
108  case "action_group":
109  if ((@isset($_REQUEST['memberslist_id']) || @$_REQUEST['memberslist_id'] != ''))
110  {
111  $xoBreadCrumb->render();
112  $error = '';
113  foreach ($_REQUEST['memberslist_id'] as $del)
114  {
115  $del = intval($del);
116  $user =& $member_handler->getUser($del);
117  $groups = $user->getGroups();
118  if (in_array(XOOPS_GROUP_ADMIN, $groups)) {
119  $error .= sprintf( _AM_SYSTEM_USERS_NO_ADMINSUPP, $user->getVar("uname"));
120  } elseif (!$member_handler->deleteUser($user)) {
121  $error .= sprintf( _AM_SYSTEM_USERS_NO_SUPP, $user->getVar("uname"));
122  } else {
123  $online_handler =& xoops_gethandler('online');
124  $online_handler->destroy($del);
125  // RMV-NOTIFY
127  }
128  }
129  if( $error != ''){
130  redirect_header("admin.php?fct=users", 3, sprintf( _AM_SYSTEM_USERS_ERROR,$error ) );
131  } else {
132  redirect_header("admin.php?fct=users", 1, _AM_SYSTEM_DBUPDATED);
133  }
134  }
135  break;
136 
137  // Save user
138  case "users_save":
140 
141  if (isset($_REQUEST['uid']))
142  {
143  //Update user
144  if (!$GLOBALS['xoopsSecurity']->check()) {
145  redirect_header("admin.php?fct=users", 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
146  }
147  // RMV-NOTIFY
148  $user_avatar = $theme = null;
149  if ( !isset( $_REQUEST['attachsig'] ) ) $attachsig = null;
150  if ( !isset( $_REQUEST['user_viewemail'] ) ) $user_viewemail = null;
151 
152  $edituser =& $member_handler->getUser($uid);
153  if ($edituser->getVar('uname', 'n') != $_REQUEST['username'] && $member_handler->getUserCount(new Criteria('uname', $myts->addSlashes($_REQUEST['username']))) > 0) {
154  xoops_cp_header();
155  xoops_error( sprintf( _AM_SYSTEM_USERS_PSEUDO_ERROR, htmlspecialchars($_REQUEST['username'])) );
156  xoops_cp_footer();
157  } elseif ( $edituser->getVar('email', 'n') != $_REQUEST['email'] && $member_handler->getUserCount( new Criteria( 'email', $myts->addSlashes($_REQUEST['email']) ) ) > 0 ) {
158  xoops_cp_header();
159  xoops_error( sprintf( _AM_SYSTEM_USERS_MAIL_ERROR, htmlspecialchars($_REQUEST['email'])) );
160  xoops_cp_footer();
161  } else {
162  $edituser->setVar("name", $_REQUEST['name']);
163  $edituser->setVar("uname", $_REQUEST['username']);
164  $edituser->setVar("email", $_REQUEST['email']);
165  $url = isset( $_REQUEST['url'] ) ? formatURL( $_REQUEST['url'] ) : '';
166  $edituser->setVar( "url", $url );
167  $edituser->setVar("user_icq", $_REQUEST['user_icq']);
168  $edituser->setVar("user_from", $_REQUEST['user_from']);
169  $edituser->setVar("user_sig", $_REQUEST['user_sig']);
170  $user_viewemail = (isset($_REQUEST['user_viewemail']) && $_REQUEST['user_viewemail'] == 1) ? 1 : 0;
171  $edituser->setVar("user_viewemail", $user_viewemail);
172  $edituser->setVar("user_aim", $_REQUEST['user_aim']);
173  $edituser->setVar("user_yim", $_REQUEST['user_yim']);
174  $edituser->setVar("user_msnm", $_REQUEST['user_msnm']);
175  $attachsig = ( isset( $_REQUEST['attachsig'] ) && $_REQUEST['attachsig'] == 1 ) ? 1 : 0;
176  $edituser->setVar("attachsig", $attachsig);
177  $edituser->setVar("timezone_offset", $_REQUEST['timezone_offset']);
178  $edituser->setVar("uorder", $_REQUEST['uorder']);
179  $edituser->setVar("umode", $_REQUEST['umode']);
180  // RMV-NOTIFY
181  $edituser->setVar("notify_method", $_REQUEST['notify_method']);
182  $edituser->setVar("notify_mode", $_REQUEST['notify_mode']);
183  $edituser->setVar("bio", $_REQUEST['bio']);
184  $edituser->setVar("rank", $_REQUEST['rank']);
185  $edituser->setVar("user_occ", $_REQUEST['user_occ']);
186  $edituser->setVar("user_intrest", $_REQUEST['user_intrest']);
187  $edituser->setVar('user_mailok', $_REQUEST['user_mailok']);
188  if ($_REQUEST['pass2'] != "") {
189  if ( $_REQUEST['password'] != $_REQUEST['pass2'] ) {
190  xoops_cp_header();
191  echo "
192  <strong>"._AM_SYSTEM_USERS_STNPDNM."</strong>";
193  xoops_cp_footer();
194  exit();
195  }
196  $edituser->setVar("pass", md5($_REQUEST['password']));
197  }
198  if (!$member_handler->insertUser($edituser)) {
199  xoops_cp_header();
200  echo $edituser->getHtmlErrors();
201  xoops_cp_footer();
202  } else {
203  if ($_REQUEST['groups'] != array()) {
204  global $xoopsUser;
205  $oldgroups = $edituser->getGroups();
206  //If the edited user is the current user and the current user WAS in the webmaster's group and is NOT in the new groups array
207  if ($edituser->getVar('uid') == $xoopsUser->getVar('uid') && (in_array(XOOPS_GROUP_ADMIN, $oldgroups)) && !(in_array(XOOPS_GROUP_ADMIN, $_REQUEST['groups']))) {
208  //Add the webmaster's group to the groups array to prevent accidentally removing oneself from the webmaster's group
209  array_push($_REQUEST['groups'], XOOPS_GROUP_ADMIN);
210  }
211  $member_handler =& xoops_gethandler('member');
212  foreach ($oldgroups as $groupid) {
213  $member_handler->removeUsersFromGroup($groupid, array($edituser->getVar('uid')));
214  }
215  foreach ($_REQUEST['groups'] as $groupid) {
216  $member_handler->addUserToGroup($groupid, $edituser->getVar('uid'));
217  }
218  }
219  redirect_header("admin.php?fct=users",1,_AM_SYSTEM_DBUPDATED);
220  }
221  }
222  exit();
223  } else {
224  //Add user
225  if (!$GLOBALS['xoopsSecurity']->check())
226  {
227  redirect_header("admin.php?fct=users", 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
228  }
229  if (!$_REQUEST['username'] || !$_REQUEST['email'] || !$_REQUEST['password'])
230  {
231  $adduser_errormsg = _AM_SYSTEM_USERS_YMCACF;
232  } else
233  {
234  $member_handler =& xoops_gethandler('member');
235  // make sure the username doesnt exist yet
236  if ($member_handler->getUserCount(new Criteria('uname', $myts->addSlashes($_REQUEST['username']))) > 0)
237  {
238  $adduser_errormsg = 'User name '. htmlspecialchars($_REQUEST['username']) .' already exists';
239  } else
240  {
241  $newuser =& $member_handler->createUser();
242  if ( isset($user_viewemail) )
243  {
244  $newuser->setVar("user_viewemail",$_REQUEST['user_viewemail']);
245  }
246  if ( isset($attachsig) )
247  {
248  $newuser->setVar("attachsig",$_REQUEST['attachsig']);
249  }
250  $newuser->setVar("name", $_REQUEST['name']);
251  $newuser->setVar("uname", $_REQUEST['username']);
252  $newuser->setVar("email", $_REQUEST['email']);
253  $newuser->setVar("url", formatURL($_REQUEST['url']));
254  $newuser->setVar("user_avatar",'blank.gif');
255  $newuser->setVar('user_regdate', time());
256  $newuser->setVar("user_icq", $_REQUEST['user_icq']);
257  $newuser->setVar("user_from", $_REQUEST['user_from']);
258  $newuser->setVar("user_sig", $_REQUEST['user_sig']);
259  $newuser->setVar("user_aim", $_REQUEST['user_aim']);
260  $newuser->setVar("user_yim", $_REQUEST['user_yim']);
261  $newuser->setVar("user_msnm", $_REQUEST['user_msnm']);
262  if ($_REQUEST['pass2'] != "")
263  {
264  if ( $_REQUEST['password'] != $_REQUEST['pass2'] )
265  {
266  xoops_cp_header();
267  echo "<strong>" . _AM_SYSTEM_USERS_STNPDNM . "</strong>";
268  xoops_cp_footer();
269  exit();
270  }
271  $newuser->setVar("pass", md5($_REQUEST['password']));
272  }
273  $newuser->setVar("timezone_offset", $_REQUEST['timezone_offset']);
274  $newuser->setVar("uorder", $_REQUEST['uorder']);
275  $newuser->setVar("umode", $_REQUEST['umode']);
276  // RMV-NOTIFY
277  $newuser->setVar("notify_method", $_REQUEST['notify_method']);
278  $newuser->setVar("notify_mode", $_REQUEST['notify_mode']);
279  $newuser->setVar("bio", $_REQUEST['bio']);
280  $newuser->setVar("rank", $_REQUEST['rank']);
281  $newuser->setVar("level", 1);
282  $newuser->setVar("user_occ", $_REQUEST['user_occ']);
283  $newuser->setVar("user_intrest", $_REQUEST['user_intrest']);
284  $newuser->setVar('user_mailok', $_REQUEST['user_mailok']);
285  if (!$member_handler->insertUser($newuser))
286  {
287  $adduser_errormsg = _AM_SYSTEM_USERS_CNRNU;
288  } else
289  {
290  $groups_failed = array();
291  foreach ($_REQUEST['groups'] as $group)
292  {
293  $group = intval($group);
294  if (!$member_handler->addUserToGroup($group, $newuser->getVar('uid')))
295  {
296  $groups_failed[] = $group;
297  }
298  }
299  if (!empty($groups_failed))
300  {
301  $group_names = $member_handler->getGroupList(new Criteria('groupid', "(".implode(", ", $groups_failed).")", 'IN'));
302  $adduser_errormsg = sprintf(_AM_SYSTEM_USERS_CNRNU2, implode(", ", $group_names));
303  } else
304  {
305  xoops_load("XoopsUserUtility");
307  redirect_header("admin.php?fct=users", 1, _AM_SYSTEM_DBUPDATED);
308  exit();
309  }
310  }
311  }
312  }
313  xoops_error($adduser_errormsg);
314  }
315  break;
316 
317  // Activ member
318  case 'users_active':
319  if (isset($_REQUEST["uid"])) {
320  $obj =& $member_handler->getUser($uid);
321  //echo $_REQUEST["uid"];
322  //print_r($obj);
323  }
324  $obj->setVar("level", 1);
325  if ($member_handler->insertUser($obj, true)) {
326  redirect_header("admin.php?fct=users", 1, _AM_SYSTEM_DBUPDATED);
327  }
328  echo $obj->getHtmlErrors();
329  break;
330 
331  // Synchronize
332  case 'users_synchronize':
333  if (isset($_REQUEST['status']) && $_REQUEST['status'] == 1) {
334  synchronize($$uid, 'user');
335  } else if (isset($_REQUEST['status']) && $_REQUEST['status'] == 2) {
336  synchronize( '', 'all users');
337  }
338  redirect_header("admin.php?fct=users", 1, _AM_SYSTEM_DBUPDATED);
339  break;
340 
341  default:
342  // Search and Display
343  // Define scripts
344  $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');
345  $xoTheme->addScript('browse.php?Frameworks/jquery/plugins/jquery.ui.js');
346  //table sorting does not work with select boxes
347  //$xoTheme->addScript('browse.php?Frameworks/jquery/plugins/jquery.tablesorter.js');
348  $xoTheme->addScript('modules/system/js/admin.js');
349  //Recherche approfondie
350 
351  if (isset($_REQUEST['complet_search']))
352  {
353  // Assign Breadcrumb menu
355  $xoBreadCrumb->addHelp( system_adminVersion('users', 'help') );
357  $xoBreadCrumb->render();
358 
359  $acttotal = $member_handler->getUserCount(new Criteria('level', 0, '>'));
360  $inacttotal = $member_handler->getUserCount(new Criteria('level', 0));
361 
362  //$group_select = new XoopsFormSelectGroup(_AM_SYSTEM_USERS_GROUPS, "selgroups", null, false, 1, false);
363  $group_select = new XoopsFormSelect(_AM_SYSTEM_USERS_GROUPS, "selgroups");
364 
365  $group_handler =& xoops_gethandler('group');
366  $group_arr = $group_handler->getObjects();
367  $group_select->addOption("", "--------------");
368  foreach (array_keys($group_arr) as $i)
369  {
370  if($group_arr[$i]->getVar("groupid") != 3)
371  $group_select->addOption("".$group_arr[$i]->getVar("groupid")."", "".$group_arr[$i]->getVar("name")."");
372  }
373 
374 
375  $uname_text = new XoopsFormText("", "user_uname", 30, 60);
376  $uname_match = new XoopsFormSelectMatchOption("", "user_uname_match");
377  $uname_tray = new XoopsFormElementTray(_AM_SYSTEM_USERS_UNAME, "&nbsp;");
378  $uname_tray->addElement($uname_match);
379  $uname_tray->addElement($uname_text);
380  $name_text = new XoopsFormText("", "user_name", 30, 60);
381  $name_match = new XoopsFormSelectMatchOption("", "user_name_match");
382  $name_tray = new XoopsFormElementTray(_AM_SYSTEM_USERS_REALNAME, "&nbsp;");
383  $name_tray->addElement($name_match);
384  $name_tray->addElement($name_text);
385  $email_text = new XoopsFormText("", "user_email", 30, 60);
386  $email_match = new XoopsFormSelectMatchOption("", "user_email_match");
388  $email_tray->addElement($email_match);
389  $email_tray->addElement($email_text);
390  $url_text = new XoopsFormText(_AM_SYSTEM_USERS_URLC, "user_url", 30, 100);
391  $icq_text = new XoopsFormText("", "user_icq", 30, 100);
392  $icq_match = new XoopsFormSelectMatchOption("", "user_icq_match");
393  $icq_tray = new XoopsFormElementTray(_AM_SYSTEM_USERS_ICQ, "&nbsp;");
394  $icq_tray->addElement($icq_match);
395  $icq_tray->addElement($icq_text);
396  $aim_text = new XoopsFormText("", "user_aim", 30, 100);
397  $aim_match = new XoopsFormSelectMatchOption("", "user_aim_match");
398  $aim_tray = new XoopsFormElementTray(_AM_SYSTEM_USERS_AIM, "&nbsp;");
399  $aim_tray->addElement($aim_match);
400  $aim_tray->addElement($aim_text);
401  $yim_text = new XoopsFormText("", "user_yim", 30, 100);
402  $yim_match = new XoopsFormSelectMatchOption("", "user_yim_match");
403  $yim_tray = new XoopsFormElementTray(_AM_SYSTEM_USERS_YIM, "&nbsp;");
404  $yim_tray->addElement($yim_match);
405  $yim_tray->addElement($yim_text);
406  $msnm_text = new XoopsFormText("", "user_msnm", 30, 100);
407  $msnm_match = new XoopsFormSelectMatchOption("", "user_msnm_match");
408  $msnm_tray = new XoopsFormElementTray(_AM_SYSTEM_USERS_MSNM, "&nbsp;");
409  $msnm_tray->addElement($msnm_match);
410  $msnm_tray->addElement($msnm_text);
411  $location_text = new XoopsFormText(_AM_SYSTEM_USERS_LOCATIONC, "user_from", 30, 100);
412  $occupation_text = new XoopsFormText(_AM_SYSTEM_USERS_OCCUPATIONC, "user_occ", 30, 100);
413  $interest_text = new XoopsFormText(_AM_SYSTEM_USERS_INTERESTC, "user_intrest", 30, 100);
414 
415  $lastlog_more = new XoopsFormText(_AM_SYSTEM_USERS_LASTLOGMORE, "user_lastlog_more", 10, 5);
416  $lastlog_less = new XoopsFormText(_AM_SYSTEM_USERS_LASTLOGLESS, "user_lastlog_less", 10, 5);
417  $reg_more = new XoopsFormText(_AM_SYSTEM_USERS_REGMORE, "user_reg_more", 10, 5);
418  $reg_less = new XoopsFormText(_AM_SYSTEM_USERS_REGLESS, "user_reg_less", 10, 5);
419  $posts_more = new XoopsFormText(_AM_SYSTEM_USERS_POSTSMORE, "user_posts_more", 10, 5);
420  $posts_less = new XoopsFormText(_AM_SYSTEM_USERS_POSTSLESS, "user_posts_less", 10, 5);
421  $mailok_radio = new XoopsFormRadio(_AM_SYSTEM_USERS_SHOWMAILOK, "user_mailok", "both");
422  $mailok_radio->addOptionArray(array("mailok"=>_AM_SYSTEM_USERS_MAILOK, "mailng"=>_AM_SYSTEM_USERS_MAILNG, "both"=>_AM_SYSTEM_USERS_BOTH));
423  $type_radio = new XoopsFormRadio(_AM_SYSTEM_USERS_SHOWTYPE, "user_type", "actv");
424  $type_radio->addOptionArray(array("actv"=>_AM_SYSTEM_USERS_ACTIVE, "inactv"=>_AM_SYSTEM_USERS_INACTIVE, "both"=>_AM_SYSTEM_USERS_BOTH));
425  $sort_select = new XoopsFormSelect(_AM_SYSTEM_USERS_SORT, "user_sort");
426  $sort_select->addOptionArray(array("uname"=>_AM_SYSTEM_USERS_UNAME,"email"=>_AM_SYSTEM_USERS_EMAIL,"last_login"=>_AM_SYSTEM_USERS_LASTLOGIN,"user_regdate"=>_AM_SYSTEM_USERS_REGDATE,"posts"=>_AM_SYSTEM_USERS_POSTS));
427  $order_select = new XoopsFormSelect(_AM_SYSTEM_USERS_ORDER, "user_order");
428  $order_select->addOptionArray(array("ASC"=>_AM_SYSTEM_USERS_ASC,"DESC"=>_AM_SYSTEM_USERS_DESC));
429  $limit_text = new XoopsFormText(_AM_SYSTEM_USERS_LIMIT, "user_limit", 6, 2, 20);
430  $submit_button = new XoopsFormButton("", "user_submit", _SUBMIT, "submit");
431 
432  $form = new XoopsThemeForm(_AM_SYSTEM_USERS_FINDUS, "uesr_findform", "admin.php?fct=users", 'post', true);
433  $form->addElement($uname_tray);
434  $form->addElement($name_tray);
435  $form->addElement($email_tray);
436  $form->addElement($group_select);
437  $form->addElement($icq_tray);
438  $form->addElement($aim_tray);
439  $form->addElement($yim_tray);
440  $form->addElement($msnm_tray);
441  $form->addElement($url_text);
442  $form->addElement($location_text);
443  $form->addElement($occupation_text);
444  $form->addElement($interest_text);
445  $form->addElement($lastlog_more);
446  $form->addElement($lastlog_less);
447  $form->addElement($reg_more);
448  $form->addElement($reg_less);
449  $form->addElement($posts_more);
450  $form->addElement($posts_less);
451  $form->addElement($mailok_radio);
452  $form->addElement($type_radio);
453  $form->addElement($sort_select);
454  $form->addElement($order_select);
455  $form->addElement($fct_hidden);
456  $form->addElement($limit_text);
457  $form->addElement($op_hidden);
458 
459  // if this is to find users for a specific group
460  if ( !empty($_GET['group']) && intval($_GET['group']) > 0 )
461  {
462  $group_hidden = new XoopsFormHidden("group", intval($_GET['group']));
463  $form->addElement($group_hidden);
464  }
465  $form->addElement($submit_button);
466  $form->display();
467  } else {
468  //Display data
469  // Assign Breadcrumb menu
470  $xoBreadCrumb->addHelp( system_adminVersion('users', 'help') );
472  $xoBreadCrumb->render();
473 
474  $requete_search = '<br /><br /><strong>See search request: </strong><br /><br />';
475  $requete_pagenav = '';
476 
477  $criteria = new CriteriaCompo();
478  if ( !empty($_REQUEST['user_uname']) ) {
479  $match = (!empty($_REQUEST['user_uname_match'])) ? intval($_REQUEST['user_uname_match']) : XOOPS_MATCH_START;
480  switch ($match) {
481  case XOOPS_MATCH_START:
482  $criteria->add(new Criteria('uname', $myts->addSlashes(trim($_REQUEST['user_uname'])).'%', 'LIKE'));
483  break;
484  case XOOPS_MATCH_END:
485  $criteria->add(new Criteria('uname', '%'.$myts->addSlashes(trim($_REQUEST['user_uname'])), 'LIKE'));
486  break;
487  case XOOPS_MATCH_EQUAL:
488  $criteria->add(new Criteria('uname', $myts->addSlashes(trim($_REQUEST['user_uname']))));
489  break;
490  case XOOPS_MATCH_CONTAIN:
491  $criteria->add(new Criteria('uname', '%'.$myts->addSlashes(trim($_REQUEST['user_uname'])).'%', 'LIKE'));
492  break;
493  }
494  $requete_pagenav .= '&amp;user_uname='. htmlspecialchars($_REQUEST["user_uname"]) .'&amp;user_uname_match='. htmlspecialchars($_REQUEST['user_uname_match']);
495  $requete_search .= 'uname : '.$_REQUEST['user_uname'].' et user_uname_match='.$_REQUEST['user_uname_match'].'<br />';
496  }
497  if ( !empty($_REQUEST['user_name']) ) {
498  $match = (!empty($_REQUEST['user_name_match'])) ? intval($_REQUEST['user_name_match']) : XOOPS_MATCH_START;
499  switch ($match) {
500  case XOOPS_MATCH_START:
501  $criteria->add(new Criteria('name', $myts->addSlashes(trim($_REQUEST['user_name'])).'%', 'LIKE'));
502  break;
503  case XOOPS_MATCH_END:
504  $criteria->add(new Criteria('name', '%'.$myts->addSlashes(trim($_REQUEST['user_name'])), 'LIKE'));
505  break;
506  case XOOPS_MATCH_EQUAL:
507  $criteria->add(new Criteria('name', $myts->addSlashes(trim($_REQUEST['user_name']))));
508  break;
509  case XOOPS_MATCH_CONTAIN:
510  $criteria->add(new Criteria('name', '%'.$myts->addSlashes(trim($_POST['user_name'])).'%', 'LIKE'));
511  break;
512  }
513  $requete_pagenav .= '&amp;user_name='. htmlspecialchars($_REQUEST["user_name"]) .'&amp;user_name_match='. htmlspecialchars($_REQUEST['user_name_match']);
514  $requete_search .= 'name : '.$_REQUEST['user_name'].' et user_name_match='.$_REQUEST['user_name_match'].'<br />';
515  }
516  if ( !empty($_REQUEST['user_email']) ) {
517  $match = (!empty($_REQUEST['user_email_match'])) ? intval($_REQUEST['user_email_match']) : XOOPS_MATCH_START;
518  switch ($match) {
519  case XOOPS_MATCH_START:
520  $criteria->add(new Criteria('email', $myts->addSlashes(trim($_REQUEST['user_email'])).'%', 'LIKE'));
521  break;
522  case XOOPS_MATCH_END:
523  $criteria->add(new Criteria('email', '%'.$myts->addSlashes(trim($_REQUEST['user_email'])), 'LIKE'));
524  break;
525  case XOOPS_MATCH_EQUAL:
526  $criteria->add(new Criteria('email', $myts->addSlashes(trim($_REQUEST['user_email']))));
527  break;
528  case XOOPS_MATCH_CONTAIN:
529  $criteria->add(new Criteria('email', '%'.$myts->addSlashes(trim($_REQUEST['user_email'])).'%', 'LIKE'));
530  break;
531  }
532  $requete_pagenav .= '&amp;user_email='. htmlspecialchars($_REQUEST["user_email"]) .'&amp;user_email_match='. htmlspecialchars($_REQUEST['user_email_match']);
533  $requete_search .= 'email : '.$_REQUEST['user_email'].' et user_email_match='.$_REQUEST['user_email_match'].'<br />';
534  }
535  if ( !empty($_REQUEST['user_url']) ) {
536  $url = formatURL(trim($_REQUEST['user_url']));
537  $criteria->add(new Criteria('url','%'. $myts->addSlashes($url) .'%', 'LIKE'));
538  $requete_pagenav .= '&amp;user_url='. htmlspecialchars($_REQUEST["user_url"]);
539  $requete_search .= 'url : '.$_REQUEST['user_url'].'<br />';
540  }
541  if ( !empty($_REQUEST['user_icq']) ) {
542  $match = (!empty($_REQUEST['user_icq_match'])) ? intval($_REQUEST['user_icq_match']) : XOOPS_MATCH_START;
543  switch ($match) {
544  case XOOPS_MATCH_START:
545  $criteria->add(new Criteria('user_icq', $myts->addSlashes(trim($_REQUEST['user_icq'])).'%', 'LIKE'));
546  break;
547  case XOOPS_MATCH_END:
548  $criteria->add(new Criteria('user_icq', '%'.$myts->addSlashes(trim($_REQUEST['user_icq'])), 'LIKE'));
549  break;
550  case XOOPS_MATCH_EQUAL:
551  $criteria->add(new Criteria('user_icq', $myts->addSlashes(trim($_REQUEST['user_icq']))));
552  break;
553  case XOOPS_MATCH_CONTAIN:
554  $criteria->add(new Criteria('user_icq', '%'.$myts->addSlashes(trim($_REQUEST['user_icq'])).'%', 'LIKE'));
555  break;
556  }
557  $requete_pagenav .= '&amp;user_icq='. htmlspecialchars($_REQUEST["user_icq"]) .'&amp;user_icq_match='. htmlspecialchars($_REQUEST['user_icq_match']);
558  $requete_search .= 'icq : '.$_REQUEST['user_icq'].' et user_icq_match='.$_REQUEST['user_icq_match'].'<br />';
559  }
560  if ( !empty($_REQUEST['user_aim']) ) {
561  $match = (!empty($_REQUEST['user_aim_match'])) ? intval($_REQUEST['user_aim_match']) : XOOPS_MATCH_START;
562  switch ($match) {
563  case XOOPS_MATCH_START:
564  $criteria->add(new Criteria('user_aim', $myts->addSlashes(trim($_REQUEST['user_aim'])).'%', 'LIKE'));
565  break;
566  case XOOPS_MATCH_END:
567  $criteria->add(new Criteria('user_aim', '%'.$myts->addSlashes(trim($_REQUEST['user_aim'])), 'LIKE'));
568  break;
569  case XOOPS_MATCH_EQUAL:
570  $criteria->add(new Criteria('user_aim', $myts->addSlashes(trim($_REQUEST['user_aim']))));
571  break;
572  case XOOPS_MATCH_CONTAIN:
573  $criteria->add(new Criteria('user_aim', '%'.$myts->addSlashes(trim($_REQUEST['user_aim'])).'%', 'LIKE'));
574  break;
575  }
576  $requete_pagenav .= '&amp;user_aim='. htmlspecialchars($_REQUEST["user_aim"]) .'&amp;user_aim_match='. htmlspecialchars($_REQUEST['user_aim_match']);
577  $requete_search .= 'aim : '.$_REQUEST['user_aim'].' et user_aim_match='.$_REQUEST['user_aim_match'].'<br />';
578  }
579  if ( !empty($_REQUEST['user_yim']) ) {
580  $match = (!empty($_REQUEST['user_yim_match'])) ? intval($_REQUEST['user_yim_match']) : XOOPS_MATCH_START;
581  switch ($match) {
582  case XOOPS_MATCH_START:
583  $criteria->add(new Criteria('user_yim', $myts->addSlashes(trim($_REQUEST['user_yim'])).'%', 'LIKE'));
584  break;
585  case XOOPS_MATCH_END:
586  $criteria->add(new Criteria('user_yim', '%'.$myts->addSlashes(trim($_REQUEST['user_yim'])), 'LIKE'));
587  break;
588  case XOOPS_MATCH_EQUAL:
589  $criteria->add(new Criteria('user_yim', $myts->addSlashes(trim($_REQUEST['user_yim']))));
590  break;
591  case XOOPS_MATCH_CONTAIN:
592  $criteria->add(new Criteria('user_yim', '%'.$myts->addSlashes(trim($_REQUEST['user_yim'])).'%', 'LIKE'));
593  break;
594  }
595  $requete_pagenav .= '&amp;user_yim='. htmlspecialchars($_REQUEST["user_yim"]) .'&amp;user_yim_match='. htmlspecialchars($_REQUEST['user_yim_match']);
596  $requete_search .= 'yim : '.$_REQUEST['user_yim'].' et user_yim_match='.$_REQUEST['user_yim_match'].'<br />';
597  }
598  if ( !empty($_REQUEST['user_msnm']) ) {
599  $match = (!empty($_REQUEST['user_msnm_match'])) ? intval($_REQUEST['user_msnm_match']) : XOOPS_MATCH_START;
600  switch ($match) {
601  case XOOPS_MATCH_START:
602  $criteria->add(new Criteria('user_msnm', $myts->addSlashes(trim($_REQUEST['user_msnm'])).'%', 'LIKE'));
603  break;
604  case XOOPS_MATCH_END:
605  $criteria->add(new Criteria('user_msnm', '%'.$myts->addSlashes(trim($_REQUEST['user_msnm'])), 'LIKE'));
606  break;
607  case XOOPS_MATCH_EQUAL:
608  $criteria->add(new Criteria('user_msnm', $myts->addSlashes(trim($_REQUEST['user_msnm']))));
609  break;
610  case XOOPS_MATCH_CONTAIN:
611  $criteria->add(new Criteria('user_msnm', '%'.$myts->addSlashes(trim($_REQUEST['user_msnm'])).'%', 'LIKE'));
612  break;
613  }
614  $requete_pagenav .= '&amp;user_msnm='. htmlspecialchars($_REQUEST["user_msnm"]) .'&amp;user_msnm_match='. htmlspecialchars($_REQUEST['user_msnm_match']);
615  $requete_search .= 'msn : '.$_REQUEST['user_msnm'].' et user_msnm_match='.$_REQUEST['user_msnm_match'].'<br />';
616  }
617 
618  if ( !empty($_REQUEST['user_from']) ) {
619  $criteria->add(new Criteria('user_from', '%'.$myts->addSlashes(trim($_REQUEST['user_from'])).'%', 'LIKE'));
620  $requete_pagenav .= '&amp;user_from='. htmlspecialchars($_REQUEST["user_from"]);
621  $requete_search .= 'from : '.$_REQUEST['user_from'].'<br />';
622  }
623 
624  if ( !empty($_REQUEST['user_intrest']) ) {
625  $criteria->add(new Criteria('user_intrest', '%'.$myts->addSlashes(trim($_REQUEST['user_intrest'])).'%', 'LIKE'));
626  $requete_pagenav .= '&amp;user_intrest='. htmlspecialchars($_REQUEST["user_intrest"]);
627  $requete_search .= 'interet : '.$_REQUEST['user_intrest'].'<br />';
628  }
629 
630  if ( !empty($_REQUEST['user_occ']) ) {
631  $criteria->add(new Criteria('user_occ', '%'.$myts->addSlashes(trim($_REQUEST['user_occ'])).'%', 'LIKE'));
632  $requete_pagenav .= '&amp;user_occ='. htmlspecialchars($_REQUEST["user_occ"]);
633  $requete_search .= 'location : '.$_REQUEST['user_occ'].'<br />';
634  }
635 
636  if ( !empty($_REQUEST['user_lastlog_more']) && is_numeric($_REQUEST['user_lastlog_more']) ) {
637  $f_user_lastlog_more = intval(trim($_REQUEST['user_lastlog_more']));
638  $time = time() - (60 * 60 * 24 * $f_user_lastlog_more);
639  if ( $time > 0 ) {
640  $criteria->add(new Criteria('last_login', $time, '<'));
641  }
642  $requete_pagenav .= '&amp;user_lastlog_more='. htmlspecialchars($_REQUEST["user_lastlog_more"]);
643  $requete_search .= 'derniere connexion apres : '.$_REQUEST['user_lastlog_more'].'<br />';
644  }
645 
646  if ( !empty($_REQUEST['user_lastlog_less']) && is_numeric($_REQUEST['user_lastlog_less']) ) {
647  $f_user_lastlog_less = intval(trim($_REQUEST['user_lastlog_less']));
648  $time = time() - (60 * 60 * 24 * $f_user_lastlog_less);
649  if ( $time > 0 ) {
650  $criteria->add(new Criteria('last_login', $time, '>'));
651  }
652  $requete_pagenav .= '&amp;user_lastlog_less='. htmlspecialchars($_REQUEST["user_lastlog_less"]);
653  $requete_search .= 'derniere connexion avant : '.$_REQUEST['user_lastlog_less'].'<br />';
654  }
655 
656  if ( !empty($_REQUEST['user_reg_more']) && is_numeric($_REQUEST['user_reg_more']) ) {
657  $f_user_reg_more = intval(trim($_REQUEST['user_reg_more']));
658  $time = time() - (60 * 60 * 24 * $f_user_reg_more);
659  if ( $time > 0 ) {
660  $criteria->add(new Criteria('user_regdate', $time, '<'));
661  }
662  $requete_pagenav .= '&amp;user_regdate='. htmlspecialchars($_REQUEST["user_regdate"]);
663  $requete_search .= 'enregistre apres : '.$_REQUEST['user_reg_more'].'<br />';
664  }
665 
666  if ( !empty($_REQUEST['user_reg_less']) && is_numeric($_REQUEST['user_reg_less']) ) {
667  $f_user_reg_less = intval($_REQUEST['user_reg_less']);
668  $time = time() - (60 * 60 * 24 * $f_user_reg_less);
669  if ( $time > 0 ) {
670  $criteria->add(new Criteria('user_regdate', $time, '>'));
671  }
672  $requete_pagenav .= '&amp;user_reg_less='. htmlspecialchars($_REQUEST["user_reg_less"]);
673  $requete_search .= 'enregistre avant : '.$_REQUEST['user_reg_less'].'<br />';
674  }
675 
676  if ( !empty($_REQUEST['user_posts_more']) && is_numeric($_REQUEST['user_posts_more']) ) {
677  $criteria->add(new Criteria('posts', intval($_REQUEST['user_posts_more']), '>'));
678  $requete_pagenav .= '&amp;user_posts_more='. htmlspecialchars($_REQUEST["user_posts_more"]);
679  $requete_search .= 'posts plus de : '.$_REQUEST['user_posts_more'].'<br />';
680  }
681 
682  if ( !empty($_REQUEST['user_posts_less']) && is_numeric($_REQUEST['user_posts_less']) ) {
683  $criteria->add(new Criteria('posts', intval($_REQUEST['user_posts_less']), '<'));
684  $requete_pagenav .= '&amp;user_posts_less='. htmlspecialchars($_REQUEST["user_posts_less"]);
685  $requete_search .= 'post moins de : '.$_REQUEST['user_posts_less'].'<br />';
686  }
687 
688  if ( isset($_REQUEST['user_mailok']) ) {
689  if ( $_REQUEST['user_mailok'] == "mailng" ) {
690  $criteria->add(new Criteria('user_mailok', 0));
691  } elseif ( $_REQUEST['user_mailok'] == "mailok" ) {
692  $criteria->add(new Criteria('user_mailok', 1));
693  } else {
694  $criteria->add(new Criteria('user_mailok', 0, '>='));
695  }
696  $requete_pagenav .= '&amp;user_mailok='. htmlspecialchars($_REQUEST["user_mailok"]);
697  $requete_search .= 'accept email : '.$_REQUEST['user_mailok'].'<br />';
698  }
699 
700  if ( isset($_REQUEST['user_type']) && !empty($_REQUEST['user_type']) ) {
701  if ( $_REQUEST['user_type'] == 'inactv' ) {
702  $criteria->add(new Criteria('level', 0, '='));
703  $user_type = 'inactv';
704  $requete_search .= 'actif ou inactif : inactif<br />';
705  } elseif ( $_REQUEST['user_type'] == "actv" ) {
706  $criteria->add(new Criteria('level', 0, '>'));
707  $user_type = 'actv';
708  $requete_search .= 'actif ou inactif : actif<br />';
709  }
710  $requete_pagenav .= '&amp;user_type='. htmlspecialchars($_REQUEST["user_type"]);
711  } else {
712  $criteria->add(new Criteria('level', 0, '>='));
713  $user_type = '';
714  $requete_search .= 'actif ou inactif : admin et user<br />';
715  }
716 
717  //$groups = empty($_REQUEST['selgroups']) ? array() : array_map("intval", $_REQUEST['selgroups']);
718  $validsort = array("uname", "email", "last_login", "user_regdate", "posts");
719  if ( isset($_REQUEST['user_sort']) ) {
720  $sort = (!in_array($_REQUEST['user_sort'], $validsort)) ? "user_regdate" : $_REQUEST['user_sort'];
721  $requete_pagenav .= '&amp;user_sort='. htmlspecialchars($_REQUEST["user_sort"]);
722  $requete_search .= 'order by : '.$sort.'<br />';
723  } else {
724  $sort = "user_regdate";
725  $requete_pagenav .= '&amp;user_sort=user_regdate';
726  $requete_search .= 'order by : '.$sort.'<br />';
727  }
728 
729  $order = "DESC";
730  if ( isset($_REQUEST['user_order']) && $_REQUEST['user_order'] == "ASC") {
731  $requete_pagenav .= '&amp;user_order=ASC';
732  $requete_search .= 'tris : '.$order.'<br />';
733  } else {
734  //$order = "ASC";
735  $requete_pagenav .= '&amp;user_order=DESC';
736  $requete_search .= 'tris : '.$order.'<br />';
737  }
738 
739  $user_limit = xoops_getModuleOption('users_pager', 'system');
740  if (isset($_REQUEST['user_limit'])) {
741  $user_limit = $_REQUEST['user_limit'];
742  $requete_pagenav .= '&amp;user_limit='. htmlspecialchars($_REQUEST['user_limit']);
743  $requete_search .= 'limit : '.$user_limit.'<br />';
744  } else {
745  $requete_pagenav .= '&amp;user_limit=' . xoops_getModuleOption('users_pager', 'system');
746  $requete_search .= 'limit : '.$user_limit.'<br />';
747  }
748 
749  $start = (!empty($_REQUEST['start'])) ? intval($_REQUEST['start']) : 0;
750 
751  if ( isset($_REQUEST['selgroups']) ) {
752  if($_REQUEST['selgroups'] != 0) {
753  if ( count($_REQUEST['selgroups']) == 1 ) {
754  $groups = array( 0 => $_REQUEST['selgroups']);
755  } else {
756  $groups = array_map("intval", $_REQUEST['selgroups']);
757  }
758  } else {
759  $groups = array();
760  }
761  $requete_pagenav .= '&amp;selgroups='. htmlspecialchars($_REQUEST['selgroups']);
762  } else {
763  $groups = array();
764  }
765  //print_r($groups);
766  $member_handler =& xoops_gethandler('member');
767 
768  if (empty($groups)) {
769  $users_count = $member_handler->getUserCount();
770  } else {
771  $users_count = $member_handler->getUserCountByGroupLink($groups, $criteria);
772  }
773  if ( $start < $users_count ) {
774  echo sprintf(_AM_SYSTEM_USERS_USERSFOUND, $users_count)."<br />";
775  $criteria->setSort($sort);
776  $criteria->setOrder($order);
777  $criteria->setLimit($user_limit);
778  $criteria->setStart($start);
779  $users_arr = $member_handler->getUsersByGroupLink($groups, $criteria, true);
780  $ucount = 0;
781  }
782 
783  $xoopsTpl->assign( 'users_count', $users_count );
784  $xoopsTpl->assign( 'users_display', true );
785  $xoopsTpl->assign( 'php_selft', $_SERVER['PHP_SELF'] );
786 
787  //User limit
788  //$user_limit = (!isset($_REQUEST['user_limit'])) ? 20 : $_REQUEST['user_limit'];
789  //User type
790  $user_type = (!isset($_REQUEST['user_type'])) ? '' : $_REQUEST['user_type'];
791  //selgroups
792  $selgroups = (!isset($_REQUEST['selgroups'])) ? '' : $_REQUEST['selgroups'];
793 
794  $user_uname = (!isset($_REQUEST['user_uname'])) ? '' : $_REQUEST['user_uname'];
795  //Form tris
796  $form = '<form action="admin.php?fct=users" method="post">
797  '._AM_SYSTEM_USERS_SEARCH_USER.'<input type="text" name="user_uname" value="'.$myts->htmlSpecialChars($user_uname).'" size="15">
798  <select name="selgroups">
799  <option value="" selected="selected">'._AM_SYSTEM_USERS_ALLGROUP.'</option>';
800  $group_handler =& xoops_gethandler('group');
801  $group_arr = $group_handler->getObjects();
802  foreach (array_keys($group_arr) as $i)
803  {
804  if($group_arr[$i]->getVar("groupid") != 3)
805  $form .= '<option value="'.$group_arr[$i]->getVar("groupid").'" '.($selgroups == $group_arr[$i]->getVar("groupid") ? ' selected="selected"' : '').'>'.$group_arr[$i]->getVar("name").'</option>';
806  }
807  $form .= '</select>&nbsp;
808  <select name="user_type">
809  <option value="" '.($user_type == '' ? ' selected="selected"' : '').'>'._AM_SYSTEM_USERS_ALLUSER.'</option>
810  <option value="actv" '.($user_type == 'actv' ? ' selected="selected"' : '').'>'._AM_SYSTEM_USERS_ACTIVEUSER.'</option>
811  <option value="inactv" '.($user_type == 'inactv' ? ' selected="selected"' : '').'>'._AM_SYSTEM_USERS_INACTIVEUSER.'</option>
812  </select>&nbsp;
813  <select name="user_limit">
814  <option value="20" '.($user_limit == 20 ? ' selected="selected"' : '').'>20</option>
815  <option value="50" '.($user_limit == 50 ? ' selected="selected"' : '').'>50</option>
816  <option value="100" '.($user_limit == 100 ? ' selected="selected"' : '').'>100</option>
817  </select>&nbsp;
818  <input type="hidden" name="user_uname_match" value="XOOPS_MATCH_START" />
819  <input type="submit" value="'._AM_SYSTEM_USERS_SEARCH.'" name="speed_search">&nbsp;
820  <input type="submit" value="'._AM_SYSTEM_USERS_ADVANCED_SEARCH.'" name="complet_search"></form>
821  ';
822 
823  //select groupe
824  $form_select_groups = '<select name="selgroups" id="selgroups" style="display:none;"><option value="">---------</option>';
825  //$module_array[0] = _AM_SYSTEM_USERS_COMMENTS_FORM_ALL_MODS;
826  $group_handler =& xoops_gethandler('group');
827  $group_arr = $group_handler->getObjects();
828  foreach (array_keys($group_arr) as $i)
829  {
830  if($group_arr[$i]->getVar("groupid") != 3)
831  $form_select_groups .= '<option value="'.$group_arr[$i]->getVar("groupid").'" '.($selgroups == $group_arr[$i]->getVar("groupid") ? ' selected="selected"' : '').'>'.$group_arr[$i]->getVar("name").'</option>';
832  }
833  $form_select_groups .= '</select><input type="hidden" name="op" value="users_add_delete_group">';
834 
835  $xoopsTpl->assign('form_sort', $form);
836  $xoopsTpl->assign('form_select_groups', $form_select_groups);
837  //echo $requete_search;
838  if ( $users_count > 0 )
839  {
840  //echo $requete_search;
841  foreach (array_keys($users_arr) as $i)
842  {
843  $users['uid'] = $users_arr[$i]->getVar("uid");
844  //Display group
845  $user_group = $member_handler->getGroupsByUser($users_arr[$i]->getVar("uid"));
846  if(in_array ("1", $user_group)) {
847  $users['group'] = system_AdminIcons('xoops/group_1.png');
848  //$users['icon'] = '<img src="'.XOOPS_URL.'/modules/system/images/icons/admin.png" alt="'._AM_SYSTEM_USERS_ADMIN.'" title="'._AM_SYSTEM_USERS_ADMIN.'" />';
849  $users['checkbox_user'] = false;
850  } else {
851  $users['group'] = system_AdminIcons('xoops/group_2.png');
852  //$users['icon'] = '<img src="'.XOOPS_URL.'/modules/system/images/icons/user.png" alt="'._AM_SYSTEM_USERS_USER.'" title="'._AM_SYSTEM_USERS_USER.'" />';
853  $users['checkbox_user'] = true;
854  }
855  $users['name'] = $users_arr[$i]->getVar("uid");
856  $users['name'] = $users_arr[$i]->getVar("name");
857  $users['uname'] = $users_arr[$i]->getVar("uname");
858  $users['email'] = $users_arr[$i]->getVar("email");
859  $users['url'] = $users_arr[$i]->getVar("url");
860  $users['user_avatar'] = ($users_arr[$i]->getVar("user_avatar") == 'blank.gif') ? system_AdminIcons('anonymous.png') : XOOPS_URL.'/uploads/'.$users_arr[$i]->getVar("user_avatar");
861  $users['reg_date'] = formatTimestamp($users_arr[$i]->getVar("user_regdate"),"m");
862  if ($users_arr[$i]->getVar("last_login") > 0 ) {
863  $users['last_login'] = formatTimestamp($users_arr[$i]->getVar("last_login"),"m");
864  } else {
865  $users['last_login'] = _AM_SYSTEM_USERS_NOT_CONNECT;
866  }
867  $users['user_level'] = $users_arr[$i]->getVar("level");
868  $users['user_icq'] = $users_arr[$i]->getVar("user_icq");
869  $users['user_aim'] = $users_arr[$i]->getVar("user_aim");
870  $users['user_yim'] = $users_arr[$i]->getVar("user_yim");
871  $users['user_msnm'] = $users_arr[$i]->getVar("user_msnm");
872 
873  $users['posts'] = $users_arr[$i]->getVar("posts");
874 
875  $xoopsTpl->append_by_ref( 'users', $users );
876  $xoopsTpl->append_by_ref( 'users_popup', $users );
877  unset( $users );
878  }
879  } else {
880  $xoopsTpl->assign( 'users_no_found', true );
881  }
882 
883  if ($users_count > $user_limit) {
884  include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
885  $nav = new XoopsPageNav($users_count, $user_limit, $start, 'start', 'fct=users&amp;op=default'.$requete_pagenav);
886  $xoopsTpl->assign( 'nav', $nav->renderNav() );
887  }
888  }
889  break;
890 }
891 // Call Footer
893 
894 ?>