diff options
author | friendica <info@friendica.com> | 2013-11-18 15:38:02 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-11-18 15:38:02 -0800 |
commit | dc6cd8a701f2225070bf6c37833279768f1a3b10 (patch) | |
tree | 04d82cd1674e7d5e92fc5a1443b85a937ae168e5 /mod/admin.php | |
parent | fce5f2042db1a9d0b13c3bd5f6d37980fa98ca7f (diff) | |
download | volse-hubzilla-dc6cd8a701f2225070bf6c37833279768f1a3b10.tar.gz volse-hubzilla-dc6cd8a701f2225070bf6c37833279768f1a3b10.tar.bz2 volse-hubzilla-dc6cd8a701f2225070bf6c37833279768f1a3b10.zip |
admin/users - add expiration date to table and ability to sort by reverse expiration and also filter by service class through url options
Diffstat (limited to 'mod/admin.php')
-rw-r--r-- | mod/admin.php | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/mod/admin.php b/mod/admin.php index 3608f6eda..1615412b5 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -640,26 +640,35 @@ function admin_page_users(&$a){ // WEe'll still need to link email addresses to admin/users/channels or some such, but this bit doesn't exist yet. // That's where we need to be doing last post/channel flags/etc, not here. - $users =q("SELECT `account_id` , `account_email`, `account_lastlog`, `account_created`, `account_service_class` FROM `account`", - intval($a->pager['start']), - intval($a->pager['itemspage']) - ); - - function _setup_users($e){ - $accounts = Array( - t('Normal Account'), - t('Soapbox Account'), - t('Community/Celebrity Account'), - t('Automatic Friend Account') - ); - $e['page_flags'] = $accounts[$e['page-flags']]; - $e['register_date'] = relative_date($e['register_date']); - $e['login_date'] = relative_date($e['login_date']); - $e['lastitem_date'] = relative_date($e['lastitem_date']); - return $e; - } - $users = array_map("_setup_users", $users); + + $serviceclass = (($_REQUEST['class']) ? " and account_service_class = '" . dbesc($_REQUEST['class']) . "' " : ''); + + + $order = " order by account_email asc "; + if($_REQUEST['order'] === 'expires') + $order = " order by account_expires desc "; + + $users =q("SELECT `account_id` , `account_email`, `account_lastlog`, `account_created`, `account_expires`, `account_service_class` FROM `account` where true $serviceclass $order limit %d , %d ", + intval($a->pager['start']), + intval($a->pager['itemspage']) + ); + +// function _setup_users($e){ +// $accounts = Array( +// t('Normal Account'), +// t('Soapbox Account'), +// t('Community/Celebrity Account'), +// t('Automatic Friend Account') +// ); + +// $e['page_flags'] = $accounts[$e['page-flags']]; +// $e['register_date'] = relative_date($e['register_date']); +// $e['login_date'] = relative_date($e['login_date']); +// $e['lastitem_date'] = relative_date($e['lastitem_date']); +// return $e; +// } +// $users = array_map("_setup_users", $users); $t = get_markup_template("admin_users.tpl"); @@ -679,7 +688,7 @@ function admin_page_users(&$a){ '$unblock' => t('Unblock'), '$h_users' => t('Users'), - '$th_users' => array( t('Email'), t('Register date'), t('Last login'), t('Service Class')), + '$th_users' => array( t('Email'), t('Register date'), t('Last login'), t('Expires'), t('Service Class')), '$confirm_delete_multi' => t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'), '$confirm_delete' => t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'), |