From 2793eb73f991a62d69bcbc5a124c81c4c8898a79 Mon Sep 17 00:00:00 2001 From: alban Date: Wed, 26 Mar 2014 18:51:22 +0100 Subject: [PATCH] [fix] missing delete account button in long account list --- bureau/admin/adm_list.php | 416 +++++++++++++++++++------------------- 1 file changed, 213 insertions(+), 203 deletions(-) diff --git a/bureau/admin/adm_list.php b/bureau/admin/adm_list.php index b6bbb8be..74c1ee8a 100644 --- a/bureau/admin/adm_list.php +++ b/bureau/admin/adm_list.php @@ -1,69 +1,70 @@ enabled) { - __("This page is restricted to authorized staff"); - include_once('foot.php'); - exit(); + __("This page is restricted to authorized staff"); + include_once('foot.php'); + exit(); } -$fields = array ( - "show" => array ("request", "string", ""), - "creator" => array("request", "integer", 0), - "short" => array("request", "integer", -1), - "pattern" => array("post", "string", "*"), - "pattern_type" => array("post", "string", "login"), +$fields = array( + "show" => array("request", "string", ""), + "creator" => array("request", "integer", 0), + "short" => array("request", "integer", -1), + "pattern" => array("post", "string", "*"), + "pattern_type" => array("post", "string", "login"), ); getFields($fields); -if (empty($pattern)) $pattern="*"; +if (empty($pattern)) + $pattern = "*"; -if ($short!=-1) { - $mem->adminpref($short); - $mem->user["admlist"]=$short; +if ($short != -1) { + $mem->adminpref($short); + $mem->user["admlist"] = $short; } -$subadmin=variable_get("subadmin_restriction", 0); +$subadmin = variable_get("subadmin_restriction", 0); // If we ask for all account but we aren't "admin" and // subadmin var is not 1 -if ($show=="all" && !$subadmin==1 && $cuid != 2000) { - __("This page is restricted to authorized staff"); - include('foot.php'); - exit(); +if ($show == "all" && !$subadmin == 1 && $cuid != 2000) { + __("This page is restricted to authorized staff"); + include('foot.php'); + exit(); } if ($pattern && $pattern_type) { - $r=$admin->get_list($show == 'all' ? 1 : 0, $creator, $pattern, $pattern_type); + $accountList = $admin->get_list($show == 'all' ? 1 : 0, $creator, $pattern, $pattern_type); } else { - $r = FALSE; + $accountList = FALSE; } ?> @@ -72,198 +73,207 @@ if ($pattern && $pattern_type) { user["admlist"]==0) { // Normal (large) mode -?> -

-user["admlist"] == 0) { // Normal (large) mode + ?> +

+ -

- +

+
- -
-

- />  - /> - " /> -

-
- get_creator_list(); + +
+

+ />  + /> + " /> +

+
+ get_creator_list(); - if ($subadmin==1 || $cuid==2000) { - if($show != 'all') { - echo '

' . _('List all AlternC accounts') . ''; - - if ($subadmin==1 || $cuid==2000) { - $infos_creators = array(); + if ($subadmin == 1 || $cuid == 2000) { + if ($show != 'all') { + echo '

' . _('List all AlternC accounts') . ''; - foreach ($list_creators as $key => $val) { - $infos_creators[] = '' . $val['login'] . ''; + if ($subadmin == 1 || $cuid == 2000) { + $infos_creators = array(); + + foreach ($list_creators as $key => $val) { + $infos_creators[] = '' . $val['login'] . ''; + } + + if (count($infos_creators)) { + echo ' (' . _("Or only the accounts of:") . " " . implode(', ', $infos_creators) . ')'; + } + } + echo "

"; + } else { // if show != all + echo '

' . _('List only my accounts') . '

'; } - - if (count($infos_creators)) { - echo ' ('._("Or only the accounts of:")." ". implode(', ', $infos_creators) . ')'; - } - } - echo "

"; - } else { // if show != all - echo '

' . _('List only my accounts') . '

'; - } - }// END ($subadmin==1 || $cuid==2000) - ?> + }// END ($subadmin==1 || $cuid==2000) + ?>
- -' , $error, '

'; -} +', $error, '

'; +} ?>

- () + ()

'._("No account defined for now").'

'; - include('foot.php'); -} +if (!is_array($accountList) || empty($accountList)) { + echo '

' . _("No account defined for now") . '

'; + include('foot.php'); +} ?>
-user["admlist"]==0) { // Normal (large) mode -?> -

-5) { ?> -" /> - -

- - - - - - - - - - - - - -user["admlist"] == 0) { // Normal (large) mode + ?> +

+ 5) { ?> + " /> + +

+
+ + + + + + + + + + + + + - + $col = 1; + while (list($key, $val) = each($accountList)) { + $col = 3 - $col; + ?> + - - - - - - - - - - - - - - - - - - - - -
'; + + + + + + + + + + + + + + + + + + + + +
"> " value="" />>" href="mailto:"> 
renew_get_expiry($val['uid']) ?>
-
-"> - "> -  -   -" > - "> -  -" > - "> -  - -" > - "> -  - -
-
"> " value="" />>" href="mailto:"> 
renew_get_expiry($val['uid']) ?>
+
+ "> + "> +   +   + " > + "> +   + " > + "> +   + + " > + "> +   + +
+
+
+

+ " />

+ + user["admlist"]==1) { // SHORT MODE -?> +if ($mem->user["admlist"] == 1) { // SHORT MODE + ?> - [  ]     - [  ]     - [  ]     + [  ]     + [  ]     + [  ]     -

-50) { ?> - " /> - 50 ?> -

+

+ 50) { ?> + " /> + 50 ?> +

- - - - - - - + + + + + + '; } + $count_r = 0; + foreach ($accountList as $val) { + if (($count_r % 3) == 0) { + echo ''; + } - if ($val["su"]) { - echo ''; - } else { - echo ''; - } // if $val["su"] ?> - - - '; } - ++$count_r; -} // foreach $r -?> -
  - " title="">[  ] - " title="">[  ] - checkcreator($val['uid'])) { ?> - " title="">[  ]checkcreator - $creator_name = ( ($val['creator'] == '0')?_("himself"):$list_creators[$val['creator']]['login']) ?> - ">
-

" />

- - '; + } else { + echo ''; + } // if $val["su"] + ?> + + " title="">[  ] + " title="">[  ] + checkcreator($val['uid'])) { ?> + " title="">[  ]checkcreator + $creator_name = ( ($val['creator'] == '0') ? _("himself") : $list_creators[$val['creator']]['login']) + ?> + + "> + '; + } + ++$count_r; + } // foreach $accountList + ?> + +

" />

+ +