mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 00:04:37 +02:00
2013-02-11 Sergio Martin <sergio.martin@artica.es>
* godmode/users/user_list.php: Fix pagination on users list git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7619 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
0f34b36ba2
commit
e28484331d
@ -1,3 +1,7 @@
|
|||||||
|
2013-02-11 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
|
* godmode/users/user_list.php: Fix pagination on users list
|
||||||
|
|
||||||
2013-02-11 Miguel de Dios <miguel.dedios@artica.es>
|
2013-02-11 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* include/functions_servers.php, extensions/plugin_registration.php:
|
* include/functions_servers.php, extensions/plugin_registration.php:
|
||||||
|
@ -203,17 +203,17 @@ $table->size[5] = '65px';
|
|||||||
|
|
||||||
$info1 = array ();
|
$info1 = array ();
|
||||||
|
|
||||||
$info1 = get_users ($order, array ('offset' => (int) get_parameter ('offset'),
|
$info1 = get_users ($order);
|
||||||
'limit' => (int) $config['block_size']));
|
|
||||||
|
|
||||||
$info = array();
|
$info = array();
|
||||||
$own_info = get_user_info ($config['id_user']);
|
$own_info = get_user_info ($config['id_user']);
|
||||||
$own_groups = users_get_groups ($config['id_user'], 'AR', $own_info['is_admin']);
|
$own_groups = users_get_groups ($config['id_user'], 'AR', $own_info['is_admin']);
|
||||||
|
|
||||||
if ($own_info['is_admin'])
|
if ($own_info['is_admin']) {
|
||||||
$info = $info1;
|
$info = $info1;
|
||||||
|
}
|
||||||
// If user is not admin then don't display admin users and user of others groups.
|
// If user is not admin then don't display admin users and user of others groups.
|
||||||
else
|
else {
|
||||||
foreach ($info1 as $key => $usr) {
|
foreach ($info1 as $key => $usr) {
|
||||||
$u = get_user_info ($key);
|
$u = get_user_info ($key);
|
||||||
$g = users_get_groups ($key, 'AR', $u['is_admin']);
|
$g = users_get_groups ($key, 'AR', $u['is_admin']);
|
||||||
@ -223,13 +223,31 @@ else
|
|||||||
unset($u);
|
unset($u);
|
||||||
unset($g);
|
unset($g);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Prepare pagination
|
// Prepare pagination
|
||||||
ui_pagination (count(get_users ()));
|
ui_pagination (count($info));
|
||||||
|
|
||||||
|
$offset = (int) get_parameter ('offset');
|
||||||
|
$limit = (int) $config['block_size'];
|
||||||
|
|
||||||
$rowPair = true;
|
$rowPair = true;
|
||||||
$iterator = 0;
|
$iterator = 0;
|
||||||
|
$cont = 0;
|
||||||
foreach ($info as $user_id => $user_info) {
|
foreach ($info as $user_id => $user_info) {
|
||||||
|
$cont++;
|
||||||
|
|
||||||
|
////////////////////
|
||||||
|
// Manual pagination due the complicated process of the ACL data
|
||||||
|
if ($cont <= $offset) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($cont > ($limit + $offset)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
////////////////////
|
||||||
|
|
||||||
if ($rowPair)
|
if ($rowPair)
|
||||||
$table->rowclass[$iterator] = 'rowPair';
|
$table->rowclass[$iterator] = 'rowPair';
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user