From 758fbe5aacf33c65be5a20b39ae06c671158674d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 30 Dec 2007 18:47:45 +0000 Subject: [PATCH] Chargement class mal place --- htdocs/main.inc.php | 17 ++++++++++++----- htdocs/master.inc.php | 14 ++++++++------ 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 21b67a3b84b..df0f2caa18a 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -73,8 +73,10 @@ foreach ($_POST as $key => $val) require_once("master.inc.php"); -$bc[0]="class=\"impair\""; -$bc[1]="class=\"pair\""; +// Chargement des includes complementaire de presentation +if ($conf->use_ajax) require_once(DOL_DOCUMENT_ROOT.'/lib/ajax.lib.php'); +if (! defined('NOREQUIREMENU')) require_once(DOL_DOCUMENT_ROOT ."/menu.class.php"); +if (! defined('NOREQUIREHTML')) require_once(DOL_DOCUMENT_ROOT ."/html.form.class.php"); // Init session $sessionname="DOLSESSID_".$dolibarr_main_db_name; @@ -82,6 +84,9 @@ session_name($sessionname); session_start(); dolibarr_syslog("Session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"]); +$bc[0]="class=\"impair\""; +$bc[1]="class=\"pair\""; + /* * Phase identification */ @@ -343,7 +348,9 @@ if (! session_id() || ! isset($_SESSION["dol_login"])) } } - // Verification du code + // Verification du code securite graphique + // \TODO Ce test apres les test PEAR ner sert a rien car il n'empeche pas le brute force cracking + // Il doit etre mis avant validation du mot de passe. Mais pour cela il faut virer PEAR. if ($conf->global->MAIN_SECURITY_ENABLECAPTCHA) { require_once DOL_DOCUMENT_ROOT.'/../external-libs/Artichow/Artichow.cfg.php'; @@ -368,7 +375,7 @@ if (! session_id() || ! isset($_SESSION["dol_login"])) exit; } } - + // Charge l'objet user depuis son login ou son SID $result=0; if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr') @@ -450,7 +457,7 @@ if (! session_id() || ! isset($_SESSION["dol_login"])) session_start(); $langs->load('main'); if ($result == 0) $_SESSION["loginmesg"]=$langs->trans("ErrorCantLoadUserFromDolibarrDatabase",$login); - if ($result < 0) $_SESSION["loginmesg"]=$user->error; + if ($result < 0) $_SESSION["loginmesg"]=$user->error; header('Location: '.DOL_URL_ROOT.'/index.php'); exit; } diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index c73bf9f2b83..77d56137a44 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -146,16 +146,14 @@ if (isset($_SERVER["HTTP_USER_AGENT"])) if (eregi('iceweasel',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->firefox=1; } -// Chargement des includes principaux +// Chargement des includes principaux de librairies communes if (! defined('NOREQUIREUSER')) require_once(DOL_DOCUMENT_ROOT ."/user.class.php"); -if (! defined('NOREQUIREMENU')) require_once(DOL_DOCUMENT_ROOT ."/menu.class.php"); -if (! defined('NOREQUIREHTML')) require_once(DOL_DOCUMENT_ROOT ."/html.form.class.php"); -if (! defined('NOREQUIREDB')) require_once(DOL_DOCUMENT_ROOT ."/lib/databases/".$conf->db->type.".lib.php"); if (! defined('NOREQUIRETRAN')) require_once(DOL_DOCUMENT_ROOT ."/translate.class.php"); if (! defined('NOREQUIRESOC')) require_once(DOL_DOCUMENT_ROOT ."/societe.class.php"); +if (! defined('NOREQUIREDB')) require_once(DOL_DOCUMENT_ROOT ."/lib/databases/".$conf->db->type.".lib.php"); /* - * Creation objet $langs + * Creation objet $langs (must be before all other code) */ if (! defined('NOREQUIRETRAN')) { @@ -194,7 +192,7 @@ if (! defined('NOREQUIREDB')) } /* - * Chargement langage par défaut + * Chargement langage par défaut (must be after the setValues of $conf) */ if (! defined('NOREQUIRETRAN')) { @@ -297,5 +295,9 @@ if (! defined('NOREQUIRESOC')) $yesno[0]="no"; $yesno[1]="yes"; +// Sert pour styles lignes tableaux +$bc[0]="class=\"impair\""; +$bc[1]="class=\"pair\""; + if ( ! defined('MENTION_NPR') ) define('MENTION_NPR','(npr)'); ?>