diff --git a/htdocs/lib/ajax.lib.php b/htdocs/lib/ajax.lib.php new file mode 100644 index 00000000000..401b2f8d47b --- /dev/null +++ b/htdocs/lib/ajax.lib.php @@ -0,0 +1,139 @@ + + * Copyright (C) 2007 Regis Houssin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * or see http://www.gnu.org/ + * + * $Id$ + */ + +function ajax_indicator($htmlname,$indicator='working') +{ + $script.=''; + return $script; +} + +/** + \brief Récupére la valeur d'un champ, effectue un traitement Ajax et affiche le résultat + \param htmlname nom et id du champ + \param keysearch nom et id complémentaire du champ de collecte + \param url chemin du fichier de réponse : /chemin/fichier.php + \param option champ supplémentaire de recherche dans les paramétres + \param indicator Nom de l'image gif sans l'extension + \return script script complet +*/ +function ajax_updater($htmlname,$keysearch,$url,$option='',$indicator='working') +{ + $script = ''; + if ($indicator) $script.=ajax_indicator($htmlname,$indicator); + $script.=''; + $script.='
'; + + return $script; +} + +/** + \brief Récupére la valeur d'un champ, effectue un traitement Ajax et affiche le résultat + \param htmlname nom et id du champ + \param keysearch nom et id complémentaire du champ de collecte + \param id ID du champ a modifier + \param url chemin du fichier de réponse : /chemin/fichier.php + \param option champ supplémentaire de recherche dans les paramétres + \param indicator Nom de l'image gif sans l'extension + \return script script complet +*/ +function ajax_updaterWithID($htmlname,$keysearch,$id,$url,$option='',$indicator='working') +{ + $script = ''; + if ($indicator) $script.=ajax_indicator($htmlname,$indicator); + $script.=''; + + return $script; +} + +/** + \brief Récupére la valeur d'un champ, effectue un traitement Ajax et affiche le résultat + \param htmlname nom et id du champ + \param url chemin du fichier de réponse : /chemin/fichier.php + \param indicator nom de l'image gif sans l'extension + \return script script complet +*/ +function ajax_autocompleter($selected='',$htmlname,$url,$indicator='working') +{ + if ($indicator) $script.= ajax_indicator($htmlname,$indicator); + $script.= ''; + $script.= ''; + $script.= '
'; + $script.= ''; + + return $script; +} + +?> \ No newline at end of file diff --git a/htdocs/lib/antispamimage.php b/htdocs/lib/antispamimage.php index 38647fdf515..3123e070572 100644 --- a/htdocs/lib/antispamimage.php +++ b/htdocs/lib/antispamimage.php @@ -25,17 +25,23 @@ \version $Revision$ */ +if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); - - -// C'est un wrapper, donc header vierge -function llxHeader() { } - +if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); +if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); +if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); require_once("../master.inc.php"); require_once DOL_DOCUMENT_ROOT.'/../external-libs/Artichow/Artichow.cfg.php'; require_once ARTICHOW."/AntiSpam.class.php"; +// Init session +$sessionname="DOLSESSID_".$dolibarr_main_db_name; +session_name($sessionname); +session_start(); + + // On créé l'objet anti-spam $object = new AntiSpam(); @@ -60,4 +66,9 @@ $object->border->setColor($colorbr); // On affiche l'image à l'écran $object->draw(); + + +// C'est un wrapper, donc header vierge +function llxHeader() { } + ?> \ No newline at end of file diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index 3e3a279e575..a9b0f04567b 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -1425,8 +1425,9 @@ function dol_loginfunction($notused,$pearstatus) print '
  '.$langs->trans("Login").'  '; print ''; - if ($conf->main_authentication) $title.=$langs->trans("AuthenticationMode").': '.$conf->main_authentication; - + $title.=$langs->trans("SessionName").': '.session_name(); + if ($conf->main_authentication) $title.=", ".$langs->trans("AuthenticationMode").': '.$conf->main_authentication; + // Show logo (search in order: small company logo, large company logo, theme logo, common logo) $width=0; $urllogo=DOL_URL_ROOT.'/theme/login_logo.png'; @@ -1462,10 +1463,11 @@ function dol_loginfunction($notused,$pearstatus) print '   '.$langs->trans("SecurityCode").''; print ''; - print '
'; - print ''; - print ''; - print '
'; + print ''; + print ''; + print ''; + print ''; + print '
'.img_refresh().'
'; print ''; print ''; @@ -3145,122 +3147,6 @@ function num_lines($texte) return $nblines; } -function ajax_indicator($htmlname,$indicator='working') -{ - $script.=''; - return $script; -} - -/** - \brief Récupére la valeur d'un champ, effectue un traitement Ajax et affiche le résultat - \param htmlname nom et id du champ - \param keysearch nom et id complémentaire du champ de collecte - \param url chemin du fichier de réponse : /chemin/fichier.php - \param option champ supplémentaire de recherche dans les paramétres - \param indicator Nom de l'image gif sans l'extension - \return script script complet -*/ -function ajax_updater($htmlname,$keysearch,$url,$option='',$indicator='working') -{ - $script = ''; - if ($indicator) $script.=ajax_indicator($htmlname,$indicator); - $script.=''; - $script.='
'; - - return $script; -} - -/** - \brief Récupére la valeur d'un champ, effectue un traitement Ajax et affiche le résultat - \param htmlname nom et id du champ - \param keysearch nom et id complémentaire du champ de collecte - \param id ID du champ a modifier - \param url chemin du fichier de réponse : /chemin/fichier.php - \param option champ supplémentaire de recherche dans les paramétres - \param indicator Nom de l'image gif sans l'extension - \return script script complet -*/ -function ajax_updaterWithID($htmlname,$keysearch,$id,$url,$option='',$indicator='working') -{ - $script = ''; - if ($indicator) $script.=ajax_indicator($htmlname,$indicator); - $script.=''; - - return $script; -} - -/** - \brief Récupére la valeur d'un champ, effectue un traitement Ajax et affiche le résultat - \param htmlname nom et id du champ - \param url chemin du fichier de réponse : /chemin/fichier.php - \param indicator nom de l'image gif sans l'extension - \return script script complet -*/ -function ajax_autocompleter($selected='',$htmlname,$url,$indicator='working') -{ - if ($indicator) $script.= ajax_indicator($htmlname,$indicator); - $script.= ''; - $script.= ''; - $script.= '
'; - $script.= ''; - - return $script; -} - /** * \brief Fonction simple identique a microtime de PHP 5 mais compatible PHP 4 * \return float Time en millisecondes avec decimal pour microsecondes diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 8a8200dc38c..5dbb633e9cf 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -29,6 +29,12 @@ require_once(DOL_DOCUMENT_ROOT."/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/ldap.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/usergroups.lib.php"); +// Init session +$sessionname="DOLSESSID_".$dolibarr_main_db_name; +session_name($sessionname); +session_start(); +dolibarr_syslog("Session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"]); + $user->getrights('user'); $langs->load("main"); @@ -218,6 +224,8 @@ print '
  '.$langs->trans("Login").''; $title=''; +$title.=$langs->trans("SessionName").': '.session_name(); +if ($conf->main_authentication) $title.=", ".$langs->trans("AuthenticationMode").': '.$conf->main_authentication; // Show logo (search in order: small company logo, large company logo, theme logo, common logo) $width=0;