Add patch http://www.matelli.fr/showcases/patchs-dolibarr/patch-dolibarr-fix-sql-injection-check-in-array.html
This commit is contained in:
parent
b5d31f9d5d
commit
cf3345a2d5
@ -22,19 +22,19 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\file htdocs/main.inc.php
|
\file htdocs/main.inc.php
|
||||||
\ingroup core
|
\ingroup core
|
||||||
\brief Fichier de formatage generique des ecrans Dolibarr
|
\brief Fichier de formatage generique des ecrans Dolibarr
|
||||||
\version $Id$
|
\version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Pour le tuning optionnel. Activer si la variable d'environnement DOL_TUNING est positionnee.
|
// Pour le tuning optionnel. Activer si la variable d'environnement DOL_TUNING est positionnee.
|
||||||
// A appeler avant tout. Fait l'equivalent de la fonction dol_microtime_float pas encore chargee.
|
// A appeler avant tout. Fait l'equivalent de la fonction dol_microtime_float pas encore chargee.
|
||||||
$micro_start_time=0;
|
$micro_start_time=0;
|
||||||
if (! empty($_SERVER['DOL_TUNING']))
|
if (! empty($_SERVER['DOL_TUNING']))
|
||||||
{
|
{
|
||||||
list($usec, $sec) = explode(" ", microtime());
|
list($usec, $sec) = explode(" ", microtime());
|
||||||
$micro_start_time=((float)$usec + (float)$sec);
|
$micro_start_time=((float)$usec + (float)$sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -44,17 +44,17 @@ if (! empty($_SERVER['DOL_TUNING']))
|
|||||||
// En mode off (recommande il faut juste faire addslashes au moment d'un insert/update.
|
// En mode off (recommande il faut juste faire addslashes au moment d'un insert/update.
|
||||||
function stripslashes_deep($value)
|
function stripslashes_deep($value)
|
||||||
{
|
{
|
||||||
return (is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value));
|
return (is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value));
|
||||||
}
|
}
|
||||||
//if (! eregi('PHP/6', $_SERVER['SERVER_SOFTWARE']))
|
//if (! eregi('PHP/6', $_SERVER['SERVER_SOFTWARE']))
|
||||||
if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* plus pris en compte dans PHP6
|
if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* plus pris en compte dans PHP6
|
||||||
{
|
{
|
||||||
if (get_magic_quotes_gpc())
|
if (get_magic_quotes_gpc())
|
||||||
{
|
{
|
||||||
$_GET = array_map('stripslashes_deep', $_GET);
|
$_GET = array_map('stripslashes_deep', $_GET);
|
||||||
$_POST = array_map('stripslashes_deep', $_POST);
|
$_POST = array_map('stripslashes_deep', $_POST);
|
||||||
$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
|
$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
|
||||||
$_REQUEST = array_map('stripslashes_deep', $_REQUEST);
|
$_REQUEST = array_map('stripslashes_deep', $_REQUEST);
|
||||||
}
|
}
|
||||||
@set_magic_quotes_runtime(0);
|
@set_magic_quotes_runtime(0);
|
||||||
}
|
}
|
||||||
@ -62,25 +62,47 @@ if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* plus pris en comp
|
|||||||
// Filtre les GET et POST pour supprimer les SQL INJECTION
|
// Filtre les GET et POST pour supprimer les SQL INJECTION
|
||||||
function test_sql_inject($val)
|
function test_sql_inject($val)
|
||||||
{
|
{
|
||||||
$sql_inj = 0;
|
$sql_inj = 0;
|
||||||
$sql_inj += eregi('delete[[:space:]]+from', $val);
|
$sql_inj += eregi('delete[[:space:]]+from', $val);
|
||||||
$sql_inj += eregi('create[[:space:]]+table', $val);
|
$sql_inj += eregi('create[[:space:]]+table', $val);
|
||||||
$sql_inj += eregi('update.+set.+=', $val);
|
$sql_inj += eregi('update.+set.+=', $val);
|
||||||
$sql_inj += eregi('insert[[:space:]]+into', $val);
|
$sql_inj += eregi('insert[[:space:]]+into', $val);
|
||||||
$sql_inj += eregi('select.+from', $val);
|
$sql_inj += eregi('select.+from', $val);
|
||||||
|
return $sql_inj;
|
||||||
return $sql_inj;
|
|
||||||
}
|
}
|
||||||
foreach ($_GET as $key => $val)
|
// Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/patch-dolibarr-fix-sql-injection-check-in-array.html)
|
||||||
|
function analyse_sql_injection(&$var)
|
||||||
{
|
{
|
||||||
if (test_sql_inject($val) > 0)
|
if (is_array($var))
|
||||||
unset($_GET[$key]);
|
{
|
||||||
}
|
$result = array();
|
||||||
foreach ($_POST as $key => $val)
|
foreach ($var as $key => $value)
|
||||||
{
|
{
|
||||||
if (test_sql_inject($val) > 0)
|
if (test_sql_inject($key) > 0)
|
||||||
unset($_POST[$key]);
|
{
|
||||||
|
unset($var[$key]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (analyse_sql_injection($value))
|
||||||
|
{
|
||||||
|
$var[$key] = $value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unset($var[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return (test_sql_inject($var) <= 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
analyse_sql_injection($_GET);
|
||||||
|
analyse_sql_injection($_POST);
|
||||||
// Fin filtre des GET et POST
|
// Fin filtre des GET et POST
|
||||||
|
|
||||||
|
|
||||||
@ -205,8 +227,8 @@ if (! isset($_SESSION["dol_login"]))
|
|||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
// Call function to check user/password
|
// Call function to check user/password
|
||||||
$usertotest=$_POST["username"];
|
$usertotest=$_POST["username"];
|
||||||
$passwordtotest=$_POST["password"];
|
$passwordtotest=$_POST["password"];
|
||||||
$function='check_user_password_'.$mode;
|
$function='check_user_password_'.$mode;
|
||||||
$login=$function($usertotest,$passwordtotest);
|
$login=$function($usertotest,$passwordtotest);
|
||||||
if ($login)
|
if ($login)
|
||||||
@ -246,12 +268,12 @@ if (! isset($_SESSION["dol_login"]))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fin des tests de login/passwords
|
// Fin des tests de login/passwords
|
||||||
if (! $login)
|
if (! $login)
|
||||||
{
|
{
|
||||||
// We show login page
|
// We show login page
|
||||||
dol_loginfunction($langs,$conf,$mysoc);
|
dol_loginfunction($langs,$conf,$mysoc);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$resultFetchUser=$user->fetch($login);
|
$resultFetchUser=$user->fetch($login);
|
||||||
if ($resultFetchUser <= 0)
|
if ($resultFetchUser <= 0)
|
||||||
@ -332,15 +354,15 @@ else
|
|||||||
// Est-ce une nouvelle session
|
// Est-ce une nouvelle session
|
||||||
if (! isset($_SESSION["dol_login"]))
|
if (! isset($_SESSION["dol_login"]))
|
||||||
{
|
{
|
||||||
// Nouvelle session pour ce login
|
// Nouvelle session pour ce login
|
||||||
$_SESSION["dol_login"]=$user->login;
|
$_SESSION["dol_login"]=$user->login;
|
||||||
$_SESSION["dol_password"]=$user->pass_crypted;
|
$_SESSION["dol_password"]=$user->pass_crypted;
|
||||||
$_SESSION["dol_authmode"]=$conf->authmode;
|
$_SESSION["dol_authmode"]=$conf->authmode;
|
||||||
dolibarr_syslog("This is a new started user session. _SESSION['dol_login']=".$_SESSION["dol_login"].' Session id='.session_id());
|
dolibarr_syslog("This is a new started user session. _SESSION['dol_login']=".$_SESSION["dol_login"].' Session id='.session_id());
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$user->update_last_login_date();
|
$user->update_last_login_date();
|
||||||
|
|
||||||
// Appel des triggers
|
// Appel des triggers
|
||||||
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
|
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
|
||||||
@ -396,12 +418,12 @@ if (! isset($_SESSION["dol_login"]))
|
|||||||
// Si user admin, on force droits sur les modules base
|
// Si user admin, on force droits sur les modules base
|
||||||
if ($user->admin)
|
if ($user->admin)
|
||||||
{
|
{
|
||||||
$user->rights->user->user->lire=1;
|
$user->rights->user->user->lire=1;
|
||||||
$user->rights->user->user->creer=1;
|
$user->rights->user->user->creer=1;
|
||||||
$user->rights->user->user->password=1;
|
$user->rights->user->user->password=1;
|
||||||
$user->rights->user->user->supprimer=1;
|
$user->rights->user->user->supprimer=1;
|
||||||
$user->rights->user->self->creer=1;
|
$user->rights->user->self->creer=1;
|
||||||
$user->rights->user->self->password=1;
|
$user->rights->user->self->password=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -411,63 +433,63 @@ if ($user->admin)
|
|||||||
// Set liste_limit
|
// Set liste_limit
|
||||||
if (isset($user->conf->MAIN_SIZE_LISTE_LIMIT)) // Can be 0
|
if (isset($user->conf->MAIN_SIZE_LISTE_LIMIT)) // Can be 0
|
||||||
{
|
{
|
||||||
$conf->liste_limit = $user->conf->MAIN_SIZE_LISTE_LIMIT;
|
$conf->liste_limit = $user->conf->MAIN_SIZE_LISTE_LIMIT;
|
||||||
}
|
}
|
||||||
if (isset($user->conf->PRODUIT_LIMIT_SIZE)) // Can be 0
|
if (isset($user->conf->PRODUIT_LIMIT_SIZE)) // Can be 0
|
||||||
{
|
{
|
||||||
$conf->produit->limit_size = $user->conf->PRODUIT_LIMIT_SIZE;
|
$conf->produit->limit_size = $user->conf->PRODUIT_LIMIT_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If user has choosed its own language
|
// If user has choosed its own language
|
||||||
if (! empty($user->conf->MAIN_LANG_DEFAULT))
|
if (! empty($user->conf->MAIN_LANG_DEFAULT))
|
||||||
{
|
{
|
||||||
// If different than current language
|
// If different than current language
|
||||||
if ($langs->getDefaultLang() != $user->conf->MAIN_LANG_DEFAULT)
|
if ($langs->getDefaultLang() != $user->conf->MAIN_LANG_DEFAULT)
|
||||||
{
|
{
|
||||||
$langs->setDefaultLang($user->conf->MAIN_LANG_DEFAULT);
|
$langs->setDefaultLang($user->conf->MAIN_LANG_DEFAULT);
|
||||||
$langs->setPhpLang();
|
$langs->setPhpLang();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If language was forced on URL
|
// If language was forced on URL
|
||||||
if (! empty($_GET["lang"]))
|
if (! empty($_GET["lang"]))
|
||||||
{
|
{
|
||||||
$langs->setDefaultLang($_GET["lang"]);
|
$langs->setDefaultLang($_GET["lang"]);
|
||||||
$langs->setPhpLang();
|
$langs->setPhpLang();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Remplace conf->css par valeur personnalise
|
// Remplace conf->css par valeur personnalise
|
||||||
if (isset($user->conf->MAIN_THEME) && $user->conf->MAIN_THEME)
|
if (isset($user->conf->MAIN_THEME) && $user->conf->MAIN_THEME)
|
||||||
{
|
{
|
||||||
$conf->theme=$user->conf->MAIN_THEME;
|
$conf->theme=$user->conf->MAIN_THEME;
|
||||||
$conf->css = "theme/".$conf->theme."/".$conf->theme.".css";
|
$conf->css = "theme/".$conf->theme."/".$conf->theme.".css";
|
||||||
}
|
}
|
||||||
// Cas de forcage du style depuis url
|
// Cas de forcage du style depuis url
|
||||||
if (! empty($_GET["theme"]))
|
if (! empty($_GET["theme"]))
|
||||||
{
|
{
|
||||||
$conf->theme=$_GET["theme"];
|
$conf->theme=$_GET["theme"];
|
||||||
$conf->css = "theme/".$conf->theme."/".$conf->theme.".css";
|
$conf->css = "theme/".$conf->theme."/".$conf->theme.".css";
|
||||||
}
|
}
|
||||||
// Si feuille de style en php existe
|
// Si feuille de style en php existe
|
||||||
if (file_exists(DOL_DOCUMENT_ROOT.'/'.$conf->css.".php")) $conf->css.=".php";
|
if (file_exists(DOL_DOCUMENT_ROOT.'/'.$conf->css.".php")) $conf->css.=".php";
|
||||||
|
|
||||||
if (! empty($user->conf->MAIN_DISABLE_JAVASCRIPT))
|
if (! empty($user->conf->MAIN_DISABLE_JAVASCRIPT))
|
||||||
{
|
{
|
||||||
$conf->use_javascript_ajax=! $user->conf->MAIN_DISABLE_JAVASCRIPT;
|
$conf->use_javascript_ajax=! $user->conf->MAIN_DISABLE_JAVASCRIPT;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Defini gestionnaire de menu a utiliser
|
// Defini gestionnaire de menu a utiliser
|
||||||
if (! $user->societe_id) // Si utilisateur interne
|
if (! $user->societe_id) // Si utilisateur interne
|
||||||
{
|
{
|
||||||
$conf->top_menu=$conf->global->MAIN_MENU_BARRETOP;
|
$conf->top_menu=$conf->global->MAIN_MENU_BARRETOP;
|
||||||
$conf->left_menu=$conf->global->MAIN_MENU_BARRELEFT;
|
$conf->left_menu=$conf->global->MAIN_MENU_BARRELEFT;
|
||||||
// Pour compatibilite
|
// Pour compatibilite
|
||||||
if ($conf->left_menu == 'eldy.php') $conf->left_menu='eldy_backoffice.php';
|
if ($conf->left_menu == 'eldy.php') $conf->left_menu='eldy_backoffice.php';
|
||||||
}
|
}
|
||||||
else // Si utilisateur externe
|
else // Si utilisateur externe
|
||||||
{
|
{
|
||||||
$conf->top_menu=$conf->global->MAIN_MENUFRONT_BARRETOP;
|
$conf->top_menu=$conf->global->MAIN_MENUFRONT_BARRETOP;
|
||||||
$conf->left_menu=$conf->global->MAIN_MENUFRONT_BARRELEFT;
|
$conf->left_menu=$conf->global->MAIN_MENUFRONT_BARRELEFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only rodolphe and auguria menu manage canvas menu (auguria not correctly yet)
|
// Only rodolphe and auguria menu manage canvas menu (auguria not correctly yet)
|
||||||
@ -509,11 +531,11 @@ if (! $user->login) accessforbidden();
|
|||||||
// Verifie si user actif
|
// Verifie si user actif
|
||||||
if ($user->statut < 1)
|
if ($user->statut < 1)
|
||||||
{
|
{
|
||||||
// Si non actif, on delogue le user
|
// Si non actif, on delogue le user
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
dolibarr_syslog ("Authentification ko car login desactive");
|
dolibarr_syslog ("Authentification ko car login desactive");
|
||||||
accessforbidden($langs->trans("ErrorLoginDisabled"));
|
accessforbidden($langs->trans("ErrorLoginDisabled"));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -545,37 +567,37 @@ $bc[1]="class=\"pair\"";
|
|||||||
// Constantes utilisees pour definir le nombre de lignes des textarea
|
// Constantes utilisees pour definir le nombre de lignes des textarea
|
||||||
if (! eregi("firefox",$_SERVER["HTTP_USER_AGENT"]))
|
if (! eregi("firefox",$_SERVER["HTTP_USER_AGENT"]))
|
||||||
{
|
{
|
||||||
define('ROWS_1',1);
|
define('ROWS_1',1);
|
||||||
define('ROWS_2',2);
|
define('ROWS_2',2);
|
||||||
define('ROWS_3',3);
|
define('ROWS_3',3);
|
||||||
define('ROWS_4',4);
|
define('ROWS_4',4);
|
||||||
define('ROWS_5',5);
|
define('ROWS_5',5);
|
||||||
define('ROWS_6',6);
|
define('ROWS_6',6);
|
||||||
define('ROWS_7',7);
|
define('ROWS_7',7);
|
||||||
define('ROWS_8',8);
|
define('ROWS_8',8);
|
||||||
define('ROWS_9',9);
|
define('ROWS_9',9);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
define('ROWS_1',0);
|
define('ROWS_1',0);
|
||||||
define('ROWS_2',1);
|
define('ROWS_2',1);
|
||||||
define('ROWS_3',2);
|
define('ROWS_3',2);
|
||||||
define('ROWS_4',3);
|
define('ROWS_4',3);
|
||||||
define('ROWS_5',4);
|
define('ROWS_5',4);
|
||||||
define('ROWS_6',5);
|
define('ROWS_6',5);
|
||||||
define('ROWS_7',6);
|
define('ROWS_7',6);
|
||||||
define('ROWS_8',7);
|
define('ROWS_8',7);
|
||||||
define('ROWS_9',8);
|
define('ROWS_9',8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Affiche formulaire de login
|
\brief Affiche formulaire de login
|
||||||
\param langs Lang object
|
\param langs Lang object
|
||||||
\param conf Conf object
|
\param conf Conf object
|
||||||
\param mysoc Company object
|
\param mysoc Company object
|
||||||
\remarks Il faut changer le code html dans cette fonction pour changer le design de la logon
|
\remarks Il faut changer le code html dans cette fonction pour changer le design de la logon
|
||||||
*/
|
*/
|
||||||
function dol_loginfunction($langs,$conf,$mysoc)
|
function dol_loginfunction($langs,$conf,$mysoc)
|
||||||
{
|
{
|
||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
@ -866,99 +888,99 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
|
|||||||
*/
|
*/
|
||||||
function top_menu($head, $title="", $target="")
|
function top_menu($head, $title="", $target="")
|
||||||
{
|
{
|
||||||
global $user, $conf, $langs, $db, $dolibarr_main_authentication;
|
global $user, $conf, $langs, $db, $dolibarr_main_authentication;
|
||||||
|
|
||||||
if (! $conf->top_menu) $conf->top_menu ='eldy_backoffice.php';
|
if (! $conf->top_menu) $conf->top_menu ='eldy_backoffice.php';
|
||||||
if (! $conf->left_menu) $conf->left_menu='eldy_backoffice.php';
|
if (! $conf->left_menu) $conf->left_menu='eldy_backoffice.php';
|
||||||
|
|
||||||
top_htmlhead($head, $title);
|
top_htmlhead($head, $title);
|
||||||
|
|
||||||
print '<body id="mainbody"><div id="dhtmltooltip"></div>';
|
print '<body id="mainbody"><div id="dhtmltooltip"></div>';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Si la constante MAIN_NEED_UPDATE est definie (par le script de migration sql en general), c'est que
|
* Si la constante MAIN_NEED_UPDATE est definie (par le script de migration sql en general), c'est que
|
||||||
* les donnees ont besoin d'un remaniement. Il faut passer le update.php
|
* les donnees ont besoin d'un remaniement. Il faut passer le update.php
|
||||||
*/
|
*/
|
||||||
if (! empty($conf->global->MAIN_NEED_UPDATE))
|
if (! empty($conf->global->MAIN_NEED_UPDATE))
|
||||||
{
|
{
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
print '<div class="fiche">'."\n";
|
print '<div class="fiche">'."\n";
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print $langs->trans("UpdateRequired",DOL_URL_ROOT.'/install/index.php');
|
print $langs->trans("UpdateRequired",DOL_URL_ROOT.'/install/index.php');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print "</table>";
|
print "</table>";
|
||||||
llxFooter();
|
llxFooter();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Barre de menu superieure
|
* Barre de menu superieure
|
||||||
*/
|
*/
|
||||||
print "\n".'<!-- Start top horizontal menu -->'."\n";
|
print "\n".'<!-- Start top horizontal menu -->'."\n";
|
||||||
print '<div class="tmenu">'."\n";
|
print '<div class="tmenu">'."\n";
|
||||||
|
|
||||||
// Charge le gestionnaire des entrees de menu du haut
|
// Charge le gestionnaire des entrees de menu du haut
|
||||||
if (! file_exists(DOL_DOCUMENT_ROOT ."/includes/menus/barre_top/".$conf->top_menu))
|
if (! file_exists(DOL_DOCUMENT_ROOT ."/includes/menus/barre_top/".$conf->top_menu))
|
||||||
{
|
{
|
||||||
$conf->top_menu='eldy_backoffice.php';
|
$conf->top_menu='eldy_backoffice.php';
|
||||||
}
|
}
|
||||||
require_once(DOL_DOCUMENT_ROOT ."/includes/menus/barre_top/".$conf->top_menu);
|
require_once(DOL_DOCUMENT_ROOT ."/includes/menus/barre_top/".$conf->top_menu);
|
||||||
$menutop = new MenuTop($db);
|
$menutop = new MenuTop($db);
|
||||||
$menutop->atarget=$target;
|
$menutop->atarget=$target;
|
||||||
|
|
||||||
// Affiche le menu
|
// Affiche le menu
|
||||||
$menutop->showmenu();
|
$menutop->showmenu();
|
||||||
|
|
||||||
// Lien sur fiche du login
|
// Lien sur fiche du login
|
||||||
print '<a class="login" href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$user->id.'"';
|
print '<a class="login" href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$user->id.'"';
|
||||||
print $menutop->atarget?(' target="'.$menutop->atarget.'"'):'';
|
print $menutop->atarget?(' target="'.$menutop->atarget.'"'):'';
|
||||||
print '>'.$user->login.'</a>';
|
print '>'.$user->login.'</a>';
|
||||||
|
|
||||||
// Lien info
|
// Lien info
|
||||||
$htmltext=''; $text='';
|
$htmltext=''; $text='';
|
||||||
if ($_SESSION["dol_authmode"] != 'forceuser'
|
if ($_SESSION["dol_authmode"] != 'forceuser'
|
||||||
&& $_SESSION["dol_authmode"] != 'http')
|
&& $_SESSION["dol_authmode"] != 'http')
|
||||||
{
|
{
|
||||||
$htmltext=$langs->trans("Logout").'<br>';
|
$htmltext=$langs->trans("Logout").'<br>';
|
||||||
$htmltext.="<br>";
|
$htmltext.="<br>";
|
||||||
|
|
||||||
$text.='<a href="'.DOL_URL_ROOT.'/user/logout.php"';
|
$text.='<a href="'.DOL_URL_ROOT.'/user/logout.php"';
|
||||||
$text.=$menutop->atarget?(' target="'.$menutop->atarget.'"'):'';
|
$text.=$menutop->atarget?(' target="'.$menutop->atarget.'"'):'';
|
||||||
$text.='>';
|
$text.='>';
|
||||||
$text.='<img class="login" border="0" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/logout.png"';
|
$text.='<img class="login" border="0" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/logout.png"';
|
||||||
$text.=' alt="" title=""';
|
$text.=' alt="" title=""';
|
||||||
$text.='>';
|
$text.='>';
|
||||||
$text.='</a>';
|
$text.='</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$text.='<img class="login" border="0" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/logout.png"';
|
$text.='<img class="login" border="0" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/logout.png"';
|
||||||
$text.=' alt="" title=""';
|
$text.=' alt="" title=""';
|
||||||
$text.='>';
|
$text.='>';
|
||||||
}
|
}
|
||||||
$htmltext.='<u>'.$langs->trans("User").'</u>';
|
$htmltext.='<u>'.$langs->trans("User").'</u>';
|
||||||
$htmltext.='<br><b>'.$langs->trans("Name").'</b>: '.$user->fullname;
|
$htmltext.='<br><b>'.$langs->trans("Name").'</b>: '.$user->fullname;
|
||||||
$htmltext.='<br><b>'.$langs->trans("Login").'</b>: '.$user->login;
|
$htmltext.='<br><b>'.$langs->trans("Login").'</b>: '.$user->login;
|
||||||
$htmltext.='<br><b>'.$langs->trans("Administrator").'</b>: '.yn($user->admin);
|
$htmltext.='<br><b>'.$langs->trans("Administrator").'</b>: '.yn($user->admin);
|
||||||
$htmltext.='<br><b>'.$langs->trans("Type").'</b>: '.($user->societe_id?$langs->trans("External"):$langs->trans("Internal"));
|
$htmltext.='<br><b>'.$langs->trans("Type").'</b>: '.($user->societe_id?$langs->trans("External"):$langs->trans("Internal"));
|
||||||
$htmltext.='<br>';
|
$htmltext.='<br>';
|
||||||
$htmltext.='<br><u>'.$langs->trans("Connection").'</u>';
|
$htmltext.='<br><u>'.$langs->trans("Connection").'</u>';
|
||||||
$htmltext.='<br><b>'.$langs->trans("ConnectedSince").'</b>: '.dolibarr_print_date($user->datelastlogin,"dayhour");
|
$htmltext.='<br><b>'.$langs->trans("ConnectedSince").'</b>: '.dolibarr_print_date($user->datelastlogin,"dayhour");
|
||||||
$htmltext.='<br><b>'.$langs->trans("PreviousConnexion").'</b>: '.dolibarr_print_date($user->datepreviouslogin,"dayhour");
|
$htmltext.='<br><b>'.$langs->trans("PreviousConnexion").'</b>: '.dolibarr_print_date($user->datepreviouslogin,"dayhour");
|
||||||
$htmltext.='<br><b>'.$langs->trans("AuthenticationMode").'</b>: '.$_SESSION["dol_authmode"];
|
$htmltext.='<br><b>'.$langs->trans("AuthenticationMode").'</b>: '.$_SESSION["dol_authmode"];
|
||||||
$htmltext.='<br><b>'.$langs->trans("CurrentTheme").'</b>: '.$conf->theme;
|
$htmltext.='<br><b>'.$langs->trans("CurrentTheme").'</b>: '.$conf->theme;
|
||||||
$htmltext.='<br><b>'.$langs->trans("CurrentUserLanguage").'</b>: '.$langs->getDefaultLang();
|
$htmltext.='<br><b>'.$langs->trans("CurrentUserLanguage").'</b>: '.$langs->getDefaultLang();
|
||||||
|
|
||||||
$html=new Form($db);
|
$html=new Form($db);
|
||||||
print $html->textwithtooltip('',$htmltext,2,1,$text);
|
print $html->textwithtooltip('',$htmltext,2,1,$text);
|
||||||
|
|
||||||
// print '<img class="login" border="0" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/logout.png"';
|
// print '<img class="login" border="0" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/logout.png"';
|
||||||
// print ' alt="'.$title.'" title="'.$title.'"';
|
// print ' alt="'.$title.'" title="'.$title.'"';
|
||||||
// print '>';
|
// print '>';
|
||||||
|
|
||||||
print "\n</div>\n<!-- End top horizontal menu -->\n";
|
print "\n</div>\n<!-- End top horizontal menu -->\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -970,78 +992,78 @@ function top_menu($head, $title="", $target="")
|
|||||||
*/
|
*/
|
||||||
function left_menu($menu_array, $helppagename='', $form_search='')
|
function left_menu($menu_array, $helppagename='', $form_search='')
|
||||||
{
|
{
|
||||||
global $user, $conf, $langs, $db;
|
global $user, $conf, $langs, $db;
|
||||||
|
|
||||||
// print '<div class="vmenuplusfiche">'."\n";
|
// print '<div class="vmenuplusfiche">'."\n";
|
||||||
print '<table width="100%" class="notopnoleftnoright"><tr><td class="vmenu" valign="top">';
|
print '<table width="100%" class="notopnoleftnoright"><tr><td class="vmenu" valign="top">';
|
||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
// Colonne de gauche
|
// Colonne de gauche
|
||||||
print '<!-- Debut left vertical menu -->'."\n";
|
print '<!-- Debut left vertical menu -->'."\n";
|
||||||
print '<div class="vmenu">'."\n";
|
print '<div class="vmenu">'."\n";
|
||||||
|
|
||||||
|
|
||||||
// Autres entrees du menu par le gestionnaire
|
// Autres entrees du menu par le gestionnaire
|
||||||
if (! file_exists(DOL_DOCUMENT_ROOT ."/includes/menus/barre_left/".$conf->left_menu))
|
if (! file_exists(DOL_DOCUMENT_ROOT ."/includes/menus/barre_left/".$conf->left_menu))
|
||||||
{
|
{
|
||||||
$conf->left_menu='eldy_backoffice.php';
|
$conf->left_menu='eldy_backoffice.php';
|
||||||
}
|
}
|
||||||
require_once(DOL_DOCUMENT_ROOT ."/includes/menus/barre_left/".$conf->left_menu);
|
require_once(DOL_DOCUMENT_ROOT ."/includes/menus/barre_left/".$conf->left_menu);
|
||||||
$menuleft=new MenuLeft($db,$menu_array);
|
$menuleft=new MenuLeft($db,$menu_array);
|
||||||
$menuleft->showmenu();
|
$menuleft->showmenu();
|
||||||
|
|
||||||
// Affichage des zones de recherche permanantes
|
// Affichage des zones de recherche permanantes
|
||||||
$addzonerecherche=0;
|
$addzonerecherche=0;
|
||||||
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_SOCIETE) $addzonerecherche=1;
|
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_SOCIETE) $addzonerecherche=1;
|
||||||
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_CONTACT) $addzonerecherche=1;
|
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_CONTACT) $addzonerecherche=1;
|
||||||
if (($conf->produit->enabled || $conf->service->enabled) && $conf->global->MAIN_SEARCHFORM_PRODUITSERVICE) $addzonerecherche=1;
|
if (($conf->produit->enabled || $conf->service->enabled) && $conf->global->MAIN_SEARCHFORM_PRODUITSERVICE) $addzonerecherche=1;
|
||||||
|
|
||||||
if ($addzonerecherche && ($user->rights->societe->lire || $user->rights->produit->lire))
|
if ($addzonerecherche && ($user->rights->societe->lire || $user->rights->produit->lire))
|
||||||
{
|
{
|
||||||
print '<div class="blockvmenupair">';
|
print '<div class="blockvmenupair">';
|
||||||
|
|
||||||
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_SOCIETE && $user->rights->societe->lire)
|
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_SOCIETE && $user->rights->societe->lire)
|
||||||
{
|
{
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
printSearchForm(DOL_URL_ROOT.'/societe.php',DOL_URL_ROOT.'/societe.php',
|
printSearchForm(DOL_URL_ROOT.'/societe.php',DOL_URL_ROOT.'/societe.php',
|
||||||
img_object($langs->trans("List"),'company').' '.$langs->trans("Companies"),'soc','socname');
|
img_object($langs->trans("List"),'company').' '.$langs->trans("Companies"),'soc','socname');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_CONTACT && $user->rights->societe->lire)
|
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_CONTACT && $user->rights->societe->lire)
|
||||||
{
|
{
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
printSearchForm(DOL_URL_ROOT.'/contact/index.php',DOL_URL_ROOT.'/contact/index.php',
|
printSearchForm(DOL_URL_ROOT.'/contact/index.php',DOL_URL_ROOT.'/contact/index.php',
|
||||||
img_object($langs->trans("List"),'contact').' '.$langs->trans("Contacts"),'contact','contactname','contact');
|
img_object($langs->trans("List"),'contact').' '.$langs->trans("Contacts"),'contact','contactname','contact');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($conf->produit->enabled || $conf->service->enabled) && $conf->global->MAIN_SEARCHFORM_PRODUITSERVICE && $user->rights->produit->lire)
|
if (($conf->produit->enabled || $conf->service->enabled) && $conf->global->MAIN_SEARCHFORM_PRODUITSERVICE && $user->rights->produit->lire)
|
||||||
{
|
{
|
||||||
$langs->load("products");
|
$langs->load("products");
|
||||||
printSearchForm(DOL_URL_ROOT.'/product/liste.php',DOL_URL_ROOT.'/product/index.php',
|
printSearchForm(DOL_URL_ROOT.'/product/liste.php',DOL_URL_ROOT.'/product/index.php',
|
||||||
img_object($langs->trans("List"),'product').' '.$langs->trans("Products")."/".$langs->trans("Services"),'products','sall','product');
|
img_object($langs->trans("List"),'product').' '.$langs->trans("Products")."/".$langs->trans("Services"),'products','sall','product');
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Zone de recherche supplementaire
|
// Zone de recherche supplementaire
|
||||||
if ($form_search)
|
if ($form_search)
|
||||||
{
|
{
|
||||||
print $form_search;
|
print $form_search;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lien vers l'aide en ligne (uniquement si langue fr_FR)
|
// Lien vers l'aide en ligne (uniquement si langue fr_FR)
|
||||||
if ($helppagename)
|
if ($helppagename)
|
||||||
{
|
{
|
||||||
$langs->load("help");
|
$langs->load("help");
|
||||||
|
|
||||||
$helpbaseurl='';
|
$helpbaseurl='';
|
||||||
if ($langs->defaultlang == "fr_FR") $helpbaseurl='http://wiki.dolibarr.org/index.php/%s';
|
if ($langs->defaultlang == "fr_FR") $helpbaseurl='http://wiki.dolibarr.org/index.php/%s';
|
||||||
|
|
||||||
$helppage=$langs->trans($helppagename);
|
$helppage=$langs->trans($helppagename);
|
||||||
|
|
||||||
if ($helpbaseurl)
|
if ($helpbaseurl)
|
||||||
{
|
{
|
||||||
print '<div class="help">';
|
print '<div class="help">';
|
||||||
print '<a class="help" target="_blank" href="';
|
print '<a class="help" target="_blank" href="';
|
||||||
@ -1049,34 +1071,34 @@ function left_menu($menu_array, $helppagename='', $form_search='')
|
|||||||
print '">'.$langs->trans("Help").'</a>';
|
print '">'.$langs->trans("Help").'</a>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->global->MAIN_SHOW_BUGTRACK_LINK == 1)
|
if ($conf->global->MAIN_SHOW_BUGTRACK_LINK == 1)
|
||||||
{
|
{
|
||||||
// Lien vers le bugtrack
|
// Lien vers le bugtrack
|
||||||
$bugbaseurl='http://savannah.nongnu.org/bugs/?';
|
$bugbaseurl='http://savannah.nongnu.org/bugs/?';
|
||||||
$bugbaseurl.='func=additem&group=dolibarr&privacy=1&';
|
$bugbaseurl.='func=additem&group=dolibarr&privacy=1&';
|
||||||
$bugbaseurl.="&details=";
|
$bugbaseurl.="&details=";
|
||||||
$bugbaseurl.=urlencode("\n\n\n\n\n-------------\n");
|
$bugbaseurl.=urlencode("\n\n\n\n\n-------------\n");
|
||||||
$bugbaseurl.=urlencode($langs->trans("Version").": ".DOL_VERSION."\n");
|
$bugbaseurl.=urlencode($langs->trans("Version").": ".DOL_VERSION."\n");
|
||||||
$bugbaseurl.=urlencode($langs->trans("Server").": ".$_SERVER["SERVER_SOFTWARE"]."\n");
|
$bugbaseurl.=urlencode($langs->trans("Server").": ".$_SERVER["SERVER_SOFTWARE"]."\n");
|
||||||
$bugbaseurl.=urlencode($langs->trans("Url").": ".$_SERVER["REQUEST_URI"]."\n");
|
$bugbaseurl.=urlencode($langs->trans("Url").": ".$_SERVER["REQUEST_URI"]."\n");
|
||||||
print '<div class="help"><a class="help" target="_blank" href="'.$bugbaseurl.'">'.$langs->trans("FindBug").'</a></div>';
|
print '<div class="help"><a class="help" target="_blank" href="'.$bugbaseurl.'">'.$langs->trans("FindBug").'</a></div>';
|
||||||
}
|
}
|
||||||
print "\n";
|
print "\n";
|
||||||
print "</div>\n";
|
print "</div>\n";
|
||||||
print "<!-- Fin left vertical menu -->\n";
|
print "<!-- Fin left vertical menu -->\n";
|
||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
print '<!-- fin de zone gauche, debut zone droite -->'."\n";
|
print '<!-- fin de zone gauche, debut zone droite -->'."\n";
|
||||||
// print '</div>'."\n";
|
// print '</div>'."\n";
|
||||||
// print '<div class="vmenuplusfiche">'."\n";
|
// print '<div class="vmenuplusfiche">'."\n";
|
||||||
print '</td><td valign="top">'."\n";
|
print '</td><td valign="top">'."\n";
|
||||||
|
|
||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
print '<div class="fiche"> <!-- begin fiche area -->'."\n";
|
print '<div class="fiche"> <!-- begin fiche area -->'."\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1093,17 +1115,17 @@ function left_menu($menu_array, $helppagename='', $form_search='')
|
|||||||
|
|
||||||
function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch='search',$htmlinputname)
|
function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch='search',$htmlinputname)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
print '<form action="'.$urlaction.'" method="post">';
|
print '<form action="'.$urlaction.'" method="post">';
|
||||||
print '<div class="menu_titre">';
|
print '<div class="menu_titre">';
|
||||||
print '<a class="vsmenu" href="'.$urlobject.'">';
|
print '<a class="vsmenu" href="'.$urlobject.'">';
|
||||||
print $title.'</a><br>';
|
print $title.'</a><br>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<input type="hidden" name="mode" value="search">';
|
print '<input type="hidden" name="mode" value="search">';
|
||||||
print '<input type="hidden" name="mode-search" value="'.$htmlmodesearch.'">';
|
print '<input type="hidden" name="mode-search" value="'.$htmlmodesearch.'">';
|
||||||
print '<input type="text" class="flat" name="'.$htmlinputname.'" size="10"> ';
|
print '<input type="text" class="flat" name="'.$htmlinputname.'" size="10"> ';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Go").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Go").'">';
|
||||||
print "</form>";
|
print "</form>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1115,15 +1137,15 @@ function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch='search',$
|
|||||||
|
|
||||||
function llxFooter($foot='',$limitIEbug=1)
|
function llxFooter($foot='',$limitIEbug=1)
|
||||||
{
|
{
|
||||||
global $conf, $dolibarr_auto_user, $micro_start_time;
|
global $conf, $dolibarr_auto_user, $micro_start_time;
|
||||||
|
|
||||||
print "\n".'</div> <!-- end div class="fiche" -->'."\n";
|
print "\n".'</div> <!-- end div class="fiche" -->'."\n";
|
||||||
|
|
||||||
// print "\n".'</div> <!-- end div class="vmenuplusfiche" -->'."\n";
|
// print "\n".'</div> <!-- end div class="vmenuplusfiche" -->'."\n";
|
||||||
print "\n".'</td></tr></table> <!-- end right area -->'."\n";
|
print "\n".'</td></tr></table> <!-- end right area -->'."\n";
|
||||||
|
|
||||||
if (! empty($_SERVER['DOL_TUNING']))
|
if (! empty($_SERVER['DOL_TUNING']))
|
||||||
{
|
{
|
||||||
$micro_end_time=dol_microtime_float(true);
|
$micro_end_time=dol_microtime_float(true);
|
||||||
print '<script language="javascript" type="text/javascript">window.status="Build time: '.ceil(1000*($micro_end_time-$micro_start_time)).' ms';
|
print '<script language="javascript" type="text/javascript">window.status="Build time: '.ceil(1000*($micro_end_time-$micro_start_time)).' ms';
|
||||||
if (function_exists("memory_get_usage"))
|
if (function_exists("memory_get_usage"))
|
||||||
@ -1135,19 +1157,19 @@ function llxFooter($foot='',$limitIEbug=1)
|
|||||||
print ' - Zend encoded file: '.(zend_loader_file_encoded()?'yes':'no');
|
print ' - Zend encoded file: '.(zend_loader_file_encoded()?'yes':'no');
|
||||||
}
|
}
|
||||||
print '"</script>';
|
print '"</script>';
|
||||||
print "\n";
|
print "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print '<script language="javascript" type="text/javascript" src="'.DOL_URL_ROOT.'/lib/lib_foot.js"></script>';
|
print '<script language="javascript" type="text/javascript" src="'.DOL_URL_ROOT.'/lib/lib_foot.js"></script>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Juste pour eviter bug IE qui reorganise mal div precedents si celui-ci absent
|
// Juste pour eviter bug IE qui reorganise mal div precedents si celui-ci absent
|
||||||
if ($limitIEbug && ! $conf->browser->firefox) print "\n".'<div class="tabsAction"> </div>'."\n";
|
if ($limitIEbug && ! $conf->browser->firefox) print "\n".'<div class="tabsAction"> </div>'."\n";
|
||||||
|
|
||||||
print "</body>\n";
|
print "</body>\n";
|
||||||
print "</html>\n";
|
print "</html>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user