source: branches/branch-1_6/admin/user_list.php @ 1249

Last change on this file since 1249 was 1249, checked in by nikrou, 18 years ago

bug fixed: popuhelp (slash)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 22.5 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | PhpWebGallery - a PHP based picture gallery                           |
4// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
5// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
6// +-----------------------------------------------------------------------+
7// | branch        : BSF (Best So Far)
8// | file          : $RCSfile$
9// | last update   : $Date: 2006-04-21 21:14:34 +0000 (Fri, 21 Apr 2006) $
10// | last modifier : $Author: nikrou $
11// | revision      : $Revision: 1249 $
12// +-----------------------------------------------------------------------+
13// | This program is free software; you can redistribute it and/or modify  |
14// | it under the terms of the GNU General Public License as published by  |
15// | the Free Software Foundation                                          |
16// |                                                                       |
17// | This program is distributed in the hope that it will be useful, but   |
18// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
19// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
20// | 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, |
25// | USA.                                                                  |
26// +-----------------------------------------------------------------------+
27
28/**
29 * Add users and manage users list
30 */
31
32// +-----------------------------------------------------------------------+
33// |                              functions                                |
34// +-----------------------------------------------------------------------+
35
36/**
37 * returns a list of users depending on page filters (in $_GET)
38 *
39 * Each user comes with his related informations : id, username, mail
40 * address, list of groups.
41 *
42 * @return array
43 */
44function get_filtered_user_list()
45{
46  global $conf, $page;
47
48  $users = array();
49 
50  // filter
51  $filter = array();
52 
53  if (isset($_GET['username']) and !empty($_GET['username']))
54  {
55    $username = str_replace('*', '%', $_GET['username']);
56    if (function_exists('mysql_real_escape_string'))
57    {
58      $filter['username'] = mysql_real_escape_string($username);
59    }
60    else
61    {
62      $filter['username'] = mysql_escape_string($username);
63    }
64  }
65
66  if (isset($_GET['group'])
67      and -1 != $_GET['group']
68      and is_numeric($_GET['group']))
69  {
70    $filter['group'] = $_GET['group'];
71  }
72
73  if (isset($_GET['status'])
74      and in_array($_GET['status'], get_enums(USER_INFOS_TABLE, 'status')))
75  {
76    $filter['status'] = $_GET['status'];
77  }
78
79  // how to order the list?
80  $order_by = 'id';
81  if (isset($_GET['order_by'])
82      and in_array($_GET['order_by'], array_keys($page['order_by_items'])))
83  {
84    $order_by = $_GET['order_by'];
85  }
86 
87  $direction = 'ASC';
88  if (isset($_GET['direction'])
89      and in_array($_GET['direction'], array_keys($page['direction_items'])))
90  {
91    $direction = strtoupper($_GET['direction']);
92  }
93
94  // search users depending on filters and order
95  $query = '
96SELECT DISTINCT u.'.$conf['user_fields']['id'].' AS id,
97                u.'.$conf['user_fields']['username'].' AS username,
98                u.'.$conf['user_fields']['email'].' AS email,
99                ui.status,
100                ui.adviser,
101                ui.enabled_high
102  FROM '.USERS_TABLE.' AS u
103    INNER JOIN '.USER_INFOS_TABLE.' AS ui
104      ON u.'.$conf['user_fields']['id'].' = ui.user_id
105    LEFT JOIN '.USER_GROUP_TABLE.' AS ug
106      ON u.'.$conf['user_fields']['id'].' = ug.user_id
107  WHERE u.'.$conf['user_fields']['id'].' != '.$conf['guest_id'];
108  if (isset($filter['username']))
109  {
110    $query.= '
111  AND u.'.$conf['user_fields']['username'].' LIKE \''.$filter['username'].'\'';
112  }
113  if (isset($filter['group']))
114  {
115    $query.= '
116    AND ug.group_id = '.$filter['group'];
117  }
118  if (isset($filter['status']))
119  {
120    $query.= '
121    AND ui.status = \''.$filter['status']."'";
122  }
123  $query.= '
124  ORDER BY '.$order_by.' '.$direction.'
125;';
126
127  $result = pwg_query($query);
128  while ($row = mysql_fetch_array($result))
129  {
130    $user = $row;
131    $user['groups'] = array();
132
133    array_push($users, $user);
134  }
135
136  // add group lists
137  $user_ids = array();
138  foreach ($users as $i => $user)
139  {
140    $user_ids[$i] = $user['id'];
141  }
142  $user_nums = array_flip($user_ids);
143 
144  if (count($user_ids) > 0)
145  {
146    $query = '
147SELECT user_id, group_id
148  FROM '.USER_GROUP_TABLE.'
149  WHERE user_id IN ('.implode(',', $user_ids).')
150;';
151    $result = pwg_query($query);
152    while ($row = mysql_fetch_array($result))
153    {
154      array_push(
155        $users[$user_nums[$row['user_id']]]['groups'],
156        $row['group_id']
157        );
158    }
159  }
160   
161  return $users;
162}
163
164// +-----------------------------------------------------------------------+
165// |                           initialization                              |
166// +-----------------------------------------------------------------------+
167
168if (!defined('PHPWG_ROOT_PATH'))
169{
170  die('Hacking attempt!');
171}
172
173include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
174
175// +-----------------------------------------------------------------------+
176// | Check Access and exit when user status is not ok                      |
177// +-----------------------------------------------------------------------+
178check_status(ACCESS_ADMINISTRATOR);
179
180$page['order_by_items'] = array(
181  'id' => $lang['registration_date'],
182  'username' => $lang['Username']
183  );
184
185$page['direction_items'] = array(
186  'asc' => $lang['ascending'],
187  'desc' => $lang['descending']
188  );
189
190// +-----------------------------------------------------------------------+
191// |                              add a user                               |
192// +-----------------------------------------------------------------------+
193
194if (isset($_POST['submit_add']))
195{
196  $page['errors'] = register_user($_POST['login'], $_POST['password'], '');
197
198  if (count($page['errors']) == 0)
199  {
200    array_push(
201      $page['infos'],
202      sprintf(
203        l10n('user "%s" added'),
204        $_POST['login']
205        )
206      );
207  }
208}
209
210// +-----------------------------------------------------------------------+
211// |                               user list                               |
212// +-----------------------------------------------------------------------+
213
214$page['filtered_users'] = get_filtered_user_list();
215
216// +-----------------------------------------------------------------------+
217// |                            selected users                             |
218// +-----------------------------------------------------------------------+
219
220if (isset($_POST['delete']) or isset($_POST['pref_submit']))
221{
222  $collection = array();
223 
224  switch ($_POST['target'])
225  {
226    case 'all' :
227    {
228      foreach($page['filtered_users'] as $local_user)
229      {
230        array_push($collection, $local_user['id']);
231      }
232      break;
233    }
234    case 'selection' :
235    {
236      if (isset($_POST['selection']))
237      {
238        $collection = $_POST['selection'];
239      }
240      break;
241    }
242  }
243
244  if (count($collection) == 0)
245  {
246    array_push($page['errors'], l10n('Select at least one user'));
247  }
248}
249
250// +-----------------------------------------------------------------------+
251// |                             delete users                              |
252// +-----------------------------------------------------------------------+
253
254if (isset($_POST['delete']) and count($collection) > 0)
255{
256  if (in_array($conf['webmaster_id'], $collection))
257  {
258    array_push($page['errors'], l10n('Webmaster cannot be deleted'));
259  }
260  else
261  {
262    if (isset($_POST['confirm_deletion']) and 1 == $_POST['confirm_deletion'])
263    {
264      foreach ($collection as $user_id)
265      {
266        delete_user($user_id);
267      }
268      array_push(
269        $page['infos'],
270        sprintf(
271          l10n('%d users deleted'),
272          count($collection) 
273          )
274        );
275      foreach ($page['filtered_users'] as $filter_key => $filter_user)
276      {
277        if (in_array($filter_user['id'], $collection))
278        {
279          unset($page['filtered_users'][$filter_key]);
280        }
281      }
282    }
283    else
284    {
285      array_push($page['errors'], l10n('You need to confirm deletion'));
286    }
287  }
288}
289
290// +-----------------------------------------------------------------------+
291// |                       preferences form submission                     |
292// +-----------------------------------------------------------------------+
293
294if (isset($_POST['pref_submit']) and count($collection) > 0)
295{
296  if (-1 != $_POST['associate'])
297  {
298    $datas = array();
299   
300    $query = '
301SELECT user_id
302  FROM '.USER_GROUP_TABLE.'
303  WHERE group_id = '.$_POST['associate'].'
304;';
305    $associated = array_from_query($query, 'user_id');
306   
307    $associable = array_diff($collection, $associated);
308   
309    if (count($associable) > 0)
310    {
311      foreach ($associable as $item)
312      {
313        array_push($datas,
314                   array('group_id'=>$_POST['associate'],
315                         'user_id'=>$item));
316      }
317       
318      mass_inserts(USER_GROUP_TABLE,
319                   array('group_id', 'user_id'),
320                   $datas);
321    }
322  }
323 
324  if (-1 != $_POST['dissociate'])
325  {
326    $query = '
327DELETE FROM '.USER_GROUP_TABLE.'
328  WHERE group_id = '.$_POST['dissociate'].'
329  AND user_id IN ('.implode(',', $collection).')
330';
331    pwg_query($query);
332  }
333 
334  // properties to set for the collection (a user list)
335  $datas = array();
336  $dbfields = array('primary' => array('user_id'), 'update' => array());
337 
338  $formfields =
339    array('nb_image_line', 'nb_line_page', 'template', 'language',
340          'recent_period', 'maxwidth', 'expand', 'show_nb_comments',
341          'maxheight', 'status', 'enabled_high');
342 
343  $true_false_fields = array('expand', 'show_nb_comments', 'enabled_high');
344  if ($conf['allow_adviser'])
345  {
346    array_push($formfields, 'adviser');
347    array_push($true_false_fields, 'adviser');
348  }
349 
350  foreach ($formfields as $formfield)
351  {
352    // special for true/false fields
353    if (in_array($formfield, $true_false_fields))
354    {
355      $test = $formfield;
356    }
357    else
358    {
359      $test = $formfield.'_action';
360    }
361   
362    if ($_POST[$test] != 'leave')
363    {
364      array_push($dbfields['update'], $formfield);
365    }
366  }
367 
368  // updating elements is useful only if needed...
369  if (count($dbfields['update']) > 0)
370  {
371    $datas = array();
372   
373    foreach ($collection as $user_id)
374    {
375      $data = array();
376      $data['user_id'] = $user_id;
377     
378      // TODO : verify if submited values are semanticaly correct
379      foreach ($dbfields['update'] as $dbfield)
380      {
381        // if the action is 'unset', the key won't be in row and
382        // mass_updates function will set this field to NULL
383        if (in_array($dbfield, $true_false_fields)
384            or 'set' == $_POST[$dbfield.'_action'])
385        {
386          $data[$dbfield] = $_POST[$dbfield];
387        }
388      }
389
390      // Webmaster status must not be changed
391      if ($conf['webmaster_id'] == $user_id and isset($data['status']))
392      {
393        $data['status'] = 'webmaster';
394      }
395
396      // Webmaster and guest adviser must not be changed
397      if ((($conf['webmaster_id'] == $user_id) or ($conf['guest_id'] == $user_id)) and isset($data['adviser']))
398      {
399        $data['adviser'] = 'false';
400      }
401
402      array_push($datas, $data);
403    }
404   
405    mass_updates(USER_INFOS_TABLE, $dbfields, $datas);
406  }
407
408  redirect(
409    PHPWG_ROOT_PATH.
410    'admin.php'.
411    get_query_string_diff(
412      array(
413        'start'
414        )
415      )
416    );
417}
418
419// +-----------------------------------------------------------------------+
420// |                              groups list                              |
421// +-----------------------------------------------------------------------+
422
423$groups = array();
424
425$query = '
426SELECT id, name
427  FROM '.GROUPS_TABLE.'
428;';
429$result = pwg_query($query);
430
431while ($row = mysql_fetch_array($result))
432{
433  $groups[$row['id']] = $row['name'];
434}
435
436// +-----------------------------------------------------------------------+
437// |                             template init                             |
438// +-----------------------------------------------------------------------+
439
440$template->set_filenames(array('user_list'=>'admin/user_list.tpl'));
441
442$base_url = PHPWG_ROOT_PATH.'admin.php?page=user_list';
443
444if (isset($_GET['start']) and is_numeric($_GET['start']))
445{
446  $start = $_GET['start'];
447}
448else
449{
450  $start = 0;
451}
452
453$template->assign_vars(
454  array(
455    'L_AUTH_USER'=>$lang['permuser_only_private'],
456    'L_GROUP_ADD_USER' => $lang['group_add_user'],
457    'L_SUBMIT'=>$lang['submit'],
458    'L_STATUS'=>$lang['user_status'],
459    'L_PASSWORD' => $lang['password'],
460    'L_EMAIL' => $lang['mail_address'],
461    'L_ORDER_BY' => $lang['order_by'],
462    'L_ACTIONS' => $lang['actions'],
463    'L_PROPERTIES' => $lang['properties'],
464    'L_PERMISSIONS' => $lang['permissions'],
465    'L_USERS_LIST' => $lang['title_liste_users'],
466    'L_LANGUAGE' => $lang['language'],
467    'L_NB_IMAGE_LINE' => $lang['nb_image_per_row'],
468    'L_NB_LINE_PAGE' => $lang['nb_row_per_page'],
469    'L_TEMPLATE' => $lang['theme'],
470    'L_RECENT_PERIOD' => $lang['recent_period'],
471    'L_EXPAND' => $lang['auto_expand'],
472    'L_SHOW_NB_COMMENTS' => $lang['show_nb_comments'],
473    'L_MAXWIDTH' => $lang['maxwidth'],
474    'L_MAXHEIGHT' => $lang['maxheight'],
475    'L_YES' => $lang['yes'],
476    'L_NO' => $lang['no'],
477    'L_SUBMIT' => $lang['submit'],
478    'L_RESET' => $lang['reset'],
479    'L_DELETE' => $lang['user_delete'],
480    'L_DELETE_HINT' => $lang['user_delete_hint'],
481
482    'U_HELP' => PHPWG_ROOT_PATH.'popuphelp.php?page=user_list',
483   
484    'F_ADD_ACTION' => $base_url,
485    'F_USERNAME' => @$_GET['username'],
486    'F_FILTER_ACTION' => PHPWG_ROOT_PATH.'admin.php'
487    ));
488
489if (isset($_GET['id']))
490{
491  $template->assign_block_vars('session', array('ID' => $_GET['id']));
492}
493
494// Hide radio-button if not allow to assign adviser
495if ($conf['allow_adviser'])
496{
497  $template->assign_block_vars('adviser', array());
498}
499
500foreach ($page['order_by_items'] as $item => $label)
501{
502  $selected = (isset($_GET['order_by']) and $_GET['order_by'] == $item) ?
503    'selected="selected"' : '';
504  $template->assign_block_vars(
505    'order_by',
506    array(
507      'VALUE' => $item,
508      'CONTENT' => $label,
509      'SELECTED' => $selected
510      ));
511}
512
513foreach ($page['direction_items'] as $item => $label)
514{
515  $selected = (isset($_GET['direction']) and $_GET['direction'] == $item) ?
516    'selected="selected"' : '';
517  $template->assign_block_vars(
518    'direction',
519    array(
520      'VALUE' => $item,
521      'CONTENT' => $label,
522      'SELECTED' => $selected
523      ));
524}
525
526$blockname = 'group_option';
527
528$template->assign_block_vars(
529  $blockname,
530  array(
531    'VALUE'=> -1,
532    'CONTENT' => '------------',
533    'SELECTED' => ''
534    ));
535
536foreach ($groups as $group_id => $group_name)
537{
538  $selected = (isset($_GET['group']) and $_GET['group'] == $group_id) ?
539    'selected="selected"' : '';
540  $template->assign_block_vars(
541    $blockname,
542    array(
543      'VALUE' => $group_id,
544      'CONTENT' => $group_name,
545      'SELECTED' => $selected
546      ));
547}
548
549$blockname = 'status_option';
550
551$template->assign_block_vars(
552  $blockname,
553  array(
554    'VALUE'=> -1,
555    'CONTENT' => '------------',
556    'SELECTED' => ''
557    ));
558
559foreach (get_enums(USER_INFOS_TABLE, 'status') as $status)
560{
561  $selected = (isset($_GET['status']) and $_GET['status'] == $status) ?
562    'selected="selected"' : '';
563  $template->assign_block_vars(
564    $blockname,
565    array(
566      'VALUE' => $status,
567      'CONTENT' => $lang['user_status_'.$status],
568      'SELECTED' => $selected
569      ));
570}
571
572// ---
573//   $user['template'] = $conf['default_template'];
574//   $user['nb_image_line'] = $conf['nb_image_line'];
575//   $user['nb_line_page'] = $conf['nb_line_page'];
576//   $user['language'] = $conf['default_language'];
577//   $user['maxwidth'] = $conf['default_maxwidth'];
578//   $user['maxheight'] = $conf['default_maxheight'];
579//   $user['recent_period'] = $conf['recent_period'];
580//   $user['expand'] = $conf['auto_expand'];
581//   $user['show_nb_comments'] = $conf['show_nb_comments'];
582// ---
583
584if (isset($_POST['pref_submit']))
585{
586//  echo '<pre>'; print_r($_POST); echo '</pre>';
587  $template->assign_vars(
588    array(
589      'ADVISER_YES' => 'true' == (isset($_POST['adviser']) and $_POST['adviser']) ? 'checked="checked"' : '',
590      'ADVISER_NO' => 'false' == (isset($_POST['adviser']) and $_POST['adviser']) ? 'checked="checked"' : '',
591      'NB_IMAGE_LINE' => $_POST['nb_image_line'],
592      'NB_LINE_PAGE' => $_POST['nb_line_page'],
593      'MAXWIDTH' => $_POST['maxwidth'],
594      'MAXHEIGHT' => $_POST['maxheight'],
595      'RECENT_PERIOD' => $_POST['recent_period'],
596      'EXPAND_YES' => 'true' == $_POST['expand'] ? 'checked="checked"' : '',
597      'EXPAND_NO' => 'false' == $_POST['expand'] ? 'checked="checked"' : '',
598      'SHOW_NB_COMMENTS_YES' =>
599        'true' == $_POST['show_nb_comments'] ? 'checked="checked"' : '',
600      'SHOW_NB_COMMENTS_NO' =>
601        'false' == $_POST['show_nb_comments'] ? 'checked="checked"' : '',
602      'ENABLED_HIGH_YES' => 'true' == $_POST['enabled_high'] ? 'checked="checked"' : '',
603      'ENABLED_HIGH_NO' => 'false' == $_POST['enabled_high'] ? 'checked="checked"' : '',
604      ));
605}
606else
607{
608  $template->assign_vars(
609    array(
610      'NB_IMAGE_LINE' => $conf['nb_image_line'],
611      'NB_LINE_PAGE' => $conf['nb_line_page'],
612      'MAXWIDTH' => @$conf['default_maxwidth'],
613      'MAXHEIGHT' => @$conf['default_maxheight'],
614      'RECENT_PERIOD' => $conf['recent_period'],
615      ));
616}
617
618$blockname = 'template_option';
619
620foreach (get_pwg_themes() as $pwg_template)
621{
622  if (isset($_POST['pref_submit']))
623  {
624    $selected = $_POST['template']==$pwg_template ? 'selected="selected"' : '';
625  }
626  else if ($conf['default_template'] == $pwg_template)
627  {
628    $selected = 'selected="selected"';
629  }
630  else
631  {
632    $selected = '';
633  }
634 
635  $template->assign_block_vars(
636    $blockname,
637    array(
638      'VALUE'=> $pwg_template,
639      'CONTENT' => $pwg_template,
640      'SELECTED' => $selected
641      ));
642}
643
644$blockname = 'language_option';
645
646foreach (get_languages() as $language_code => $language_name)
647{
648  if (isset($_POST['pref_submit']))
649  {
650    $selected = $_POST['language']==$language_code ? 'selected="selected"':'';
651  }
652  else if ($conf['default_language'] == $language_code)
653  {
654    $selected = 'selected="selected"';
655  }
656  else
657  {
658    $selected = '';
659  }
660 
661  $template->assign_block_vars(
662    $blockname,
663    array(
664      'VALUE'=> $language_code,
665      'CONTENT' => $language_name,
666      'SELECTED' => $selected
667      ));
668}
669
670$blockname = 'pref_status_option';
671
672foreach (get_enums(USER_INFOS_TABLE, 'status') as $status)
673{
674  if (isset($_POST['pref_submit']))
675  {
676    $selected = $_POST['status'] == $status ? 'selected="selected"' : '';
677  }
678  else if ('normal' == $status)
679  {
680    $selected = 'selected="selected"';
681  }
682  else
683  {
684    $selected = '';
685  }
686
687  // Only status <= can be assign
688  if (is_autorize_status(get_access_type_status($status)))
689  {
690    $template->assign_block_vars(
691      $blockname,
692      array(
693        'VALUE' => $status,
694        'CONTENT' => $lang['user_status_'.$status],
695        'SELECTED' => $selected
696        ));
697  }
698}
699
700// associate
701$blockname = 'associate_option';
702
703$template->assign_block_vars(
704  $blockname,
705  array(
706    'VALUE'=> -1,
707    'CONTENT' => '------------',
708    'SELECTED' => ''
709    ));
710
711foreach ($groups as $group_id => $group_name)
712{
713  if (isset($_POST['pref_submit']))
714  {
715    $selected = $_POST['associate'] == $group_id ? 'selected="selected"' : '';
716  }
717  else
718  {
719    $selected = '';
720  }
721   
722  $template->assign_block_vars(
723    $blockname,
724    array(
725      'VALUE' => $group_id,
726      'CONTENT' => $group_name,
727      'SELECTED' => $selected
728      ));
729}
730
731// dissociate
732$blockname = 'dissociate_option';
733
734$template->assign_block_vars(
735  $blockname,
736  array(
737    'VALUE'=> -1,
738    'CONTENT' => '------------',
739    'SELECTED' => ''
740    ));
741
742foreach ($groups as $group_id => $group_name)
743{
744  if (isset($_POST['pref_submit']))
745  {
746    $selected = $_POST['dissociate'] == $group_id ? 'selected="selected"' : '';
747  }
748  else
749  {
750    $selected = '';
751  }
752   
753  $template->assign_block_vars(
754    $blockname,
755    array(
756      'VALUE' => $group_id,
757      'CONTENT' => $group_name,
758      'SELECTED' => $selected
759      ));
760}
761
762// +-----------------------------------------------------------------------+
763// |                            navigation bar                             |
764// +-----------------------------------------------------------------------+
765
766$url = PHPWG_ROOT_PATH.'admin.php'.get_query_string_diff(array('start'));
767
768$navbar = create_navigation_bar(
769  $url,
770  count($page['filtered_users']),
771  $start,
772  $conf['users_page']
773  );
774
775$template->assign_vars(array('NAVBAR' => $navbar));
776
777// +-----------------------------------------------------------------------+
778// |                               user list                               |
779// +-----------------------------------------------------------------------+
780
781$profile_url = PHPWG_ROOT_PATH.'admin.php?page=profile&amp;user_id=';
782$perm_url = PHPWG_ROOT_PATH.'admin.php?page=user_perm&amp;user_id=';
783
784foreach ($page['filtered_users'] as $num => $local_user)
785{
786  // simulate LIMIT $start, $conf['users_page']
787  if ($num < $start)
788  {
789    continue;
790  }
791  if ($num >= $start + $conf['users_page'])
792  {
793    break;
794  }
795
796  $groups_string = preg_replace(
797    '/(\d+)/e',
798    "\$groups['$1']",
799    implode(
800      ', ',
801      $local_user['groups']
802      )
803    );
804
805  if (isset($_POST['pref_submit'])
806      and isset($_POST['selection'])
807      and in_array($local_user['id'], $_POST['selection']))
808  {
809    $checked = 'checked="checked"';
810  }
811  else
812  {
813    $checked = '';
814  }
815
816  $template->assign_block_vars(
817    'user',
818    array(
819      'CLASS' => ($num % 2 == 1) ? 'row2' : 'row1',
820      'ID' => $local_user['id'],
821      'CHECKED' => $checked,
822      'U_MOD' => $profile_url.$local_user['id'],
823      'U_PERM' => $perm_url.$local_user['id'],
824      'USERNAME' => $local_user['username'],
825      'STATUS' => $lang['user_status_'.$local_user['status']].(($local_user['adviser'] == 'true') ? ' ['.$lang['adviser'].']' : ''),
826      'EMAIL' => isset($local_user['email']) ? $local_user['email'] : '',
827      'GROUPS' => $groups_string,
828      'PROPERTIES' => (isset($local_user['enabled_high']) and ($local_user['enabled_high'] == 'true')) ? $lang['is_high_enabled'] : $lang['is_high_disabled']
829      )
830    );
831}
832
833// +-----------------------------------------------------------------------+
834// |                           html code display                           |
835// +-----------------------------------------------------------------------+
836
837$template->assign_var_from_handle('ADMIN_CONTENT', 'user_list');
838?>
Note: See TracBrowser for help on using the repository browser.