summaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorpb1dft <pb1dft@ampache>2007-02-12 21:29:12 +0000
committerpb1dft <pb1dft@ampache>2007-02-12 21:29:12 +0000
commitba2bb3649e64bca07c1b66fd1c9c0f023df07485 (patch)
treebc11b8e7a42cf7c7ff46c887eabfc2b65385da1d /admin
parentc10f41da77a5020fc94e52ad6dde15df652fa4cf (diff)
downloadampache-ba2bb3649e64bca07c1b66fd1c9c0f023df07485.tar.gz
ampache-ba2bb3649e64bca07c1b66fd1c9c0f023df07485.tar.bz2
ampache-ba2bb3649e64bca07c1b66fd1c9c0f023df07485.zip
Added new tool to see inactive users for xx days in Other Tools section
Diffstat (limited to 'admin')
-rw-r--r--admin/users.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/admin/users.php b/admin/users.php
index bb4296a3..aa4196b0 100644
--- a/admin/users.php
+++ b/admin/users.php
@@ -174,6 +174,28 @@ switch ($action) {
show_confirmation(_('Error'),_('Unable to Disabled last Administrator'),'admin/users.php');
}
break;
+ case 'show_inactive':
+ $view = new View();
+ $view->import_session_view();
+
+ // If we are returning
+ if ($_REQUEST['keep_view']) {
+ $view->initialize();
+ }
+ else {
+
+ $inactive = time() - ($_REQUEST['days'] * 24 * 60 *60);
+
+ $sql = "SELECT `id`,`last_seen` FROM `user` where last_seen <= $inactive";
+ $db_results = mysql_query($sql,dbh());
+ $total_items = mysql_num_rows($db_results);
+ $view = new View($sql,'admin/users.php','fullname',$total_items,$_SESSION['userdata']['offset_limit']);
+ }
+
+ $users = get_users($view->sql);
+ require_once(conf('prefix') . '/templates/show_users.inc.php');
+
+ break;
default:
// Setup the View Object
$view = new View();