2
0
forked from Wavyzz/dolibarr

Fix: Error in GETPOST function

This commit is contained in:
Laurent Destailleur
2010-11-10 23:54:59 +00:00
parent e93f512d9e
commit baad7963a7
7 changed files with 20 additions and 16 deletions

View File

@@ -22,7 +22,7 @@
/** /**
* \file htdocs/install/check.php * \file htdocs/install/check.php
* \ingroup install * \ingroup install
* \brief Test si le fichier conf est modifiable et si il n'existe pas, test la possibilite de le creer * \brief Test if file conf can be modified and if does not exists, test if install process can create it
* \version $Id$ * \version $Id$
*/ */
include_once("./inc.php"); include_once("./inc.php");
@@ -44,11 +44,14 @@ if (file_exists("./install.forced.php")) include_once("./install.forced.php");
dolibarr_install_syslog("Dolibarr install/upgrade process started"); dolibarr_install_syslog("Dolibarr install/upgrade process started");
/* /*
* View * View
*/ */
pHeader('',""); // Etape suivante = license pHeader('',''); // No next step for navigation buttons. Next step is defined by clik on links.
print '<center>'; print '<center>';
print '<img src="../theme/dolibarr_logo.png" alt="Dolibarr logo"><br>'; print '<img src="../theme/dolibarr_logo.png" alt="Dolibarr logo"><br>';
@@ -348,7 +351,8 @@ else
print '<td align="center">'; print '<td align="center">';
if ($allowinstall) if ($allowinstall)
{ {
print '<a href="licence.php?selectlang='.$setuplang.'">'.$langs->trans("Start").'</a>'; //print '<a href="licence.php?selectlang='.$setuplang.'">'.$langs->trans("Start").'</a>'; // To restore licence page
print '<a href="fileconf.php?selectlang='.$setuplang.'">'.$langs->trans("Start").'</a>';
} }
else else
{ {

View File

@@ -280,7 +280,7 @@ print "<br>";
// Create lock file // Create lock file
// If first install // If first install
if ($_POST["action"] == "set") if (GETPOST("action") == "set")
{ {
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION)) if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION))
{ {
@@ -330,7 +330,7 @@ if ($_POST["action"] == "set")
} }
} }
// If upgrade // If upgrade
elseif (preg_match('/upgrade/i',$_POST["action"])) elseif (preg_match('/upgrade/i',GETPOST("action")))
{ {
if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION)) if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE) || ($conf->global->MAIN_VERSION_LAST_UPGRADE == DOL_VERSION))
{ {

View File

@@ -279,7 +279,7 @@ function conf($dolibarr_main_document_root)
* *
* @param $soutitre * @param $soutitre
* @param $next * @param $next
* @param $action * @param $action Action code ('set' or 'upgrade')
* @param $param * @param $param
*/ */
function pHeader($soutitre,$next,$action='set',$param='') function pHeader($soutitre,$next,$action='set',$param='')

View File

@@ -20,7 +20,7 @@
/** /**
* \file htdocs/install/licence.php * \file htdocs/install/licence.php
* \ingroup install * \ingroup install
* \brief Page affichage license * \brief Page to show licence (Removed from install process to save time)
* \version $Id$ * \version $Id$
*/ */

View File

@@ -72,7 +72,7 @@ pHeader('',"upgrade2",isset($_REQUEST['action'])?$_REQUEST['action']:'','version
$actiondone=0; $actiondone=0;
// Action to launch the repair or migrate script // Action to launch the repair or migrate script
if (! isset($_GET["action"]) || preg_match('/upgrade/i',$_GET["action"])) if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
{ {
$actiondone=1; $actiondone=1;

View File

@@ -21,7 +21,7 @@
/** /**
* \file htdocs/install/upgrade2.php * \file htdocs/install/upgrade2.php
* \brief Effectue la migration de donnees diverses * \brief Upgrade some data
* \version $Id$ * \version $Id$
*/ */
@@ -80,7 +80,7 @@ if (! is_object($conf)) dolibarr_install_syslog("upgrade2: conf file not initial
pHeader('','etape5',GETPOST("action"),'versionfrom='.$versionfrom.'&versionto='.$versionto); pHeader('','etape5',GETPOST("action"),'versionfrom='.$versionfrom.'&versionto='.$versionto);
if (GETPOST('action') && preg_match('/upgrade/i',GETPOST("action"))) if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
{ {
print '<h3>'.$langs->trans('DataMigration').'</h3>'; print '<h3>'.$langs->trans('DataMigration').'</h3>';
@@ -3244,7 +3244,7 @@ function migrate_reload_modules($db,$langs,$conf)
//$mod->remove('noboxes'); //$mod->remove('noboxes');
$mod->init(); $mod->init();
} }
if (! empty($conf->global->MAIN_MODULE_USER)) // Permission has changed into 3.0 if (! empty($conf->global->MAIN_MODULE_USER)) // Permission has changed into 3.0
{ {
dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module User"); dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module User");

View File

@@ -46,19 +46,19 @@ if (! defined('ADODB_DATE_VERSION')) include_once(DOL_DOCUMENT_ROOT."/includes/a
*/ */
function GETPOST($paramname,$check='',$method=0) function GETPOST($paramname,$check='',$method=0)
{ {
if ($method=1) $out = isset($_GET[$paramname])?$_GET[$paramname]:''; if ($method==1) $out = isset($_GET[$paramname])?$_GET[$paramname]:'';
else if ($method=2) isset($_POST[$paramname])?$_POST[$paramname]:''; else if ($method==2) isset($_POST[$paramname])?$_POST[$paramname]:'';
else $out = isset($_GET[$paramname])?$_GET[$paramname]:(isset($_POST[$paramname])?$_POST[$paramname]:''); else $out = isset($_GET[$paramname])?$_GET[$paramname]:(isset($_POST[$paramname])?$_POST[$paramname]:'');
// Clean value // Clean value
$out = trim($out); $out = trim($out);
if (!empty($check)) if (!empty($check))
{ {
// Check if integer // Check if integer
if ($check = 'int' && ! is_int($out)) $out=''; if ($check = 'int' && ! is_int($out)) $out='';
} }
return $out; return $out;
} }