@@ -249,8 +249,7 @@ discard block |
||
| 249 | 249 | print __METHOD__." call method ".$WS_METHOD."\n"; |
| 250 | 250 | try { |
| 251 | 251 | $result = $this->soapclient->call($WS_METHOD,$parameters,$this->ns,''); |
| 252 | - } |
|
| 253 | - catch(SoapFault $exception) |
|
| 252 | + } catch(SoapFault $exception) |
|
| 254 | 253 | { |
| 255 | 254 | echo $exception; |
| 256 | 255 | $result=0; |
@@ -307,8 +306,7 @@ discard block |
||
| 307 | 306 | print __METHOD__." call method ".$WS_METHOD."\n"; |
| 308 | 307 | try { |
| 309 | 308 | $result = $this->soapclient->call($WS_METHOD,$parameters,$this->ns,''); |
| 310 | - } |
|
| 311 | - catch(SoapFault $exception) |
|
| 309 | + } catch(SoapFault $exception) |
|
| 312 | 310 | { |
| 313 | 311 | echo $exception; |
| 314 | 312 | $result=0; |
@@ -407,8 +405,7 @@ discard block |
||
| 407 | 405 | print __METHOD__." call method ".$WS_METHOD."\n"; |
| 408 | 406 | try { |
| 409 | 407 | $result = $this->soapclient->call($WS_METHOD,$parameters,$this->ns,''); |
| 410 | - } |
|
| 411 | - catch(SoapFault $exception) |
|
| 408 | + } catch(SoapFault $exception) |
|
| 412 | 409 | { |
| 413 | 410 | echo $exception; |
| 414 | 411 | $result=0; |
@@ -28,16 +28,39 @@ |
||
| 28 | 28 | //require_once 'PHPUnit/Autoload.php'; |
| 29 | 29 | require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; |
| 30 | 30 | |
| 31 | -if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); |
|
| 32 | -if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); |
|
| 33 | -if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); |
|
| 34 | -if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); |
|
| 35 | -if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); |
|
| 36 | -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); |
|
| 37 | -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no menu to show |
|
| 38 | -if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php |
|
| 39 | -if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); |
|
| 40 | -if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) |
|
| 31 | +if (! defined('NOREQUIREUSER')) { |
|
| 32 | + define('NOREQUIREUSER','1'); |
|
| 33 | +} |
|
| 34 | +if (! defined('NOREQUIREDB')) { |
|
| 35 | + define('NOREQUIREDB','1'); |
|
| 36 | +} |
|
| 37 | +if (! defined('NOREQUIRESOC')) { |
|
| 38 | + define('NOREQUIRESOC','1'); |
|
| 39 | +} |
|
| 40 | +if (! defined('NOREQUIRETRAN')) { |
|
| 41 | + define('NOREQUIRETRAN','1'); |
|
| 42 | +} |
|
| 43 | +if (! defined('NOCSRFCHECK')) { |
|
| 44 | + define('NOCSRFCHECK','1'); |
|
| 45 | +} |
|
| 46 | +if (! defined('NOTOKENRENEWAL')) { |
|
| 47 | + define('NOTOKENRENEWAL','1'); |
|
| 48 | +} |
|
| 49 | +if (! defined('NOREQUIREMENU')) { |
|
| 50 | + define('NOREQUIREMENU','1'); |
|
| 51 | +} |
|
| 52 | +// If there is no menu to show |
|
| 53 | +if (! defined('NOREQUIREHTML')) { |
|
| 54 | + define('NOREQUIREHTML','1'); |
|
| 55 | +} |
|
| 56 | +// If we don't need to load the html.form.class.php |
|
| 57 | +if (! defined('NOREQUIREAJAX')) { |
|
| 58 | + define('NOREQUIREAJAX','1'); |
|
| 59 | +} |
|
| 60 | +if (! defined("NOLOGIN")) { |
|
| 61 | + define("NOLOGIN",'1'); |
|
| 62 | +} |
|
| 63 | +// If this page is public (can be called outside logged session) |
|
| 41 | 64 | |
| 42 | 65 | |
| 43 | 66 | /** |
@@ -29,16 +29,39 @@ |
||
| 29 | 29 | require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; |
| 30 | 30 | require_once dirname(__FILE__).'/../../htdocs/core/lib/functions2.lib.php'; |
| 31 | 31 | |
| 32 | -if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); |
|
| 33 | -if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); |
|
| 34 | -if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); |
|
| 35 | -if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); |
|
| 36 | -if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); |
|
| 37 | -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); |
|
| 38 | -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no menu to show |
|
| 39 | -if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php |
|
| 40 | -if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); |
|
| 41 | -if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) |
|
| 32 | +if (! defined('NOREQUIREUSER')) { |
|
| 33 | + define('NOREQUIREUSER','1'); |
|
| 34 | +} |
|
| 35 | +if (! defined('NOREQUIREDB')) { |
|
| 36 | + define('NOREQUIREDB','1'); |
|
| 37 | +} |
|
| 38 | +if (! defined('NOREQUIRESOC')) { |
|
| 39 | + define('NOREQUIRESOC','1'); |
|
| 40 | +} |
|
| 41 | +if (! defined('NOREQUIRETRAN')) { |
|
| 42 | + define('NOREQUIRETRAN','1'); |
|
| 43 | +} |
|
| 44 | +if (! defined('NOCSRFCHECK')) { |
|
| 45 | + define('NOCSRFCHECK','1'); |
|
| 46 | +} |
|
| 47 | +if (! defined('NOTOKENRENEWAL')) { |
|
| 48 | + define('NOTOKENRENEWAL','1'); |
|
| 49 | +} |
|
| 50 | +if (! defined('NOREQUIREMENU')) { |
|
| 51 | + define('NOREQUIREMENU','1'); |
|
| 52 | +} |
|
| 53 | +// If there is no menu to show |
|
| 54 | +if (! defined('NOREQUIREHTML')) { |
|
| 55 | + define('NOREQUIREHTML','1'); |
|
| 56 | +} |
|
| 57 | +// If we don't need to load the html.form.class.php |
|
| 58 | +if (! defined('NOREQUIREAJAX')) { |
|
| 59 | + define('NOREQUIREAJAX','1'); |
|
| 60 | +} |
|
| 61 | +if (! defined("NOLOGIN")) { |
|
| 62 | + define("NOLOGIN",'1'); |
|
| 63 | +} |
|
| 64 | +// If this page is public (can be called outside logged session) |
|
| 42 | 65 | |
| 43 | 66 | |
| 44 | 67 | /** |
@@ -30,16 +30,39 @@ |
||
| 30 | 30 | require_once dirname(__FILE__).'/../../htdocs/core/lib/security.lib.php'; |
| 31 | 31 | require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php'; |
| 32 | 32 | |
| 33 | -if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); |
|
| 34 | -if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); |
|
| 35 | -if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); |
|
| 36 | -if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); |
|
| 37 | -if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); |
|
| 38 | -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); |
|
| 39 | -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no menu to show |
|
| 40 | -if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php |
|
| 41 | -if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); |
|
| 42 | -if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) |
|
| 33 | +if (! defined('NOREQUIREUSER')) { |
|
| 34 | + define('NOREQUIREUSER','1'); |
|
| 35 | +} |
|
| 36 | +if (! defined('NOREQUIREDB')) { |
|
| 37 | + define('NOREQUIREDB','1'); |
|
| 38 | +} |
|
| 39 | +if (! defined('NOREQUIRESOC')) { |
|
| 40 | + define('NOREQUIRESOC','1'); |
|
| 41 | +} |
|
| 42 | +if (! defined('NOREQUIRETRAN')) { |
|
| 43 | + define('NOREQUIRETRAN','1'); |
|
| 44 | +} |
|
| 45 | +if (! defined('NOCSRFCHECK')) { |
|
| 46 | + define('NOCSRFCHECK','1'); |
|
| 47 | +} |
|
| 48 | +if (! defined('NOTOKENRENEWAL')) { |
|
| 49 | + define('NOTOKENRENEWAL','1'); |
|
| 50 | +} |
|
| 51 | +if (! defined('NOREQUIREMENU')) { |
|
| 52 | + define('NOREQUIREMENU','1'); |
|
| 53 | +} |
|
| 54 | +// If there is no menu to show |
|
| 55 | +if (! defined('NOREQUIREHTML')) { |
|
| 56 | + define('NOREQUIREHTML','1'); |
|
| 57 | +} |
|
| 58 | +// If we don't need to load the html.form.class.php |
|
| 59 | +if (! defined('NOREQUIREAJAX')) { |
|
| 60 | + define('NOREQUIREAJAX','1'); |
|
| 61 | +} |
|
| 62 | +if (! defined("NOLOGIN")) { |
|
| 63 | + define("NOLOGIN",'1'); |
|
| 64 | +} |
|
| 65 | +// If this page is public (can be called outside logged session) |
|
| 43 | 66 | |
| 44 | 67 | if (empty($user->id)) |
| 45 | 68 | { |
@@ -28,16 +28,39 @@ discard block |
||
| 28 | 28 | //require_once 'PHPUnit/Autoload.php'; |
| 29 | 29 | //require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; |
| 30 | 30 | |
| 31 | -if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); |
|
| 32 | -if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); |
|
| 33 | -if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); |
|
| 34 | -if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); |
|
| 35 | -if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); |
|
| 36 | -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); |
|
| 37 | -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no menu to show |
|
| 38 | -if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php |
|
| 39 | -if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); |
|
| 40 | -if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) |
|
| 31 | +if (! defined('NOREQUIREUSER')) { |
|
| 32 | + define('NOREQUIREUSER','1'); |
|
| 33 | +} |
|
| 34 | +if (! defined('NOREQUIREDB')) { |
|
| 35 | + define('NOREQUIREDB','1'); |
|
| 36 | +} |
|
| 37 | +if (! defined('NOREQUIRESOC')) { |
|
| 38 | + define('NOREQUIRESOC','1'); |
|
| 39 | +} |
|
| 40 | +if (! defined('NOREQUIRETRAN')) { |
|
| 41 | + define('NOREQUIRETRAN','1'); |
|
| 42 | +} |
|
| 43 | +if (! defined('NOCSRFCHECK')) { |
|
| 44 | + define('NOCSRFCHECK','1'); |
|
| 45 | +} |
|
| 46 | +if (! defined('NOTOKENRENEWAL')) { |
|
| 47 | + define('NOTOKENRENEWAL','1'); |
|
| 48 | +} |
|
| 49 | +if (! defined('NOREQUIREMENU')) { |
|
| 50 | + define('NOREQUIREMENU','1'); |
|
| 51 | +} |
|
| 52 | +// If there is no menu to show |
|
| 53 | +if (! defined('NOREQUIREHTML')) { |
|
| 54 | + define('NOREQUIREHTML','1'); |
|
| 55 | +} |
|
| 56 | +// If we don't need to load the html.form.class.php |
|
| 57 | +if (! defined('NOREQUIREAJAX')) { |
|
| 58 | + define('NOREQUIREAJAX','1'); |
|
| 59 | +} |
|
| 60 | +if (! defined("NOLOGIN")) { |
|
| 61 | + define("NOLOGIN",'1'); |
|
| 62 | +} |
|
| 63 | +// If this page is public (can be called outside logged session) |
|
| 41 | 64 | |
| 42 | 65 | |
| 43 | 66 | /** |
@@ -284,7 +307,9 @@ discard block |
||
| 284 | 307 | $inj += preg_match('/<script/i', $val); |
| 285 | 308 | $inj += preg_match('/<iframe/i', $val); |
| 286 | 309 | $inj += preg_match('/Set\.constructor/i', $val); // ECMA script 6 |
| 287 | - if (! defined('NOSTYLECHECK')) $inj += preg_match('/<style/i', $val); |
|
| 310 | + if (! defined('NOSTYLECHECK')) { |
|
| 311 | + $inj += preg_match('/<style/i', $val); |
|
| 312 | + } |
|
| 288 | 313 | $inj += preg_match('/base[\s]+href/si', $val); |
| 289 | 314 | $inj += preg_match('/<.*onmouse/si', $val); // onmousexxx can be set on img or any html tag like <img title='...' onmouseover=alert(1)> |
| 290 | 315 | $inj += preg_match('/onerror\s*=/i', $val); // onerror can be set on img or any html tag like <img title='...' onerror = alert(1)> |
@@ -298,8 +323,14 @@ discard block |
||
| 298 | 323 | $inj += preg_match('/vbscript:/i', $val); |
| 299 | 324 | //} |
| 300 | 325 | // For XSS Injection done by adding javascript closing html tags like with onmousemove, etc... (closing a src or href tag with not cleaned param) |
| 301 | - if ($type == 1) $inj += preg_match('/"/i', $val); // We refused " in GET parameters value |
|
| 302 | - if ($type == 2) $inj += preg_match('/[;"]/', $val); // PHP_SELF is a file system path. It can contains spaces. |
|
| 326 | + if ($type == 1) { |
|
| 327 | + $inj += preg_match('/"/i', $val); |
|
| 328 | + } |
|
| 329 | + // We refused " in GET parameters value |
|
| 330 | + if ($type == 2) { |
|
| 331 | + $inj += preg_match('/[;"]/', $val); |
|
| 332 | + } |
|
| 333 | + // PHP_SELF is a file system path. It can contains spaces. |
|
| 303 | 334 | return $inj; |
| 304 | 335 | } |
| 305 | 336 | |
@@ -30,16 +30,39 @@ discard block |
||
| 30 | 30 | require_once dirname(__FILE__).'/../../htdocs/core/lib/security.lib.php'; |
| 31 | 31 | require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php'; |
| 32 | 32 | |
| 33 | -if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); |
|
| 34 | -if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); |
|
| 35 | -if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); |
|
| 36 | -if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); |
|
| 37 | -if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); |
|
| 38 | -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); |
|
| 39 | -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no menu to show |
|
| 40 | -if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php |
|
| 41 | -if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); |
|
| 42 | -if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) |
|
| 33 | +if (! defined('NOREQUIREUSER')) { |
|
| 34 | + define('NOREQUIREUSER','1'); |
|
| 35 | +} |
|
| 36 | +if (! defined('NOREQUIREDB')) { |
|
| 37 | + define('NOREQUIREDB','1'); |
|
| 38 | +} |
|
| 39 | +if (! defined('NOREQUIRESOC')) { |
|
| 40 | + define('NOREQUIRESOC','1'); |
|
| 41 | +} |
|
| 42 | +if (! defined('NOREQUIRETRAN')) { |
|
| 43 | + define('NOREQUIRETRAN','1'); |
|
| 44 | +} |
|
| 45 | +if (! defined('NOCSRFCHECK')) { |
|
| 46 | + define('NOCSRFCHECK','1'); |
|
| 47 | +} |
|
| 48 | +if (! defined('NOTOKENRENEWAL')) { |
|
| 49 | + define('NOTOKENRENEWAL','1'); |
|
| 50 | +} |
|
| 51 | +if (! defined('NOREQUIREMENU')) { |
|
| 52 | + define('NOREQUIREMENU','1'); |
|
| 53 | +} |
|
| 54 | +// If there is no menu to show |
|
| 55 | +if (! defined('NOREQUIREHTML')) { |
|
| 56 | + define('NOREQUIREHTML','1'); |
|
| 57 | +} |
|
| 58 | +// If we don't need to load the html.form.class.php |
|
| 59 | +if (! defined('NOREQUIREAJAX')) { |
|
| 60 | + define('NOREQUIREAJAX','1'); |
|
| 61 | +} |
|
| 62 | +if (! defined("NOLOGIN")) { |
|
| 63 | + define("NOLOGIN",'1'); |
|
| 64 | +} |
|
| 65 | +// If this page is public (can be called outside logged session) |
|
| 43 | 66 | |
| 44 | 67 | if (empty($user->id)) |
| 45 | 68 | { |
@@ -148,7 +171,9 @@ discard block |
||
| 148 | 171 | $filesarray = scandir(DOL_DOCUMENT_ROOT.'/langs'); |
| 149 | 172 | foreach($filesarray as $key => $code) |
| 150 | 173 | { |
| 151 | - if (! preg_match('/^[a-z]+_[A-Z]+$/',$code)) continue; |
|
| 174 | + if (! preg_match('/^[a-z]+_[A-Z]+$/',$code)) { |
|
| 175 | + continue; |
|
| 176 | + } |
|
| 152 | 177 | |
| 153 | 178 | print 'Check language file for lang code='.$code."\n"; |
| 154 | 179 | $tmplangs=new Translate('',$conf); |
@@ -332,8 +332,9 @@ |
||
| 332 | 332 | $oVarsB=get_object_vars($oB); |
| 333 | 333 | $aKeys=array_keys($oVarsA); |
| 334 | 334 | foreach($aKeys as $sKey) { |
| 335 | - if (in_array($sKey,$fieldstoignorearray)) |
|
| 336 | - continue; |
|
| 335 | + if (in_array($sKey,$fieldstoignorearray)) { |
|
| 336 | + continue; |
|
| 337 | + } |
|
| 337 | 338 | if (! $ignoretype && $oVarsA[$sKey] !== $oVarsB[$sKey]) { |
| 338 | 339 | $retAr[]=$sKey.' : '.(is_object($oVarsA[$sKey])?get_class($oVarsA[$sKey]):$oVarsA[$sKey]).' <> '.(is_object($oVarsB[$sKey])?get_class($oVarsB[$sKey]):$oVarsB[$sKey]); |
| 339 | 340 | } |
@@ -356,15 +356,16 @@ |
||
| 356 | 356 | if (get_class($oA) !== get_class($oB)) |
| 357 | 357 | { |
| 358 | 358 | $retAr[]="Supplied objects are not of same class."; |
| 359 | - } |
|
| 360 | - else |
|
| 359 | + } else |
|
| 361 | 360 | { |
| 362 | 361 | $oVarsA=get_object_vars($oA); |
| 363 | 362 | $oVarsB=get_object_vars($oB); |
| 364 | 363 | $aKeys=array_keys($oVarsA); |
| 365 | 364 | foreach($aKeys as $sKey) |
| 366 | 365 | { |
| 367 | - if (in_array($sKey,$fieldstoignorearray)) continue; |
|
| 366 | + if (in_array($sKey,$fieldstoignorearray)) { |
|
| 367 | + continue; |
|
| 368 | + } |
|
| 368 | 369 | if (! $ignoretype && $oVarsA[$sKey] !== $oVarsB[$sKey]) |
| 369 | 370 | { |
| 370 | 371 | $retAr[]=$sKey.' : '.(is_object($oVarsA[$sKey])?get_class($oVarsA[$sKey]):$oVarsA[$sKey]).' <> '.(is_object($oVarsB[$sKey])?get_class($oVarsB[$sKey]):$oVarsB[$sKey]); |
@@ -30,16 +30,39 @@ discard block |
||
| 30 | 30 | require_once dirname(__FILE__).'/../../htdocs/core/lib/security.lib.php'; |
| 31 | 31 | require_once dirname(__FILE__).'/../../htdocs/core/lib/security2.lib.php'; |
| 32 | 32 | |
| 33 | -if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); |
|
| 34 | -if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); |
|
| 35 | -if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); |
|
| 36 | -if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); |
|
| 37 | -if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); |
|
| 38 | -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); |
|
| 39 | -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no menu to show |
|
| 40 | -if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php |
|
| 41 | -if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); |
|
| 42 | -if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) |
|
| 33 | +if (! defined('NOREQUIREUSER')) { |
|
| 34 | + define('NOREQUIREUSER','1'); |
|
| 35 | +} |
|
| 36 | +if (! defined('NOREQUIREDB')) { |
|
| 37 | + define('NOREQUIREDB','1'); |
|
| 38 | +} |
|
| 39 | +if (! defined('NOREQUIRESOC')) { |
|
| 40 | + define('NOREQUIRESOC','1'); |
|
| 41 | +} |
|
| 42 | +if (! defined('NOREQUIRETRAN')) { |
|
| 43 | + define('NOREQUIRETRAN','1'); |
|
| 44 | +} |
|
| 45 | +if (! defined('NOCSRFCHECK')) { |
|
| 46 | + define('NOCSRFCHECK','1'); |
|
| 47 | +} |
|
| 48 | +if (! defined('NOTOKENRENEWAL')) { |
|
| 49 | + define('NOTOKENRENEWAL','1'); |
|
| 50 | +} |
|
| 51 | +if (! defined('NOREQUIREMENU')) { |
|
| 52 | + define('NOREQUIREMENU','1'); |
|
| 53 | +} |
|
| 54 | +// If there is no menu to show |
|
| 55 | +if (! defined('NOREQUIREHTML')) { |
|
| 56 | + define('NOREQUIREHTML','1'); |
|
| 57 | +} |
|
| 58 | +// If we don't need to load the html.form.class.php |
|
| 59 | +if (! defined('NOREQUIREAJAX')) { |
|
| 60 | + define('NOREQUIREAJAX','1'); |
|
| 61 | +} |
|
| 62 | +if (! defined("NOLOGIN")) { |
|
| 63 | + define("NOLOGIN",'1'); |
|
| 64 | +} |
|
| 65 | +// If this page is public (can be called outside logged session) |
|
| 43 | 66 | |
| 44 | 67 | if (empty($user->id)) |
| 45 | 68 | { |
@@ -152,8 +175,9 @@ discard block |
||
| 152 | 175 | |
| 153 | 176 | foreach($filesarray as $key => $file) |
| 154 | 177 | { |
| 155 | - if (! preg_match('/\.sql$/',$file)) |
|
| 156 | - continue; |
|
| 178 | + if (! preg_match('/\.sql$/',$file)) { |
|
| 179 | + continue; |
|
| 180 | + } |
|
| 157 | 181 | |
| 158 | 182 | print 'Check sql file '.$file."\n"; |
| 159 | 183 | $filecontent=file_get_contents($dir.'/'.$file); |
@@ -185,18 +209,15 @@ discard block |
||
| 185 | 209 | if ($dir == DOL_DOCUMENT_ROOT.'/install/mysql/migration') |
| 186 | 210 | { |
| 187 | 211 | // Test for migration files only |
| 188 | - } |
|
| 189 | - elseif ($dir == DOL_DOCUMENT_ROOT.'/install/mysql/data') |
|
| 212 | + } elseif ($dir == DOL_DOCUMENT_ROOT.'/install/mysql/data') |
|
| 190 | 213 | { |
| 191 | 214 | // Test for data files only |
| 192 | - } |
|
| 193 | - else |
|
| 215 | + } else |
|
| 194 | 216 | { |
| 195 | 217 | if (preg_match('/\.key\.sql$/',$file)) |
| 196 | 218 | { |
| 197 | 219 | // Test for key files only |
| 198 | - } |
|
| 199 | - else |
|
| 220 | + } else |
|
| 200 | 221 | { |
| 201 | 222 | // Test for non key files only |
| 202 | 223 | $result=(strpos($filecontent,'KEY ') && strpos($filecontent,'PRIMARY KEY') == 0); |
@@ -229,8 +250,9 @@ discard block |
||
| 229 | 250 | |
| 230 | 251 | $filesarray = scandir(DOL_DOCUMENT_ROOT.'/../dev/initdata'); |
| 231 | 252 | foreach($filesarray as $key => $file) { |
| 232 | - if (! preg_match('/\.sql$/',$file)) |
|
| 233 | - continue; |
|
| 253 | + if (! preg_match('/\.sql$/',$file)) { |
|
| 254 | + continue; |
|
| 255 | + } |
|
| 234 | 256 | |
| 235 | 257 | print 'Check sql file '.$file."\n"; |
| 236 | 258 | $filecontent=file_get_contents(DOL_DOCUMENT_ROOT.'/../dev/initdata/'.$file); |