Skip to content
Snippets Groups Projects
Commit f476985c authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: Control of parameters was not done.

parent cca07bd8
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,11 @@ ...@@ -25,6 +25,11 @@
* \version $Id$ * \version $Id$
*/ */
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path=str_replace($script_file,'',$_SERVER["PHP_SELF"]);
$path=preg_replace('@[\\\/]+$@','',$path).'/';
// Test si mode batch // Test si mode batch
$sapi_type = php_sapi_name(); $sapi_type = php_sapi_name();
if (substr($sapi_type, 0, 3) == 'cgi') { if (substr($sapi_type, 0, 3) == 'cgi') {
...@@ -32,8 +37,10 @@ if (substr($sapi_type, 0, 3) == 'cgi') { ...@@ -32,8 +37,10 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
exit; exit;
} }
// Recupere root dolibarr if (! isset($argv[1]) || ! $argv[1]) {
$path=str_replace('email_unpaid_invoices_to_representatives.php','',$_SERVER["PHP_SELF"]); print "Usage: $script_file now\n";
exit;
}
require($path."../../htdocs/master.inc.php"); require($path."../../htdocs/master.inc.php");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment