mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +01:00
Fix php-cs
This commit is contained in:
@@ -41,7 +41,9 @@
|
||||
//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
|
||||
//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
|
||||
//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
|
||||
if (!defined('NOSESSION')) define('NOSESSION', '1'); // On CLI mode, no need to use web sessions
|
||||
if (!defined('NOSESSION')) {
|
||||
define('NOSESSION', '1');
|
||||
} // On CLI mode, no need to use web sessions
|
||||
|
||||
|
||||
$sapi_type = php_sapi_name();
|
||||
@@ -68,7 +70,8 @@ $res = 0;
|
||||
// Try master.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
|
||||
$i--; $j--;
|
||||
$i--;
|
||||
$j--;
|
||||
}
|
||||
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/master.inc.php")) {
|
||||
$res = @include substr($tmp, 0, ($i + 1))."/master.inc.php";
|
||||
@@ -99,7 +102,8 @@ $langs->load("main"); // To load language file for default language
|
||||
// Load user and its permissions
|
||||
$result = $user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user.
|
||||
if (!($result > 0)) {
|
||||
dol_print_error('', $user->error); exit;
|
||||
dol_print_error('', $user->error);
|
||||
exit;
|
||||
}
|
||||
$user->getrights();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user