From d6be8a9f6366e445841561a1ae509ebec03eebad Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Tue, 21 Aug 2012 12:39:26 +0000 Subject: [PATCH] _POST et _GET transforme en getfields --- bureau/admin/adm_doms.php | 13 +++++++++---- bureau/admin/adm_dorenew.php | 9 ++++++++- bureau/admin/adm_login.php | 7 ++++++- bureau/admin/aide/help.php | 6 +++++- bureau/admin/bro_main.php | 6 ++++-- bureau/admin/cron.php | 9 +++++++-- bureau/admin/quota_show.php | 2 +- 7 files changed, 40 insertions(+), 12 deletions(-) diff --git a/bureau/admin/adm_doms.php b/bureau/admin/adm_doms.php index b094c149..5548550b 100644 --- a/bureau/admin/adm_doms.php +++ b/bureau/admin/adm_doms.php @@ -39,14 +39,19 @@ include_once ("head.php"); ?>

$error

"; - } +if (isset($error) && $error) { + echo "

$error

"; +} + +$fields = array ( + "force" => array ("get", "integer", "0"), +); +getFields($fields); // List the domains. If the first parameter is true, also check their DNS & other IPs actual parameters. // If the second parameter is true, check the domains whatever the dis cache is. -$forcecheck=@($_REQUEST["force"]!=""); +$forcecheck=$force; // retrocompatibility $c=$admin->dom_list(true,$forcecheck); ?> diff --git a/bureau/admin/adm_dorenew.php b/bureau/admin/adm_dorenew.php index e85e1b5f..e8451ca9 100644 --- a/bureau/admin/adm_dorenew.php +++ b/bureau/admin/adm_dorenew.php @@ -34,12 +34,19 @@ if (!$admin->enabled) { __("This page is restricted to authorized staff"); exit(); } + +$fields = array ( + "uid" => array ("post", "integer", ""), + "periods" => array ("post", "integer", ""), +); +getFields($fields); + if (!$admin->checkcreator($uid)) { __("This page is restricted to authorized staff"); exit(); } -if (!$admin->renew_mem($_REQUEST['uid'], $_REQUEST['periods'])){ +if (!$admin->renew_mem($uid, $periods)){ $error=$err->errstr(); include("adm_edit.php"); } else { diff --git a/bureau/admin/adm_login.php b/bureau/admin/adm_login.php index 2b8629b1..9344268e 100644 --- a/bureau/admin/adm_login.php +++ b/bureau/admin/adm_login.php @@ -35,9 +35,14 @@ require_once("../class/config.php"); * with no parameter when the admin want to go back to his admin account. */ +$fields = array ( + "id" => array ("request", "integer", ""), +); +getFields($fields); + // * with no parameter when the admin want to go back to his admin account. -if ( ( !isset($_REQUEST["id"]) || !$_REQUEST["id"]) && $_COOKIE["oldid"]) { +if ( $id && $_COOKIE["oldid"]) { // We check the cookie's value : list($newuid,$passcheck)=explode("/",$_COOKIE["oldid"]); $newuid=intval($newuid); diff --git a/bureau/admin/aide/help.php b/bureau/admin/aide/help.php index 59f4254f..c3170084 100644 --- a/bureau/admin/aide/help.php +++ b/bureau/admin/aide/help.php @@ -28,8 +28,12 @@ ---------------------------------------------------------------------- */ require_once("../../class/config_nochk.php"); +$fields = array ( + "hid" => array ("post", "integer", ""), +); +getFields($fields); -header("Location: ".$help_baseurl."go?version=".urlencode($L_VERSION)."&hid=".$_REQUEST["hid"]); +header("Location: ".$help_baseurl."go?version=".urlencode($L_VERSION)."&hid=$hid"]); exit(); diff --git a/bureau/admin/bro_main.php b/bureau/admin/bro_main.php index d54aa267..91d1147b 100644 --- a/bureau/admin/bro_main.php +++ b/bureau/admin/bro_main.php @@ -38,6 +38,7 @@ $fields = array ( "formu" => array ("request", "integer", ""), "actextract" => array ("request", "string", ""), "fileextract" => array ("request", "string", ""), + "actperms" => array ("request", "array", ""), "actdel" => array ("request", "string", ""), "actcopy" => array ("request", "string", ""), "actrename" => array ("request", "string", ""), @@ -46,6 +47,7 @@ $fields = array ( "nomfich" => array ("request", "string", ""), "del_confirm" => array ("request", "string", ""), "cancel" => array ("request", "string", ""), + "showdirsize" => array ("request", "integer", "0"), ); getFields($fields); @@ -149,7 +151,7 @@ if (isset($actextract) && $actextract) { } /* Creation de la liste des fichiers courants */ -$c=$bro->filelist($R, isset($_REQUEST['showdirsize'])?$_REQUEST['showdirsize']:null ); +$c=$bro->filelist($R, $showdirsize ); if ($c===false) $error=$err->errstr(); ?> @@ -222,7 +224,7 @@ if (isset($formu) && $formu==2 && isset($actrename) && $actrename && count($d)) } /* [ML] Changer les permissions : */ -if (isset($formu) && $formu==2 && isset($_REQUEST['actperms']) && $_REQUEST['actperms'] && count($d)) { +if ($formu==2 && ! (empty($actperms)) && count($d)) { echo "
\n"; echo "\n"; echo "\n"; diff --git a/bureau/admin/cron.php b/bureau/admin/cron.php index 12ec75f1..cdc6dcd2 100644 --- a/bureau/admin/cron.php +++ b/bureau/admin/cron.php @@ -2,8 +2,13 @@ require_once("../class/config.php"); include_once("head.php"); -if (isset($_POST['cron']) && is_array($_POST['cron'])) { - if (! $cron->update($_POST['cron'])) { +$fields = array ( + "cron" => array ("post", "array", ""), +); +getFields($fields); + +if (!empty($cron) { + if (! $cron->update($cron) { $error=_("There was an error during the record."); } else { $error=_("Save done."); diff --git a/bureau/admin/quota_show.php b/bureau/admin/quota_show.php index e2447468..0ebb2a32 100644 --- a/bureau/admin/quota_show.php +++ b/bureau/admin/quota_show.php @@ -44,7 +44,7 @@ if (!is_array($q)) { reset($qlist); $col=1; while (list($key,$val)=each($qlist)) { - if (!$q[$key]["t"]) continue; + if ( !isset($q[$key]) || !$q[$key]["t"]) continue; $col=3-$col; echo ""; echo "";