diff --git a/bureau/admin/adm_deactivate.php b/bureau/admin/adm_deactivate.php index 0974bb9d..215b59f4 100644 --- a/bureau/admin/adm_deactivate.php +++ b/bureau/admin/adm_deactivate.php @@ -31,13 +31,24 @@ require_once("../class/config.php"); include_once("head.php"); -$uid = $_GET['uid']; +if (!$admin->enabled) { + __("This page is restricted to authorized staff"); + exit; +} +$fields = array ( + "uid" => array ("request", "integer", ""), + "submit" => array ("post", "string", ""), + "redirect" => array ("post", "string", ""), +); +getFields($fields); + if (!$uid) { __("Missing uid"); include_once("foot.php"); exit(); } -if (!$admin->enabled || !$admin->checkcreator($uid)) { + +if (!$admin->checkcreator($uid)) { __("This page is restricted to authorized staff"); include_once("foot.php"); exit(); @@ -49,12 +60,15 @@ if (!$r=$admin->get($uid)) { exit(); } -if (! ($confirmed = ($_GET['submit'] == _("Confirm")) ) ) { +$confirmed = ($submit == _("Confirm"))?true:false; + + +if (! ($confirmed ) ) { print '

' . _('WARNING: experimental feature, use at your own risk') . '

'; __("The following domains will be deactivated and redirected to the URL entered in the following box. A backup of the domain configuration will be displayed as a serie of SQL request that you can run to restore the current configuration if you want. Click confirm if you are sure you want to deactivate all this user's domains."); ?> -
+ " /> @@ -63,13 +77,11 @@ if (! ($confirmed = ($_GET['submit'] == _("Confirm")) ) ) { print "

" . _("Domains of user: ") . $r["login"] . "

"; } else { - if (!$_GET['redirect']) { + if (empty($redirect)) { __("Missing redirect url."); include_once("foot.php"); exit(); - } else { - $redirect = $_GET['redirect']; - } + } } # this string will contain an SQL request that will be printed at the end of the process and that can be used to reload the old domain configuration diff --git a/bureau/admin/adm_list.php b/bureau/admin/adm_list.php index 6ff8efb7..9fc90700 100644 --- a/bureau/admin/adm_list.php +++ b/bureau/admin/adm_list.php @@ -41,7 +41,7 @@ if (!$admin->enabled) { $fields = array ( "show" => array ("request", "string", ""), "creator" => array("request", "integer", 0), - "short" => array("request", "integer", -1), + "short" => array("request", "integer", -1), ); getFields($fields); @@ -112,11 +112,10 @@ if ($mem->user["admlist"]==0) { // Normal (large) mode 5) { ?> " /> - +   - @@ -196,10 +195,9 @@ if ($mem->user["admlist"]==1) { // SHORT MODE 50) { ?> " /> - + -   @@ -254,7 +252,11 @@ if (is_array($val)) { } else echo ""; -$val=$r[$z+2*$rz]; +$val=null; +if (isset($r[$z+2*$rz])) { + $val=$r[$z+2*$rz]; +} + if (is_array($val)) { ?>