diff --git a/htdocs/index.php b/htdocs/index.php index 7f6e462839b..38fde99682c 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -301,9 +301,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS)) $board = new $class($db); $board->load_state_board($user); $boardloaded[$class] = $board; - } - else - { + } else { $board = $boardloaded[$class]; } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 49c48e34ec1..733ded3e447 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -131,17 +131,13 @@ function analyseVarsForSqlAndScriptsInjection(&$var, $type) if (analyseVarsForSqlAndScriptsInjection($key, $type) && analyseVarsForSqlAndScriptsInjection($value, $type)) { //$var[$key] = $value; // This is useless - } - else - { + } else { print 'Access refused by SQL/Script injection protection in main.inc.php (type='.htmlentities($type).' key='.htmlentities($key).' value='.htmlentities($value).' page='.htmlentities($_SERVER["REQUEST_URI"]).')'; exit; } } return true; - } - else - { + } else { return (testSqlAndScriptInject($var, $type) <= 0); } } @@ -271,13 +267,11 @@ if (!empty($conf->file->main_force_https) && (empty($_SERVER["HTTPS"]) || $_SERV $newurl = preg_replace('/^http:/i', 'https:', $_SERVER["SCRIPT_URI"]); } } - else // Check HTTPS environment variable (Apache/mod_ssl only) - { + else { + // Check HTTPS environment variable (Apache/mod_ssl only) $newurl = preg_replace('/^http:/i', 'https:', DOL_MAIN_URL_ROOT).$_SERVER["REQUEST_URI"]; } - } - else - { + } else { // Check HTTPS environment variable (Apache/mod_ssl only) $newurl = $conf->file->main_force_https.$_SERVER["REQUEST_URI"]; } @@ -288,9 +282,7 @@ if (!empty($conf->file->main_force_https) && (empty($_SERVER["HTTPS"]) || $_SERV dol_syslog("main.inc: dolibarr_main_force_https is on, we make a redirect to ".$newurl); header("Location: ".$newurl); exit; - } - else - { + } else { dol_syslog("main.inc: dolibarr_main_force_https is on but we failed to forge new https url so no redirect is done", LOG_WARNING); } } @@ -432,9 +424,7 @@ if (!defined('NOLOGIN')) if (defined('MAIN_AUTHENTICATION_MODE')) { $dolibarr_main_authentication = constant('MAIN_AUTHENTICATION_MODE'); - } - else - { + } else { // Authentication mode if (empty($dolibarr_main_authentication)) $dolibarr_main_authentication = 'http,dolibarr'; // Authentication mode: forceuser @@ -658,9 +648,7 @@ if (!defined('NOLOGIN')) header('Location: '.DOL_URL_ROOT.'/index.php'.(count($paramsurl) ? '?'.implode('&', $paramsurl) : '')); exit; } - } - else - { + } else { // We are already into an authenticated session $login = $_SESSION["dol_login"]; $entity = $_SESSION["dol_entity"]; @@ -710,9 +698,7 @@ if (!defined('NOLOGIN')) if (GETPOST('lang', 'aZ09')) $paramsurl[] = 'lang='.GETPOST('lang', 'aZ09'); header('Location: '.DOL_URL_ROOT.'/index.php'.(count($paramsurl) ? '?'.implode('&', $paramsurl) : '')); exit; - } - else - { + } else { // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('main')); @@ -814,9 +800,7 @@ if (!defined('NOLOGIN')) session_destroy(); dol_print_error($db, 'Error in some triggers USER_LOGIN or in some hooks afterLogin'); exit; - } - else - { + } else { $db->commit(); } @@ -986,9 +970,7 @@ if (empty($conf->browser->firefox)) define('ROWS_7', 7); define('ROWS_8', 8); define('ROWS_9', 9); -} -else -{ +} else { define('ROWS_1', 0); define('ROWS_2', 1); define('ROWS_3', 2); @@ -1008,9 +990,8 @@ if (!defined('NOREQUIREMENU')) if (empty($user->socid)) // If internal user or not defined { $conf->standard_menu = (empty($conf->global->MAIN_MENU_STANDARD_FORCED) ? (empty($conf->global->MAIN_MENU_STANDARD) ? 'eldy_menu.php' : $conf->global->MAIN_MENU_STANDARD) : $conf->global->MAIN_MENU_STANDARD_FORCED); - } - else // If external user - { + } else { + // If external user $conf->standard_menu = (empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED) ? (empty($conf->global->MAIN_MENUFRONT_STANDARD) ? 'eldy_menu.php' : $conf->global->MAIN_MENUFRONT_STANDARD) : $conf->global->MAIN_MENUFRONT_STANDARD_FORCED); } @@ -1333,9 +1314,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr if (preg_match('/^(http|\/\/)/i', $cssfile)) { $urltofile = $cssfile; - } - else - { + } else { $urltofile = dol_buildpath($cssfile, 1); } print ''."\n".''."\n"; @@ -1505,9 +1482,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr if (preg_match('/^(http|\/\/)/i', $jsfile)) { print ''."\n"; - } - else - { + } else { print ''."\n"; } } @@ -1606,9 +1581,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead $logouttext .= ''; $logouttext .= img_picto($langs->trans('Logout'), 'sign-out', '', false, 0, 0, '', 'atoplogin'); $logouttext .= ''; - } - else - { + } else { $logouthtmltext .= $langs->trans("NoLogoutProcessWithAuthMode", $_SESSION["dol_authmode"]); $logouttext .= img_picto($langs->trans('Logout'), 'sign-out', '', false, 0, 0, '', 'atoplogin opacitymedium'); } @@ -1625,11 +1598,10 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead { if ($result == 0) $toprightmenu .= $hookmanager->resPrint; // add - else + else { $toprightmenu = $hookmanager->resPrint; // replace - } - else - { + } + } else { $toprightmenu .= $result; // For backward compatibility } @@ -2362,8 +2334,9 @@ function main_area($title = '') print '
| ';
- if ($conf->global->MAIN_SHOW_LOGO && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && !empty($conf->global->MAIN_INFO_SOCIETE_LOGO))
+ if ($conf->global->MAIN_SHOW_LOGO && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && !empty($conf->global->MAIN_INFO_SOCIETE_LOGO)) {
print ' | |
| '.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM).' | |
| '.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ADDRESS).' '.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ZIP).' '.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TOWN).' |