aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--admin.php20
-rw-r--r--admin/user_list.php246
-rw-r--r--doc/ChangeLog7
-rw-r--r--profile.php308
-rw-r--r--template/default/admin/user_list.tpl59
-rw-r--r--template/default/profile.tpl59
6 files changed, 400 insertions, 299 deletions
diff --git a/admin.php b/admin.php
index 185b4f885..60a6b25db 100644
--- a/admin.php
+++ b/admin.php
@@ -50,12 +50,18 @@ else if (isset($_GET['user_id']))
if (isset( $_GET['page'] ))
switch ( $_GET['page'] )
{
- case 'user_list':
- $title = $lang['title_liste_users']; $page_valide = true; break;
- case 'profile':
- $title = $lang['title_user_modify'];
- $page_valide = true;
- break;
+ case 'user_list' :
+ {
+ $title = $lang['title_liste_users'];
+ $page_valide = true;
+ break;
+ }
+ case 'profile' :
+ {
+ $title = $lang['title_user_modify'];
+ $page_valide = true;
+ break;
+ }
case 'user_perm':
$title = $lang['title_user_perm'].' '.$username;
$page_valide = true; break;
@@ -248,7 +254,7 @@ $template->assign_vars(array(
'U_COMMENTS'=>add_session_id($link_start.'comments' ),
'U_CADDIE'=>add_session_id($link_start.'element_set&cat=caddie'),
'U_THUMBNAILS'=>add_session_id($link_start.'thumbnail' ),
- 'U_USERS'=>add_session_id($link_start.'profile' ),
+ 'U_USERS'=>add_session_id($link_start.'user_list' ),
'U_GROUPS'=>add_session_id($link_start.'group_list' ),
'U_USERS_AUTH'=>add_session_id($link_start.'user_perm' ),
'U_GROUPS_AUTH'=>add_session_id($link_start.'group_perm'),
diff --git a/admin/user_list.php b/admin/user_list.php
new file mode 100644
index 000000000..8e50f9c02
--- /dev/null
+++ b/admin/user_list.php
@@ -0,0 +1,246 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | branch : BSF (Best So Far)
+// | file : $RCSfile$
+// | last update : $Date$
+// | last modifier : $Author$
+// | revision : $Revision$
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation |
+// | |
+// | This program is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with this program; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA. |
+// +-----------------------------------------------------------------------+
+
+/**
+ * Add users and manage users list
+ */
+
+// +-----------------------------------------------------------------------+
+// | initialization |
+// +-----------------------------------------------------------------------+
+
+if (!defined('PHPWG_ROOT_PATH'))
+{
+ die('Hacking attempt!');
+}
+include_once(PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php');
+
+// +-----------------------------------------------------------------------+
+// | add a user |
+// +-----------------------------------------------------------------------+
+
+if (isset($_POST['submit_add']))
+{
+ $errors = register_user($_POST['login'],
+ $_POST['password'],
+ $_POST['password'],
+ '');
+}
+
+// +-----------------------------------------------------------------------+
+// | template init |
+// +-----------------------------------------------------------------------+
+
+$template->set_filenames(array('user_list'=>'admin/user_list.tpl'));
+
+$base_url = add_session_id(PHPWG_ROOT_PATH.'admin.php?page=user_list');
+
+$conf['users_page'] = 20;
+
+if (isset($_GET['start']) and is_numeric($_GET['start']))
+{
+ $start = $_GET['start'];
+}
+else
+{
+ $start = 0;
+}
+
+$template->assign_vars(
+ array(
+ 'L_AUTH_USER'=>$lang['permuser_only_private'],
+ 'L_GROUP_ADD_USER' => $lang['group_add_user'],
+ 'L_SUBMIT'=>$lang['submit'],
+ 'L_STATUS'=>$lang['user_status'],
+ 'L_USERNAME' => $lang['login'],
+ 'L_PASSWORD' => $lang['password'],
+ 'L_EMAIL' => $lang['mail_address'],
+ 'L_ORDER_BY' => $lang['order_by'],
+ 'L_ACTIONS' => $lang['actions'],
+ 'L_PERMISSIONS' => $lang['permissions'],
+ 'L_USERS_LIST' => $lang['title_liste_users'],
+
+ 'F_ADD_ACTION' => $base_url,
+ 'F_USERNAME' => @$_GET['username'],
+ 'F_FILTER_ACTION' => PHPWG_ROOT_PATH.'admin.php'
+ ));
+
+if (isset($_GET['id']))
+{
+ $template->assign_block_vars('session', array('ID' => $_GET['id']));
+}
+
+$order_by_items = array('id' => $lang['registration_date'],
+ 'username' => $lang['login']);
+
+foreach ($order_by_items as $item => $label)
+{
+ $selected = (isset($_GET['order_by']) and $_GET['order_by'] == $item) ?
+ 'selected="selected"' : '';
+ $template->assign_block_vars(
+ 'order_by',
+ array(
+ 'VALUE' => $item,
+ 'CONTENT' => $label,
+ 'SELECTED' => $selected
+ ));
+}
+
+$direction_items = array('asc' => $lang['ascending'],
+ 'desc' => $lang['descending']);
+
+foreach ($direction_items as $item => $label)
+{
+ $selected = (isset($_GET['direction']) and $_GET['direction'] == $item) ?
+ 'selected="selected"' : '';
+ $template->assign_block_vars(
+ 'direction',
+ array(
+ 'VALUE' => $item,
+ 'CONTENT' => $label,
+ 'SELECTED' => $selected
+ ));
+}
+
+// +-----------------------------------------------------------------------+
+// | filter |
+// +-----------------------------------------------------------------------+
+
+$username = !empty($_GET['username']) ? $_GET['username'] : '%';
+$username = str_replace('*', '%', $username);
+if (function_exists('mysql_real_escape_string'))
+{
+ $username = mysql_real_escape_string($username);
+}
+else
+{
+ $username = mysql_escape_string($username);
+}
+$username = !empty($username) ? $username : '%';
+
+// +-----------------------------------------------------------------------+
+// | navigation bar |
+// +-----------------------------------------------------------------------+
+
+$query = '
+SELECT count(*)
+ FROM '.USERS_TABLE.'
+ WHERE id != 2
+ AND username LIKE \''.$username.'\'
+;';
+list($counter) = mysql_fetch_row(pwg_query($query));
+
+$url = PHPWG_ROOT_PATH.'admin.php'.get_query_string_diff(array('start'));
+
+$navbar = create_navigation_bar($url,
+ $counter,
+ $start,
+ $conf['users_page'],
+ '');
+
+$template->assign_vars(array('NAVBAR' => $navbar));
+
+// +-----------------------------------------------------------------------+
+// | user list |
+// +-----------------------------------------------------------------------+
+
+$profile_url = PHPWG_ROOT_PATH.'admin.php?page=profile&amp;user_id=';
+$perm_url = PHPWG_ROOT_PATH.'admin.php?page=user_perm&amp;user_id=';
+
+$users = array();
+$user_ids = array();
+$groups_content = array();
+
+$order_by = 'id';
+if (isset($_GET['order_by'])
+ and in_array($_GET['order_by'], array_keys($order_by_items)))
+{
+ $order_by = $_GET['order_by'];
+}
+
+$direction = 'ASC';
+if (isset($_GET['direction'])
+ and in_array($_GET['direction'], array_keys($direction_items)))
+{
+ $direction = strtoupper($_GET['direction']);
+}
+
+$query = '
+SELECT id, username, mail_address, status
+ FROM '.USERS_TABLE.'
+ WHERE id != 2
+ AND username LIKE \''.$username.'\'
+ ORDER BY '.$order_by.' '.$direction.'
+ LIMIT '.$start.', '.$conf['users_page'].'
+;';
+$result = pwg_query($query);
+while ($row = mysql_fetch_array($result))
+{
+ array_push($users, $row);
+ array_push($user_ids, $row['id']);
+ $user_groups[$row['id']] = array();
+}
+
+if (count($user_ids) > 0)
+{
+ $query = '
+SELECT user_id, group_id, name
+ FROM '.USER_GROUP_TABLE.' INNER JOIN '.GROUPS_TABLE.' ON group_id = id
+ WHERE user_id IN ('.implode(',', $user_ids).')
+;';
+ $result = pwg_query($query);
+ while ($row = mysql_fetch_array($result))
+ {
+ $groups_content[$row['group_id']] = $row['name'];
+ array_push($user_groups[$row['user_id']], $row['group_id']);
+ }
+
+ foreach ($users as $item)
+ {
+ $groups = preg_replace('/(\d+)/e',
+ "\$groups_content['$1']",
+ implode(', ', $user_groups[$item['id']]));
+
+ $template->assign_block_vars(
+ 'user',
+ array(
+ 'U_MOD'=>add_session_id($profile_url.$item['id']),
+ 'U_PERM'=>add_session_id($perm_url.$item['id']),
+ 'USERNAME'=>$item['username'],
+ 'STATUS'=>$lang['user_status_'.$item['status']],
+ 'EMAIL'=>isset($item['mail_address']) ? $item['mail_address'] : '',
+ 'GROUPS'=>$groups
+ ));
+ }
+}
+
+// +-----------------------------------------------------------------------+
+// | html code display |
+// +-----------------------------------------------------------------------+
+
+$template->assign_var_from_handle('ADMIN_CONTENT', 'user_list');
+?>
diff --git a/doc/ChangeLog b/doc/ChangeLog
index eaf71ed5e..d75bc5402 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,10 @@
+2005-04-25 Pierrick LE GALL
+
+ * profile.php is no longer used for listing users :
+ admin/user_list.php comes back (as in 1.3 branch)
+
+ * user list updated : ability to filter list on username
+
2005-04-25 Gweltas
* ability to install even if file include/mysql.inc.php doesn't
diff --git a/profile.php b/profile.php
index 42d36ca92..57f6255be 100644
--- a/profile.php
+++ b/profile.php
@@ -30,11 +30,7 @@
// | initialization |
// +-----------------------------------------------------------------------+
$userdata = array();
-if (defined('IN_ADMIN') and isset($_POST['submituser']))
-{
- $userdata = getuserdata($_POST['username']);
-}
-else if (defined('IN_ADMIN') and IN_ADMIN and isset($_GET['user_id']))
+if (defined('IN_ADMIN') and IN_ADMIN and isset($_GET['user_id']))
{
$userdata = getuserdata(intval($_GET['user_id']));
}
@@ -208,11 +204,6 @@ UPDATE '.USERS_TABLE.'
}
}
}
-else if (defined('IN_ADMIN') and IN_ADMIN and isset($_POST['submit_add']))
-{
- $errors = register_user($_POST['login'], $_POST['password'],
- $_POST['password'], '');
-}
// +-----------------------------------------------------------------------+
// | page header and options |
// +-----------------------------------------------------------------------+
@@ -230,237 +221,88 @@ else
//----------------------------------------------------- template initialization
$template->set_filenames(array('profile_body'=>'profile.tpl'));
-if (defined('IN_ADMIN') and IN_ADMIN and empty($userdata))
-{
- $admin_profile = add_session_id(PHPWG_ROOT_PATH.'admin.php?page=profile');
+$expand = ($userdata['expand'] == 'true') ? 'EXPAND_TREE_YES':'EXPAND_TREE_NO';
- $template->assign_block_vars('add_user', array('F_ACTION'=>$admin_profile));
- $template->assign_block_vars('select_user',array());
-
- $conf['users_page'] = 20;
- $start = isset($_GET['start']) ? $_GET['start'] : 0;
-
- $query = '
-SELECT COUNT(*) AS counter
- FROM '.USERS_TABLE.'
- WHERE id != 2
-;';
- list($counter) = mysql_fetch_row(pwg_query($query));
- $url = PHPWG_ROOT_PATH.'admin.php'.get_query_string_diff(array('start'));
- $navbar = create_navigation_bar($url,
- $counter,
- $start,
- $conf['users_page'],
- '');
+$nb_comments =
+($userdata['show_nb_comments'] == 'true') ? 'NB_COMMENTS_YES':'NB_COMMENTS_NO';
- $template->assign_vars(
- array(
- 'L_SELECT_USERNAME'=>$lang['Select_username'],
- 'L_LOOKUP_USER'=>$lang['Look_up_user'],
- 'L_FIND_USERNAME'=>$lang['Find_username'],
- 'L_AUTH_USER'=>$lang['permuser_only_private'],
- 'L_GROUP_ADD_USER' => $lang['group_add_user'],
- 'L_SUBMIT'=>$lang['submit'],
- 'L_STATUS'=>$lang['user_status'],
- 'L_USERNAME' => $lang['login'],
- 'L_PASSWORD' => $lang['password'],
- 'L_EMAIL' => $lang['mail_address'],
- 'L_ORDER_BY' => $lang['order_by'],
- 'L_ACTIONS' => $lang['actions'],
- 'L_PERMISSIONS' => $lang['permissions'],
- 'L_USERS_LIST' => $lang['title_liste_users'],
-
- 'NAVBAR'=>$navbar,
- 'F_SEARCH_USER_ACTION' => $admin_profile,
- 'F_ORDER_ACTION' => $admin_profile,
- 'U_SEARCH_USER' => add_session_id(PHPWG_ROOT_PATH.'admin/search.php')
- ));
-
- $order_by_items = array('id' => $lang['registration_date'],
- 'username' => $lang['login']);
- foreach ($order_by_items as $item => $label)
- {
- $selected = (isset($_GET['order_by']) and $_GET['order_by'] == $item) ?
- 'selected="selected"' : '';
- $template->assign_block_vars(
- 'select_user.order_by',
- array(
- 'VALUE' => $item,
- 'CONTENT' => $label,
- 'SELECTED' => $selected
- ));
- }
-
- $direction_items = array('asc' => $lang['ascending'],
- 'desc' => $lang['descending']);
- foreach ($direction_items as $item => $label)
- {
- $selected = (isset($_GET['direction']) and $_GET['direction'] == $item) ?
- 'selected="selected"' : '';
- $template->assign_block_vars(
- 'select_user.direction',
- array(
- 'VALUE' => $item,
- 'CONTENT' => $label,
- 'SELECTED' => $selected
- ));
- }
-
- $profile_url = PHPWG_ROOT_PATH.'admin.php?page=profile&amp;user_id=';
- $perm_url = PHPWG_ROOT_PATH.'admin.php?page=user_perm&amp;user_id=';
-
- $users = array();
- $user_ids = array();
- $groups_content = array();
-
- $order_by = 'id';
- if (isset($_GET['order_by'])
- and in_array($_GET['order_by'], array_keys($order_by_items)))
- {
- $order_by = $_GET['order_by'];
- }
-
- $direction = 'ASC';
- if (isset($_GET['direction'])
- and in_array($_GET['direction'], array_keys($direction_items)))
- {
- $direction = strtoupper($_GET['direction']);
- }
-
- $query = '
-SELECT id, username, mail_address, status
- FROM '.USERS_TABLE.'
- WHERE id != 2
- ORDER BY '.$order_by.' '.$direction.'
- LIMIT '.$start.', '.$conf['users_page'].'
-;';
- $result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
- {
- array_push($users, $row);
- array_push($user_ids, $row['id']);
- $user_groups[$row['id']] = array();
- }
-
- $query = '
-SELECT user_id, group_id, name
- FROM '.USER_GROUP_TABLE.' INNER JOIN '.GROUPS_TABLE.' ON group_id = id
- WHERE user_id IN ('.implode(',', $user_ids).')
-;';
- $result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
- {
- $groups_content[$row['group_id']] = $row['name'];
- array_push($user_groups[$row['user_id']], $row['group_id']);
- }
-
- foreach ($users as $item)
- {
- $groups = preg_replace('/(\d+)/e',
- "\$groups_content['$1']",
- implode(', ', $user_groups[$item['id']]));
+$template->assign_vars(
+ array(
+ 'USERNAME'=>$userdata['username'],
+ 'USERID'=>$userdata['id'],
+ 'EMAIL'=>@$userdata['mail_address'],
+ 'LANG_SELECT'=>language_select($userdata['language'], 'language'),
+ 'NB_IMAGE_LINE'=>$userdata['nb_image_line'],
+ 'NB_ROW_PAGE'=>$userdata['nb_line_page'],
+ 'STYLE_SELECT'=>style_select($userdata['template'], 'template'),
+ 'RECENT_PERIOD'=>$userdata['recent_period'],
+ 'MAXWIDTH'=>@$userdata['maxwidth'],
+ 'MAXHEIGHT'=>@$userdata['maxheight'],
- $template->assign_block_vars(
- 'select_user.user',
- array(
- 'U_MOD'=>add_session_id($profile_url.$item['id']),
- 'U_PERM'=>add_session_id($perm_url.$item['id']),
- 'USERNAME'=>$item['username'],
- 'STATUS'=>$lang['user_status_'.$item['status']],
- 'EMAIL'=>isset($item['mail_address']) ? $item['mail_address'] : '',
- 'GROUPS'=>$groups
- ));
- }
+ $expand=>'checked="checked"',
+ $nb_comments=>'checked="checked"',
+
+ 'L_TITLE' => $lang['customize_title'],
+ 'L_REGISTRATION_INFO' => $lang['register_title'],
+ 'L_PREFERENCES' => $lang['preferences'],
+ 'L_USERNAME' => $lang['login'],
+ 'L_EMAIL' => $lang['mail_address'],
+ 'L_CURRENT_PASSWORD' => $lang['password'],
+ 'L_CURRENT_PASSWORD_HINT' => $lang['password_hint'],
+ 'L_NEW_PASSWORD' => $lang['new_password'],
+ 'L_NEW_PASSWORD_HINT' => $lang['new_password_hint'],
+ 'L_CONFIRM_PASSWORD' => $lang['reg_confirm'],
+ 'L_CONFIRM_PASSWORD_HINT' => $lang['confirm_password_hint'],
+ 'L_LANG_SELECT'=>$lang['language'],
+ 'L_NB_IMAGE_LINE'=>$lang['nb_image_per_row'],
+ 'L_NB_ROW_PAGE'=>$lang['nb_row_per_page'],
+ 'L_STYLE_SELECT'=>$lang['theme'],
+ 'L_RECENT_PERIOD'=>$lang['recent_period'],
+ 'L_EXPAND_TREE'=>$lang['auto_expand'],
+ 'L_NB_COMMENTS'=>$lang['show_nb_comments'],
+ 'L_MAXWIDTH'=>$lang['maxwidth'],
+ 'L_MAXHEIGHT'=>$lang['maxheight'],
+ 'L_YES'=>$lang['yes'],
+ 'L_NO'=>$lang['no'],
+ 'L_SUBMIT'=>$lang['submit'],
+ 'L_RESET'=>$lang['reset'],
+ 'L_RETURN' => $lang['home'],
+ 'L_RETURN_HINT' => $lang['home_hint'],
+
+ 'F_ACTION'=>add_session_id($url_action),
+ ));
+
+if (!defined('IN_ADMIN') or !IN_ADMIN)
+{
+ $url_return = PHPWG_ROOT_PATH.'category.php?'.$_SERVER['QUERY_STRING'];
+ $template->assign_vars(array('U_RETURN' => add_session_id($url_return)));
}
-else
+//------------------------------------------------------------- user management
+if (defined('IN_ADMIN') and IN_ADMIN)
{
- $expand =
- ($userdata['expand']=='true')?
- 'EXPAND_TREE_YES':'EXPAND_TREE_NO';
-
- $nb_comments =
- ($userdata['show_nb_comments']=='true')?
- 'NB_COMMENTS_YES':'NB_COMMENTS_NO';
-
- $template->assign_block_vars('modify',array());
- $template->assign_vars(
- array(
- 'USERNAME'=>$userdata['username'],
- 'USERID'=>$userdata['id'],
- 'EMAIL'=>@$userdata['mail_address'],
- 'LANG_SELECT'=>language_select($userdata['language'], 'language'),
- 'NB_IMAGE_LINE'=>$userdata['nb_image_line'],
- 'NB_ROW_PAGE'=>$userdata['nb_line_page'],
- 'STYLE_SELECT'=>style_select($userdata['template'], 'template'),
- 'RECENT_PERIOD'=>$userdata['recent_period'],
- 'MAXWIDTH'=>@$userdata['maxwidth'],
- 'MAXHEIGHT'=>@$userdata['maxheight'],
-
- $expand=>'checked="checked"',
- $nb_comments=>'checked="checked"',
-
- 'L_TITLE' => $lang['customize_title'],
- 'L_REGISTRATION_INFO' => $lang['register_title'],
- 'L_PREFERENCES' => $lang['preferences'],
- 'L_USERNAME' => $lang['login'],
- 'L_EMAIL' => $lang['mail_address'],
- 'L_CURRENT_PASSWORD' => $lang['password'],
- 'L_CURRENT_PASSWORD_HINT' => $lang['password_hint'],
- 'L_NEW_PASSWORD' => $lang['new_password'],
- 'L_NEW_PASSWORD_HINT' => $lang['new_password_hint'],
- 'L_CONFIRM_PASSWORD' => $lang['reg_confirm'],
- 'L_CONFIRM_PASSWORD_HINT' => $lang['confirm_password_hint'],
- 'L_LANG_SELECT'=>$lang['language'],
- 'L_NB_IMAGE_LINE'=>$lang['nb_image_per_row'],
- 'L_NB_ROW_PAGE'=>$lang['nb_row_per_page'],
- 'L_STYLE_SELECT'=>$lang['theme'],
- 'L_RECENT_PERIOD'=>$lang['recent_period'],
- 'L_EXPAND_TREE'=>$lang['auto_expand'],
- 'L_NB_COMMENTS'=>$lang['show_nb_comments'],
- 'L_MAXWIDTH'=>$lang['maxwidth'],
- 'L_MAXHEIGHT'=>$lang['maxheight'],
- 'L_YES'=>$lang['yes'],
- 'L_NO'=>$lang['no'],
- 'L_SUBMIT'=>$lang['submit'],
- 'L_RESET'=>$lang['reset'],
- 'L_RETURN' => $lang['home'],
- 'L_RETURN_HINT' => $lang['home_hint'],
-
- 'F_ACTION'=>add_session_id($url_action),
- ));
-
- if (!defined('IN_ADMIN') or !IN_ADMIN)
+ $status_select = '<select name="status">';
+ $status_select .='<option value = "guest" ';
+ if ($userdata['status'] == 'guest')
{
- $url_return = PHPWG_ROOT_PATH.'category.php?'.$_SERVER['QUERY_STRING'];
- $template->assign_vars(array('U_RETURN' => add_session_id($url_return)));
+ $status_select .= 'selected="selected"';
}
-//------------------------------------------------------------- user management
- if (defined('IN_ADMIN') and IN_ADMIN)
+ $status_select .='>'.$lang['user_status_guest'] .'</option>';
+ $status_select .='<option value = "admin" ';
+ if ($userdata['status'] == 'admin')
{
- $status_select = '<select name="status">';
- $status_select .='<option value = "guest" ';
- if ($userdata['status'] == 'guest')
- {
- $status_select .= 'selected="selected"';
- }
- $status_select .='>'.$lang['user_status_guest'] .'</option>';
- $status_select .='<option value = "admin" ';
- if ($userdata['status'] == 'admin')
- {
- $status_select .= 'selected="selected"';
- }
- $status_select .='>'.$lang['user_status_admin'] .'</option>';
- $status_select .='</select>';
- $template->assign_block_vars(
- 'modify.admin',
- array(
- 'L_ADMIN_USER'=>$lang['user_management'],
- 'L_STATUS'=>$lang['user_status'],
- 'L_DELETE'=>$lang['user_delete'],
- 'L_DELETE_HINT'=>$lang['user_delete_hint'],
- 'STATUS'=>$status_select
- ));
+ $status_select .= 'selected="selected"';
}
+ $status_select .='>'.$lang['user_status_admin'] .'</option>';
+ $status_select .='</select>';
+ $template->assign_block_vars(
+ 'admin',
+ array(
+ 'L_ADMIN_USER'=>$lang['user_management'],
+ 'L_STATUS'=>$lang['user_status'],
+ 'L_DELETE'=>$lang['user_delete'],
+ 'L_DELETE_HINT'=>$lang['user_delete_hint'],
+ 'STATUS'=>$status_select
+ ));
}
// +-----------------------------------------------------------------------+
// | errors display |
@@ -482,7 +324,7 @@ if (defined('IN_ADMIN') and IN_ADMIN)
}
else
{
- $template->assign_block_vars('modify.profile',array());
+ $template->assign_block_vars('profile',array());
$template->parse('profile_body');
include(PHPWG_ROOT_PATH.'include/page_tail.php');
}
diff --git a/template/default/admin/user_list.tpl b/template/default/admin/user_list.tpl
new file mode 100644
index 000000000..906828afa
--- /dev/null
+++ b/template/default/admin/user_list.tpl
@@ -0,0 +1,59 @@
+<div class="admin">{L_GROUP_ADD_USER}</div>
+
+<form method="post" name="add_user" action="{F_ADD_ACTION}">
+<div style="text-align:center">
+ {L_USERNAME} <input type="text" name="login" maxlength="50" size="20" />
+ {L_PASSWORD} <input type="text" name="password" />
+ <input type="submit" name="submit_add" value="{L_SUBMIT}" class="bouton" />
+</div>
+</form>
+
+<div class="admin">{L_USERS_LIST}</div>
+
+<form method="get" name="filter" action="{F_FILTER_ACTION}">
+
+<div style="text-align:center">
+
+ <input type="hidden" name="page" value="user_list" />
+
+ <!-- BEGIN session -->
+ <input type="hidden" name="id" value="{session.ID}" />
+ <!-- END session -->
+
+ username <input type="text" name="username" value="{F_USERNAME}" />
+
+ {L_ORDER_BY}
+ <select name="order_by">
+ <!-- BEGIN order_by -->
+ <option value="{order_by.VALUE}" {order_by.SELECTED} >{order_by.CONTENT}</option>
+ <!-- END order_by -->
+ </select>
+ <select name="direction">
+ <!-- BEGIN direction -->
+ <option value="{direction.VALUE}" {direction.SELECTED} >{direction.CONTENT}</option>
+ <!-- END direction -->
+ </select>
+ <input type="submit" name="submit_filter" value="{L_SUBMIT}" class="bouton" />
+</div>
+
+</form>
+
+<table style="width:100%;" >
+ <tr class="throw">
+ <th style="width:20%;">{L_USERNAME}</th>
+ <th style="width:20%;">{L_STATUS}</th>
+ <th style="width:30%;">{L_EMAIL}</th>
+ <th style="width:30%;">{L_GROUPS}</th>
+ <th style="width:1%;">{L_ACTIONS}</th>
+ </tr>
+ <!-- BEGIN user -->
+ <tr>
+ <td><a href="{user.U_MOD}">{user.USERNAME}</a></td>
+ <td>{user.STATUS}</td>
+ <td>{user.EMAIL}</td>
+ <td>{user.GROUPS}</td>
+ <td>[<a href="{user.U_PERM}">{L_PERMISSIONS}</a>]</td>
+ </tr>
+ <!-- END user -->
+</table>
+<div class="navigationBar">{NAVBAR}</div>
diff --git a/template/default/profile.tpl b/template/default/profile.tpl
index 500b10066..f8b9dd2e5 100644
--- a/template/default/profile.tpl
+++ b/template/default/profile.tpl
@@ -8,64 +8,6 @@
</div>
<!-- END errors -->
-<!-- BEGIN add_user -->
-<div class="admin">{L_GROUP_ADD_USER}</div>
-<form method="post" name="post" action="{add_user.F_ACTION}">
- {L_USERNAME} <input type="text" name="login" maxlength="50" size="20" />
- {L_PASSWORD} <input type="text" name="password" />
- <input type="submit" name="submit_add" value="{L_SUBMIT}" class="bouton" />
-</form>
-<!-- END add_user -->
-
-<!-- BEGIN select_user -->
-<div class="admin">{L_SELECT_USERNAME}</div>
-<form method="post" name="post" action="{F_SEARCH_USER_ACTION}">
- <input type="text" name="username" maxlength="50" size="20" />
- <input type="submit" name="submituser" value="{L_LOOKUP_USER}" class="bouton" />
- <input type="submit" name="usersubmit" value="{L_FIND_USERNAME}" class="bouton" onClick="window.open('{U_SEARCH_USER}', '_phpwgsearch', 'HEIGHT=250,resizable=yes,WIDTH=400');return false;" />
-</form>
-
-<div class="admin">{L_USERS_LIST}</div>
-<form method="get" action="{F_ORDER_ACTION}">
-<input type="hidden" name="page" value="profile" />
-<div style="text-align:center">
- {L_ORDER_BY}
- <select name="order_by">
- <!-- BEGIN order_by -->
- <option value="{select_user.order_by.VALUE}" {select_user.order_by.SELECTED} >{select_user.order_by.CONTENT}</option>
- <!-- END order_by -->
- </select>
- <select name="direction">
- <!-- BEGIN direction -->
- <option value="{select_user.direction.VALUE}" {select_user.direction.SELECTED} >{select_user.direction.CONTENT}</option>
- <!-- END direction -->
- </select>
- <input type="submit" value="{L_SUBMIT}" class="bouton" />
-</div>
-</form>
-
-<table style="width:100%;" >
- <tr class="throw">
- <th style="width:20%;">{L_USERNAME}</th>
- <th style="width:20%;">{L_STATUS}</th>
- <th style="width:30%;">{L_EMAIL}</th>
- <th style="width:30%;">{L_GROUPS}</th>
- <th style="width:1%;">{L_ACTIONS}</th>
- </tr>
- <!-- BEGIN user -->
- <tr>
- <td><a href="{select_user.user.U_MOD}">{select_user.user.USERNAME}</a></td>
- <td>{select_user.user.STATUS}</td>
- <td>{select_user.user.EMAIL}</td>
- <td>{select_user.user.GROUPS}</td>
-<!-- [<a href="{select_user.user.U_MOD}">{L_MODIFY}</a>] -->
- <td>[<a href="{select_user.user.U_PERM}">{L_PERMISSIONS}</a>]</td>
- </tr>
- <!-- END user -->
-</table>
-<div class="navigationBar">{NAVBAR}</div>
-<!-- END select_user -->
-<!-- BEGIN modify -->
<!-- BEGIN profile -->
<div class="titrePage">{L_TITLE}</div>
<!-- END profile -->
@@ -169,4 +111,3 @@
<a href="{U_RETURN}" title="{L_RETURN_HINT}">[{L_RETURN}]</a>
</div>
<!-- END profile -->
-<!-- END modify -->