mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
* Admin: New account status filter (Enabled, Disabled, Expired, Expires, Not enabled)
This commit is contained in:
parent
52eb5ca8e0
commit
1936849bd7
@ -55,7 +55,6 @@ class admin_ui
|
|||||||
$content['nm'] = array(
|
$content['nm'] = array(
|
||||||
'get_rows' => 'admin_ui::get_users',
|
'get_rows' => 'admin_ui::get_users',
|
||||||
'no_cat' => true,
|
'no_cat' => true,
|
||||||
'no_filter2' => true,
|
|
||||||
'filter_no_lang' => true,
|
'filter_no_lang' => true,
|
||||||
'lettersearch' => true,
|
'lettersearch' => true,
|
||||||
'order' => 'account_lid',
|
'order' => 'account_lid',
|
||||||
@ -93,6 +92,14 @@ class admin_ui
|
|||||||
$sel_options['account_primary_group'] = $sel_options['filter'];
|
$sel_options['account_primary_group'] = $sel_options['filter'];
|
||||||
unset($sel_options['account_primary_group']['']);
|
unset($sel_options['account_primary_group']['']);
|
||||||
|
|
||||||
|
$sel_options['filter2'] = array(
|
||||||
|
'enabled' => 'Enabled',
|
||||||
|
'disabled' => 'Disabled',
|
||||||
|
'expired' => 'Expired',
|
||||||
|
'expires' => 'Expires',
|
||||||
|
'not_enabled' => 'Not enabled'
|
||||||
|
);
|
||||||
|
|
||||||
$tpl->setElementAttribute('tree', 'actions', self::tree_actions());
|
$tpl->setElementAttribute('tree', 'actions', self::tree_actions());
|
||||||
|
|
||||||
// switching between iframe and nm/accounts-list depending on load parameter
|
// switching between iframe and nm/accounts-list depending on load parameter
|
||||||
@ -325,7 +332,22 @@ class admin_ui
|
|||||||
'order' => $query['order'],
|
'order' => $query['order'],
|
||||||
'sort' => $query['sort'],
|
'sort' => $query['sort'],
|
||||||
'active' => !empty($query['active']) ? $query['active'] : false,
|
'active' => !empty($query['active']) ? $query['active'] : false,
|
||||||
|
'status' => $query['filter2']
|
||||||
);
|
);
|
||||||
|
// Make sure active filter give status what it needs
|
||||||
|
switch($query['filter2'])
|
||||||
|
{
|
||||||
|
case 'disabled':
|
||||||
|
case 'expired':
|
||||||
|
case 'not_enabled':
|
||||||
|
$params['active'] = false;
|
||||||
|
break;
|
||||||
|
case 'enabled':
|
||||||
|
default:
|
||||||
|
$params['active'] = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if ($query['searchletter'])
|
if ($query['searchletter'])
|
||||||
{
|
{
|
||||||
$params['query'] = $query['searchletter'];
|
$params['query'] = $query['searchletter'];
|
||||||
@ -340,8 +362,15 @@ class admin_ui
|
|||||||
$rows = array_values(self::$accounts->search($params));
|
$rows = array_values(self::$accounts->search($params));
|
||||||
//error_log(__METHOD__."() accounts->search(".array2string($params).") total=".self::$accounts->total);
|
//error_log(__METHOD__."() accounts->search(".array2string($params).") total=".self::$accounts->total);
|
||||||
|
|
||||||
foreach($rows as &$row)
|
foreach($rows as $key => &$row)
|
||||||
{
|
{
|
||||||
|
// Filter by status
|
||||||
|
if($params['status'] && !static::filter_status($params['status'], $row))
|
||||||
|
{
|
||||||
|
unset($rows[$key]);
|
||||||
|
self::$accounts->total--;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$row['status'] = self::$accounts->is_expired($row) ?
|
$row['status'] = self::$accounts->is_expired($row) ?
|
||||||
lang('Expired').' '.Api\DateTime::to($row['account_expires'], true) :
|
lang('Expired').' '.Api\DateTime::to($row['account_expires'], true) :
|
||||||
(!self::$accounts->is_active($row) ? lang('Disabled') :
|
(!self::$accounts->is_active($row) ? lang('Disabled') :
|
||||||
@ -354,6 +383,36 @@ class admin_ui
|
|||||||
return self::$accounts->total;
|
return self::$accounts->total;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter the account based on given status.
|
||||||
|
*
|
||||||
|
* Status is one of enabled, disabled, expired, expires, not_enabled
|
||||||
|
* @param $status
|
||||||
|
* @param $account
|
||||||
|
*/
|
||||||
|
protected static function filter_status($status, &$account)
|
||||||
|
{
|
||||||
|
switch($status)
|
||||||
|
{
|
||||||
|
case 'enabled':
|
||||||
|
return $account['account_status'] == 'A';
|
||||||
|
|
||||||
|
case 'disabled':
|
||||||
|
return $account['account_status'] !== 'A';
|
||||||
|
|
||||||
|
case 'expired':
|
||||||
|
return $account['account_expires'] !== '-1' && $account['account_status'] != 'A';
|
||||||
|
|
||||||
|
case 'expires':
|
||||||
|
return $account['account_expires'] != '-1' && $account['account_status'] == 'A';
|
||||||
|
|
||||||
|
case 'not_enabled':
|
||||||
|
return static::filter_status('disabled', $account) || static::filter_status('expired', $account);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback for the nextmatch to get groups
|
* Callback for the nextmatch to get groups
|
||||||
*/
|
*/
|
||||||
|
@ -324,6 +324,7 @@ disable all admin en Disable all
|
|||||||
disable minifying of javascript and css files admin en Disable minifying of javascript and CSS files
|
disable minifying of javascript and css files admin en Disable minifying of javascript and CSS files
|
||||||
disable pgp encryption (mailvelope) admin en Disable PGP encryption (Mailvelope)
|
disable pgp encryption (mailvelope) admin en Disable PGP encryption (Mailvelope)
|
||||||
disable wysiwyg-editor admin en Disable WYSIWYG-editor
|
disable wysiwyg-editor admin en Disable WYSIWYG-editor
|
||||||
|
disabled admin en Disabled
|
||||||
disabled (not recomended) admin en Disabled (not recommended)
|
disabled (not recomended) admin en Disabled (not recommended)
|
||||||
disabled, do not show on login page admin en disabled, do not show on login page
|
disabled, do not show on login page admin en disabled, do not show on login page
|
||||||
display admin en Display
|
display admin en Display
|
||||||
@ -379,6 +380,7 @@ enable sieve admin en Enable Sieve
|
|||||||
enable spellcheck in rich text editor admin en Enable spellcheck in rich text editor
|
enable spellcheck in rich text editor admin en Enable spellcheck in rich text editor
|
||||||
enable the soap service admin en Enable the soap service.
|
enable the soap service admin en Enable the soap service.
|
||||||
enable the xmlrpc service admin en Enable the xmlrpc service.
|
enable the xmlrpc service admin en Enable the xmlrpc service.
|
||||||
|
enabled admin en Enabled
|
||||||
enabled - hidden from navbar admin en Enabled - Hidden from navbar
|
enabled - hidden from navbar admin en Enabled - Hidden from navbar
|
||||||
enabled - popup window admin en Enabled - Popup window
|
enabled - popup window admin en Enabled - Popup window
|
||||||
encrypted connection admin en Encrypted connection
|
encrypted connection admin en Encrypted connection
|
||||||
@ -655,6 +657,7 @@ no profile defined for user %1 admin en No profile defined for user %1
|
|||||||
no sieve support detected, either fix configuration manually or leave it switched off. admin en No sieve support detected, either fix configuration manually or leave it switched off.
|
no sieve support detected, either fix configuration manually or leave it switched off. admin en No sieve support detected, either fix configuration manually or leave it switched off.
|
||||||
no supported imap authentication method could be found. admin en No supported IMAP authentication method could be found.
|
no supported imap authentication method could be found. admin en No supported IMAP authentication method could be found.
|
||||||
non profit: clubs, associations, ... admin en Non profit: Clubs, Associations, ...
|
non profit: clubs, associations, ... admin en Non profit: Clubs, Associations, ...
|
||||||
|
not enabled admin en Not enabled
|
||||||
note: ssl available only if php is compiled with curl support admin en Note: SSL available only if PHP is compiled with curl support.
|
note: ssl available only if php is compiled with curl support admin en Note: SSL available only if PHP is compiled with curl support.
|
||||||
notification mail admin en Notification mail
|
notification mail admin en Notification mail
|
||||||
notify user by email admin en Notify user by email
|
notify user by email admin en Notify user by email
|
||||||
|
Loading…
Reference in New Issue
Block a user