diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index edafa985c20..95b5844269c 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2007 Laurent Destailleur * * 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 @@ -37,62 +37,70 @@ if (!$user->admin) if ( (isset($_POST["action"]) && $_POST["action"] == 'update') || (isset($_POST["action"]) && $_POST["action"] == 'updateedit') ) { - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM",$_POST["nom"]); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADRESSE",$_POST["address"]); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_VILLE",$_POST["ville"]); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_CP",$_POST["cp"]); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_PAYS",$_POST["pays_id"]); - dolibarr_set_const($db, "MAIN_MONNAIE",$_POST["currency"]); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL",$_POST["tel"]); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FAX",$_POST["fax"]); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MAIL",$_POST["mail"]); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_WEB",$_POST["web"]); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOTE",$_POST["note"]); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD",$_POST["gencod"]); - if ($_FILES["logo"]["tmp_name"]) - { - if (eregi('([^\\\/:]+)$',$_FILES["logo"]["name"],$reg)) - { - $original_file=$reg[1]; - - dolibarr_syslog("Move file ".$_FILES["logo"]["tmp_name"]." to ".$conf->societe->dir_logos.'/'.$original_file); - if (! is_dir($conf->societe->dir_logos)) - { - create_exdir($conf->societe->dir_logos); - } - if (doliMoveFileUpload($_FILES["logo"]["tmp_name"],$conf->societe->dir_logos.'/'.$original_file)) - { - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO",$original_file); - } - else - { - $message .= '
'.$langs->trans("ErrorFailedToSaveFile").'
'; - } - } - } + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM",$_POST["nom"]); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADRESSE",$_POST["address"]); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_VILLE",$_POST["ville"]); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_CP",$_POST["cp"]); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_PAYS",$_POST["pays_id"]); + dolibarr_set_const($db, "MAIN_MONNAIE",$_POST["currency"]); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL",$_POST["tel"]); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FAX",$_POST["fax"]); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MAIL",$_POST["mail"]); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_WEB",$_POST["web"]); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOTE",$_POST["note"]); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD",$_POST["gencod"]); + if ($_FILES["logo"]["tmp_name"]) + { + if (eregi('([^\\\/:]+)$',$_FILES["logo"]["name"],$reg)) + { + $original_file=$reg[1]; + + if (eregi('(\.png|\.jpg|\.jpeg)$',$original_file)) + { + dolibarr_syslog("Move file ".$_FILES["logo"]["tmp_name"]." to ".$conf->societe->dir_logos.'/'.$original_file); + if (! is_dir($conf->societe->dir_logos)) + { + create_exdir($conf->societe->dir_logos); + } + if (doliMoveFileUpload($_FILES["logo"]["tmp_name"],$conf->societe->dir_logos.'/'.$original_file)) + { + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO",$original_file); + } + else + { + $message .= '
'.$langs->trans("ErrorFailedToSaveFile").'
'; + } + } + else + { + $message .= '
'.$langs->trans("ErrorOnlyPngJpgSupported").'
'; + } + } + } - dolibarr_set_const($db, "MAIN_INFO_CAPITAL",$_POST["capital"]); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE",$_POST["forme_juridique_code"]); - dolibarr_set_const($db, "MAIN_INFO_SIREN",$_POST["siren"]); - dolibarr_set_const($db, "MAIN_INFO_SIRET",$_POST["siret"]); - dolibarr_set_const($db, "MAIN_INFO_APE",$_POST["ape"]); - dolibarr_set_const($db, "MAIN_INFO_RCS",$_POST["rcs"]); - dolibarr_set_const($db, "MAIN_INFO_TVAINTRA",$_POST["tva"]); + dolibarr_set_const($db, "MAIN_INFO_CAPITAL",$_POST["capital"]); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE",$_POST["forme_juridique_code"]); + dolibarr_set_const($db, "MAIN_INFO_SIREN",$_POST["siren"]); + dolibarr_set_const($db, "MAIN_INFO_SIRET",$_POST["siret"]); + dolibarr_set_const($db, "MAIN_INFO_APE",$_POST["ape"]); + dolibarr_set_const($db, "MAIN_INFO_RCS",$_POST["rcs"]); + dolibarr_set_const($db, "MAIN_INFO_TVAINTRA",$_POST["tva"]); - dolibarr_set_const($db, "FACTURE_TVAOPTION",$_POST["optiontva"]); + dolibarr_set_const($db, "FACTURE_TVAOPTION",$_POST["optiontva"]); - if ($_POST['action'] != 'updateedit') - { - Header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } + if ($_POST['action'] != 'updateedit' && ! $message) + { + Header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } } if ($_GET["action"] == 'removelogo') { - $logofile=$conf->societe->dir_logos.'/'.$mysoc->logo; - @unlink($logofile); - dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO"); + $logofile=$conf->societe->dir_logos.'/'.$mysoc->logo; + @unlink($logofile); + dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO"); + $mysoc->logo=''; } /* @@ -183,7 +191,7 @@ if ((isset($_GET["action"]) && $_GET["action"] == 'edit') { print ''.img_delete($langs->trans("Delete")).''; print '   '; - print ''; + print ''; } else { diff --git a/htdocs/install/default.css b/htdocs/install/default.css index 8c3dd46cc29..75c91e7d51f 100644 --- a/htdocs/install/default.css +++ b/htdocs/install/default.css @@ -55,6 +55,14 @@ border-right: 1px solid #8CACBB; text-align: right; } +inputdisabled +{ + background: #FDFDFD; + border: 1px solid #ACBCBB; + padding: 0px 0px 0px 0px; + margin: 0px 0px 0px 0px; +} + table.main { background: #dcdcd3; text-align: left; @@ -62,8 +70,8 @@ border: 1px solid #8CACBB; } table.main-inside { -padding-left: 20px; -padding-right: 20px; +padding-left: 10px; +padding-right: 10px; margin-bottom: 20px; margin-top: 10px; } @@ -150,7 +158,7 @@ background-color: #B5C5C5; td.label { background: #dcdcd3; color: #5945A3; -padding: 0.5em 0.5em 0.5em; +padding: 5px 5px 5px 5px; margin: 0em 0em 0em 0em; border-bottom: 1px solid #8CACBB; } @@ -158,7 +166,7 @@ border-bottom: 1px solid #8CACBB; td.comment { background: #dcdcd3; color: black; -padding: 0.5em 0.5em 0.5em; +padding: 5px 5px 5px 5px; margin: 0em 0em 0em 0em; text-decoration:none; font-size: 13px; @@ -166,11 +174,11 @@ border-bottom: 1px solid #8CACBB; } table { -font-size: 13px; +font-size: 12px; } .install { border: 1px solid #8CACBB; padding: 4px 4px 4px 4px; -} \ No newline at end of file +} diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index f042742d0c1..94ed4bb7fc5 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -271,7 +271,7 @@ while (($file = readdir($handle))!==false) trans("CreateDatabase"); ?> - + trans("CheckToCreateDatabase"); ?> @@ -302,7 +302,7 @@ while (($file = readdir($handle))!==false) trans("CreateUser"); ?> - + trans("CheckToCreateUser"); ?> diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 3f183ec82ff..be87d37f3f8 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -134,26 +134,26 @@ function pHeader($soutitre,$next,$action='set') header("Content-type: text/html; charset=".$conf->character_set_client); print ''."\n"; - print ''; - print ''; - print ''; - print ''; - print ''.$langs->trans("DolibarrSetup").''; - print ''; - print ''; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''.$langs->trans("DolibarrSetup").''."\n"; + print ''."\n"; + print ''."\n"; print ''.$langs->trans("DolibarrSetup"); if ($soutitre) { print ' - '.$soutitre; } - print ''; + print ''."\n"; - print '
'; - print ''; - print ''; + print ''."\n"; + print ''."\n"; + print ''."\n"; - print '
'; + print '
'."\n"; - print '
'; + print '
'."\n"; } function pFooter($nonext=0,$setuplang='') @@ -162,8 +162,8 @@ function pFooter($nonext=0,$setuplang='') $langs->load("main"); $langs->load("admin"); - print '
'; - print '
'; + print '
'."\n"; + print '
'."\n"; if (! $nonext) { @@ -174,9 +174,9 @@ function pFooter($nonext=0,$setuplang='') print ''; } - print '
'; - print ''; - print ''; + print ''."\n"; + print ''."\n"; + print ''."\n"; } diff --git a/htdocs/install/licence.php b/htdocs/install/licence.php index 0f4f469a94e..581e21c8254 100644 --- a/htdocs/install/licence.php +++ b/htdocs/install/licence.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005 Laurent Destailleur +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2005-2007 Laurent Destailleur * * 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 @@ -18,7 +18,6 @@ * * $Id$ * $Source$ - * */ /** @@ -40,9 +39,13 @@ dolibarr_install_syslog("licence: Entering licence.php page"); pHeader($langs->trans("License"),"fileconf"); -print '
';
+print '
'."\n"; +//print '
';
+print '';
+print '
'."\n"; pFooter(0,$setuplang); diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang index da1702de319..79b22507778 100644 --- a/htdocs/langs/en_US/install.lang +++ b/htdocs/langs/en_US/install.lang @@ -25,7 +25,7 @@ PHPVersion=PHP Version YouCanContinue=You can continue... License=Using license ConfigurationFile=Configuration file -WebPagesDirectory=Directory to store web pages +WebPagesDirectory=Directory where web pages are stored DocumentsDirectory=Directory to store uploaded and generated documents URLRoot=URL Root DolibarrDatabase=Dolibarr Database @@ -44,10 +44,10 @@ AdminPassword=Password for Dolibarr database administrator. Keep empty if you co CreateDatabase=Create database CreateUser=Create user DatabaseSuperUserAccess=Database - Superuser access -CheckToCreateDatabase=Check box if database does not exist and must be created -CheckToCreateUser=Check box if login does not exist and must be created +CheckToCreateDatabase=Check box if database does not exist and must be created.
In this case, you must fill the login/password for superuser account at the bottom of this page. +CheckToCreateUser=Check box if login does not exist and must be created.
In this case, you must fill the login/password for superuser account at the bottom of this page. Experimental=(experimental, non operationnal) -DatabaseRootLoginDescription=Login for user user allowed to create new databases, useless if your database is already created (like when you are hosted by an web hosting provider). +DatabaseRootLoginDescription=Login for the user allowed to create new databases or new users, useless if your database and your database login already exists (like when you're hosted by a web hosting provider). KeepEmptyIfNoPassword=Keep empty if user has no password SaveConfigurationFile=Save values ConfigurationSaving=Configuration file saving @@ -101,11 +101,11 @@ AlreadyDone=Already migrated DatabaseVersion=Database version ServerVersion=Database server version YouMustCreateItAndAllowServerToWrite=You must create this directory and grant web server to write into. -CharsetChoice=Ccharacter set choice -CharacterSetClient=Character set used for generating web pages +CharsetChoice=Character set choice +CharacterSetClient=Character set used for generated HTML web pages CharacterSetClientComment=Choose character set for web display.
Default proposed character set is the one of your database. -CollationConnection=Collation used for the database -CollationConnectionComment=Choose collation wanted for creating database.
This parameter can't be defined if database already exists. +CollationConnection=Character sorting order +CollationConnectionComment=Choose page code that defines character's sorting order used by database. This parameter is also called 'collation' by some databases.
This parameter can't be defined if database already exists. CharacterSetDatabase=Character set for database CharacterSetDatabaseComment=Choose character set wanted for database creation.
This parameter can't be defined if database already exists. YouAskDatabaseCreationSoDolibarrNeedToConnect=You ask to create database login %s, but for this, Dolibarr need to connect to server %s with super user %s permissions. diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index a3159c8dd52..492f96219c4 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -33,6 +33,8 @@ ErrorSomeErrorWereFoundRollbackIsDone=Some errors were found. We rollback change ErrorConfigParameterNotDefined=Parameter %s is not defined inside Dolibarr config file conf.php. ErrorCantLoadUserFromDolibarrDatabase=Failed to find user %s in Dolibarr database. ErrorNoVATRateDefinedForSellerCountry=Error, no vat rates defined for country '%s'. +ErrorFailedToSaveFile=Error, failed to save file. +ErrorOnlyPngJpgSupported=Error, only .png and .jpg image format file are supported. DolibarrInHttpAuthenticationSoPasswordUseless=Dolibarr authentication mode is setup to %s in configuration file conf.php.
This means that password database is extern to Dolibarr, so changing this field may have no effects. Undefined=Undefined PasswordForgotten=Password forgotten ? diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index 9c03ac2594a..4dbd35fcd4e 100755 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -74,7 +74,6 @@ LoginAccountDisable=Account disabled, put a new login to activate it. LoginAccountDisableInDolibarr=Account disabled in Dolibarr. LoginAccountDisableInLdap=Account disabled in the domain. UsePersonalValue=Use personal value -ErrorFailedToSaveFile=Error - Failed to save file GuiLanguage=Interface language InternalUser=Internal user MyInformations=My data diff --git a/htdocs/langs/fr_FR/install.lang b/htdocs/langs/fr_FR/install.lang index d30c2ee920f..8256318434d 100644 --- a/htdocs/langs/fr_FR/install.lang +++ b/htdocs/langs/fr_FR/install.lang @@ -25,8 +25,8 @@ PHPVersion=Version PHP YouCanContinue=Vous pouvez continuer... License=Licence d'utilisation ConfigurationFile=Fichier de configuration -WebPagesDirectory=Répertoire d'installation des pages web -DocumentsDirectory=Répertoire contenant les documents générés (PDF, etc.) +WebPagesDirectory=Répertoire contenat les pages web +DocumentsDirectory=Répertoire devant contenir les documents générés (PDF, etc.) URLRoot=URL Racine DolibarrDatabase=Base de données Dolibarr DatabaseChoice=Choix de la base de données @@ -44,10 +44,10 @@ AdminPassword=Mot de passe de l'administrateur de la base de donn CreateDatabase=Créer la base de donnée CreateUser=Créer l'utilisateur DatabaseSuperUserAccess=Base de données - Accès super utilisateur -CheckToCreateDatabase=Cochez cette option si la base de données n'existe pas et doit être créée -CheckToCreateUser=Cochez cette option si le login n'existe pas et doit être créé +CheckToCreateDatabase=Cochez cette option si la base de données n'existe pas et doit être créée.
Dans ce cas, il faut renseigner le login/mot de passe du superutilisateur au bas de cette page. +CheckToCreateUser=Cochez cette option si le login n'existe pas et doit être créé.
Dans ce cas, il faut renseigner le login/mot de passe du superutilisateur au bas de cette page. Experimental=(expérimental, non opérationnel) -DatabaseRootLoginDescription=Login de l'utilisateur ayant les droits de création de la base de données, inutile si votre base est déjà créée (comme lorsque vous êtes chez un hébergeur). +DatabaseRootLoginDescription=Login de l'utilisateur de la base ayant les droits de création de base de données ou de compte pour la base, inutile si la base et son compte d'accès existe déjà (comme lorsque vous êtes chez un hébergeur). KeepEmptyIfNoPassword=Laissez vide si l'utilisateur n'a pas de mot de passe SaveConfigurationFile=Enregistrement du fichier de configuration ConfigurationSaving=Enregistrement du fichier de configuration @@ -104,8 +104,8 @@ YouMustCreateItAndAllowServerToWrite=Vous devez cr CharsetChoice=Choix du codage des caractères CharacterSetClient=Codage utilisé pour l'affichage des pages CharacterSetClientComment=Veuillez choisir le codage que vous souhaitez pour l'affichage des pages.
Le codage proposé par défaut est celui de votres base de donnée par défaut. -CollationConnection=Collation utilisée pour la base de données -CollationConnectionComment=Veuillez choisir la collation que vous désirez choisir pour la création de la base de données.
Ce paramètre n'est pas sélectionnable si votre base est déjà créée. +CollationConnection=Ordre de tri utilisé pour la base de données +CollationConnectionComment=Veuillez choisir la page de code définissant l'ordre de tri des caractères utilisé par la base de donnée. Ce paramètre est aussi appelé 'collation' par certaines bases de données.
Ce paramètre n'est pas sélectionnable si votre base est déjà créée. CharacterSetDatabase=Codage utilisé pour la base de données CharacterSetDatabaseComment=Veuillez choisir le codage que vous désirez choisir pour la création de la base de données.
Ce paramètre n'est pas sélectionnable si votre base est déjà créée. YouAskDatabaseCreationSoDolibarrNeedToConnect=Vous avez demandé la création du login de base de donnée %s, mais pour cela, Dolibarr doit se connecter sur le serveur %s via le super utilisateur %s. diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 92314ef498e..3b70de67732 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -33,6 +33,8 @@ ErrorSomeErrorWereFoundRollbackIsDone=Des erreurs ont ErrorConfigParameterNotDefined=Le parametre %s n'est pas défini dans le fichier de configuration Dolibarr conf.php. ErrorCantLoadUserFromDolibarrDatabase=Impossible de trouver l'utilisateur %s dans la base Dolibarr. ErrorNoVATRateDefinedForSellerCountry=Erreur, aucun taux tva défini pour le pays '%s'. +ErrorFailedToSaveFile=Erreur, l'enregistrement du fichier a échoué. +ErrorOnlyPngJpgSupported=Erreur, seuls les formats images .jpg et .png sont supportés. DolibarrInHttpAuthenticationSoPasswordUseless=Dolibarr est configuré en mode authentification %s dans son fichier de configuration conf.php.
Cela signifie que la base des mots de passe est externe à Dolibarr, aussi toute modification de ce champ peut s'avérer sans effet. Undefined=Non défini PasswordForgotten=Mot de passe oublié ? diff --git a/htdocs/langs/fr_FR/users.lang b/htdocs/langs/fr_FR/users.lang index 5b568ea0ace..a6caa5bd410 100755 --- a/htdocs/langs/fr_FR/users.lang +++ b/htdocs/langs/fr_FR/users.lang @@ -74,7 +74,6 @@ LoginAccountDisable=Le compte est d LoginAccountDisableInDolibarr=Le compte est désactivé sur Dolibarr. LoginAccountDisableInLdap=Le compte est désactivé sur le domaine. UsePersonalValue=Utiliser valeur personalisée -ErrorFailedToSaveFile=Erreur - l'enregistrement du fichier a échoué GuiLanguage=Langage de l'interface InternalUser=Utilisateur interne MyInformations=Mes informations diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index a269e4cb8b5..437b7296022 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -1124,77 +1124,78 @@ function info_admin($texte) */ function dol_loginfunction($notused,$pearstatus) { - global $langs,$conf; - $langs->load("main"); - $langs->load("other"); + global $langs,$conf,$mysoc; + $langs->load("main"); + $langs->load("other"); - $conf->css = "theme/".$conf->theme."/".$conf->theme.".css"; - // Si feuille de style en php existe - if (file_exists(DOL_DOCUMENT_ROOT.'/'.$conf->css.".php")) $conf->css.=".php"; + $conf->css = "theme/".$conf->theme."/".$conf->theme.".css"; + // Si feuille de style en php existe + if (file_exists(DOL_DOCUMENT_ROOT.'/'.$conf->css.".php")) $conf->css.=".php"; - // Ce DTD est KO car inhibe document.body.scrollTop - //print ''; - // Ce DTD est OK - print ''."\n"; + // Ce DTD est KO car inhibe document.body.scrollTop + //print ''; + // Ce DTD est OK + print ''."\n"; // En tete html - print "\n"; - print "\n"; - print ''."\n"; // Evite indexation par robots + print "\n"; + print "\n"; + print ''."\n"; // Evite indexation par robots print "Dolibarr Authentification\n"; - print ''."\n"; + print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; - // Body + // Body print ''; // Start Form - print '
'; + print ''; // Table 1 - print ''; - if (file_exists(DOL_DOCUMENT_ROOT.'/logo.png')) - { - print ''; - } - else - { - print ''; - } - print '
'; - print '
Dolibarr '.DOL_VERSION.'
'; + print ''; + if (file_exists(DOL_DOCUMENT_ROOT.'/logo.png')) + { + // Cas qui ne devrait pas arriver (pour compatibilité) + print ''; + } + else + { + print ''; + } + print '
'; + print '
Dolibarr '.DOL_VERSION.'
'; print '
'; // Table 2 @@ -1205,41 +1206,45 @@ function dol_loginfunction($notused,$pearstatus) print '
  '.$langs->trans("Login").'  '; print ''; - // Affiche logo du theme si existe, sinon logo commun - if ($conf->main_authentication) $title.=$langs->trans("AuthenticationMode").': '.$conf->main_authentication; - if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/login_logo.png')) - { - print ''; - } - else - { - print ''; - } + if ($conf->main_authentication) $title.=$langs->trans("AuthenticationMode").': '.$conf->main_authentication; + // Affiche logo du theme si existe, sinon logo commun + $urllogo=DOL_URL_ROOT.'/theme/login_logo.png'; + if (is_readable($conf->societe->dir_logos.'/'.$mysoc->logo)) + { + $urllogo=DOL_URL_ROOT.'/viewimage.php?modulepart=companylogo&file='.urlencode($mysoc->logo); + $height=100; // \TODO Forcer la hauteur uniquement si hauteur > 100 ou largeur > 100 + } + elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/login_logo.png')) + { + $urllogo=DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/login_logo.png'; + $height=80; + } + print ''; - print ''; + print ''; - print '   '.$langs->trans("Password").'   '; - print ''; + print '   '.$langs->trans("Password").'   '; + print ''; print ''; - print '
'; - print ''; - print ''; + print '
'; + print ''; + print ''; if (! $conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK) { print '('.$langs->trans("PasswordForgotten").')'; } - print ''; - print ''; + print ''; + print ''; - print '
'; + print ''; // Message - if ($_SESSION["loginmesg"] || ! empty($pearstatus)) - { - print '
'; + if ($_SESSION["loginmesg"] || ! empty($pearstatus)) + { + print '
'; if ($pearstatus == AUTH_EXPIRED) print "Your session expired. Please login again!\n"; elseif ($pearstatus == AUTH_IDLED) print "You have been idle for too long. Please login again!\n"; elseif ($pearstatus == AUTH_WRONG_LOGIN) print $langs->trans("ErrorBadLoginPassword"); @@ -1252,11 +1257,11 @@ function dol_loginfunction($notused,$pearstatus) } if ($conf->global->MAIN_HOME) { - print '
'; - print nl2br($conf->global->MAIN_HOME); - print '

'; + print '
'; + print nl2br($conf->global->MAIN_HOME); + print '

'; } - + // Fin entete html print "\n\n"; } diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 58cd705ef1d..38151d25ea2 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2006 Laurent Destailleur + * Copyright (C) 2005-2007 Laurent Destailleur * * 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 @@ -28,18 +28,31 @@ \version $Revision$ */ -require_once("main.inc.php"); - // C'est un wrapper, donc header vierge function llxHeader() { } - $original_file = urldecode($_GET["file"]); $modulepart = urldecode($_GET["modulepart"]); $type = urldecode($_GET["type"]); +// Protection, on interdit les .. dans les chemins +$original_file = eregi_replace('\.\.','',$original_file); + + +if ($modulepart == 'companylogo') +{ + // Pour companylogo, on charge juste environnement sans logon qui charge le user + require_once("master.inc.php"); +} +else +{ + // Pour autre que companylogo, on charge environnement + info issus de logon comme le user + require_once("main.inc.php"); +} + + $accessallowed=0; if ($modulepart)