_POST et _GET transforme en getfields

This commit is contained in:
Alan Garcia 2012-08-21 12:39:26 +00:00
parent 8d3204643f
commit d6be8a9f63
7 changed files with 40 additions and 12 deletions

View File

@ -39,14 +39,19 @@ include_once ("head.php");
?> ?>
<h3><?php __("Manage installed domains"); ?></h3> <h3><?php __("Manage installed domains"); ?></h3>
<?php <?php
if (isset($error) && $error) { if (isset($error) && $error) {
echo "<p class=\"error\">$error</p>"; echo "<p class=\"error\">$error</p>";
} }
$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. // 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. // 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); $c=$admin->dom_list(true,$forcecheck);
?> ?>

View File

@ -34,12 +34,19 @@ if (!$admin->enabled) {
__("This page is restricted to authorized staff"); __("This page is restricted to authorized staff");
exit(); exit();
} }
$fields = array (
"uid" => array ("post", "integer", ""),
"periods" => array ("post", "integer", ""),
);
getFields($fields);
if (!$admin->checkcreator($uid)) { if (!$admin->checkcreator($uid)) {
__("This page is restricted to authorized staff"); __("This page is restricted to authorized staff");
exit(); exit();
} }
if (!$admin->renew_mem($_REQUEST['uid'], $_REQUEST['periods'])){ if (!$admin->renew_mem($uid, $periods)){
$error=$err->errstr(); $error=$err->errstr();
include("adm_edit.php"); include("adm_edit.php");
} else { } else {

View File

@ -35,9 +35,14 @@ require_once("../class/config.php");
* with no parameter when the admin want to go back to his admin account. * 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. // * 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 : // We check the cookie's value :
list($newuid,$passcheck)=explode("/",$_COOKIE["oldid"]); list($newuid,$passcheck)=explode("/",$_COOKIE["oldid"]);
$newuid=intval($newuid); $newuid=intval($newuid);

View File

@ -28,8 +28,12 @@
---------------------------------------------------------------------- ----------------------------------------------------------------------
*/ */
require_once("../../class/config_nochk.php"); 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(); exit();

View File

@ -38,6 +38,7 @@ $fields = array (
"formu" => array ("request", "integer", ""), "formu" => array ("request", "integer", ""),
"actextract" => array ("request", "string", ""), "actextract" => array ("request", "string", ""),
"fileextract" => array ("request", "string", ""), "fileextract" => array ("request", "string", ""),
"actperms" => array ("request", "array", ""),
"actdel" => array ("request", "string", ""), "actdel" => array ("request", "string", ""),
"actcopy" => array ("request", "string", ""), "actcopy" => array ("request", "string", ""),
"actrename" => array ("request", "string", ""), "actrename" => array ("request", "string", ""),
@ -46,6 +47,7 @@ $fields = array (
"nomfich" => array ("request", "string", ""), "nomfich" => array ("request", "string", ""),
"del_confirm" => array ("request", "string", ""), "del_confirm" => array ("request", "string", ""),
"cancel" => array ("request", "string", ""), "cancel" => array ("request", "string", ""),
"showdirsize" => array ("request", "integer", "0"),
); );
getFields($fields); getFields($fields);
@ -149,7 +151,7 @@ if (isset($actextract) && $actextract) {
} }
/* Creation de la liste des fichiers courants */ /* 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(); if ($c===false) $error=$err->errstr();
?> ?>
@ -222,7 +224,7 @@ if (isset($formu) && $formu==2 && isset($actrename) && $actrename && count($d))
} }
/* [ML] Changer les permissions : */ /* [ML] Changer les permissions : */
if (isset($formu) && $formu==2 && isset($_REQUEST['actperms']) && $_REQUEST['actperms'] && count($d)) { if ($formu==2 && ! (empty($actperms)) && count($d)) {
echo "<form action=\"bro_main.php\" method=\"post\">\n"; echo "<form action=\"bro_main.php\" method=\"post\">\n";
echo "<input type=\"hidden\" name=\"R\" value=\"$R\" />\n"; echo "<input type=\"hidden\" name=\"R\" value=\"$R\" />\n";
echo "<input type=\"hidden\" name=\"formu\" value=\"7\" />\n"; echo "<input type=\"hidden\" name=\"formu\" value=\"7\" />\n";

View File

@ -2,8 +2,13 @@
require_once("../class/config.php"); require_once("../class/config.php");
include_once("head.php"); include_once("head.php");
if (isset($_POST['cron']) && is_array($_POST['cron'])) { $fields = array (
if (! $cron->update($_POST['cron'])) { "cron" => array ("post", "array", ""),
);
getFields($fields);
if (!empty($cron) {
if (! $cron->update($cron) {
$error=_("There was an error during the record."); $error=_("There was an error during the record.");
} else { } else {
$error=_("Save done."); $error=_("Save done.");

View File

@ -44,7 +44,7 @@ if (!is_array($q)) {
reset($qlist); reset($qlist);
$col=1; $col=1;
while (list($key,$val)=each($qlist)) { while (list($key,$val)=each($qlist)) {
if (!$q[$key]["t"]) continue; if ( !isset($q[$key]) || !$q[$key]["t"]) continue;
$col=3-$col; $col=3-$col;
echo "<tr class=\"lst$col\">"; echo "<tr class=\"lst$col\">";
echo "<td>"; echo "<td>";