aboutsummaryrefslogtreecommitdiffstats
path: root/admin/user_list.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2005-04-30 14:36:57 +0000
committerplegall <plg@piwigo.org>2005-04-30 14:36:57 +0000
commit9cfba96167a8d6e67d6e3a257e87e27483c478ec (patch)
treed09a6d441b18e3e561dbce61ddb1c9295816c820 /admin/user_list.php
parent5293402be5299d3c7b6b0f55b4130223ece04dd6 (diff)
- user list updated : ability to filter list on status. Function get_enums
comes back to retrieve the list of possible status in the database. git-svn-id: http://piwigo.org/svn/trunk@777 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/user_list.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/admin/user_list.php b/admin/user_list.php
index 9bfbacd33..615ecdf58 100644
--- a/admin/user_list.php
+++ b/admin/user_list.php
@@ -155,6 +155,29 @@ while ($row = mysql_fetch_array($result))
));
}
+$blockname = 'status_option';
+
+$template->assign_block_vars(
+ $blockname,
+ array(
+ 'VALUE'=> -1,
+ 'CONTENT' => '------------',
+ 'SELECTED' => ''
+ ));
+
+foreach (get_enums(USERS_TABLE, 'status') as $status)
+{
+ $selected = (isset($_GET['status']) and $_GET['status'] == $status) ?
+ 'selected="selected"' : '';
+ $template->assign_block_vars(
+ $blockname,
+ array(
+ 'VALUE' => $status,
+ 'CONTENT' => $lang['user_status_'.$status],
+ 'SELECTED' => $selected
+ ));
+}
+
// +-----------------------------------------------------------------------+
// | filter |
// +-----------------------------------------------------------------------+
@@ -186,6 +209,11 @@ if (isset($_GET['group'])
$filter['group'] = $_GET['group'];
}
+if (isset($_GET['status'])
+ and in_array($_GET['status'], get_enums(USERS_TABLE, 'status')))
+{
+ $filter['status'] = $_GET['status'];
+}
// +-----------------------------------------------------------------------+
// | navigation bar |
@@ -205,6 +233,11 @@ if (isset($filter['group']))
$query.= '
AND group_id = '.$filter['group'];
}
+if (isset($filter['status']))
+{
+ $query.= '
+ AND status = \''.$filter['status']."'";
+}
$query.= '
;';
list($counter) = mysql_fetch_row(pwg_query($query));
@@ -258,6 +291,11 @@ if (isset($filter['group']))
$query.= '
AND group_id = '.$filter['group'];
}
+if (isset($filter['status']))
+{
+ $query.= '
+ AND status = \''.$filter['status']."'";
+}
$query.= '
ORDER BY '.$order_by.' '.$direction.'
LIMIT '.$start.', '.$conf['users_page'].'