From 8fe17308cf13c5e1f03b5beb3004bf4194cc7977 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Oct 2009 22:28:03 +0000 Subject: [PATCH] New: Debian package build is finished. --- build/deb/install.forced.php | 16 +++++++++++++ build/deb/postinst | 19 +++++++++++++-- build/deb/postrm | 8 +++++-- build/exe/doliwamp/install.forced.php.install | 2 +- build/makepack-dolibarr.pl | 6 ++--- htdocs/index.php | 2 +- htdocs/install/check.php | 24 +++++++++++++++---- htdocs/install/etape5.php | 13 ++++++---- htdocs/install/fileconf.php | 4 ++-- .../install/mysql/migration/2.6.0-2.7.0.sql | 1 - htdocs/install/mysql/tables/llx_adherent.sql | 2 +- htdocs/langs/en_US/install.lang | 11 +++++---- htdocs/langs/fr_FR/install.lang | 13 +++++----- htdocs/lib/doleditor.class.php | 1 - htdocs/master.inc.php | 4 ++-- 15 files changed, 90 insertions(+), 36 deletions(-) create mode 100644 build/deb/install.forced.php diff --git a/build/deb/install.forced.php b/build/deb/install.forced.php new file mode 100644 index 00000000000..78f656957d1 --- /dev/null +++ b/build/deb/install.forced.php @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/build/deb/postinst b/build/deb/postinst index 41d0d60f484..bc3ff568f00 100644 --- a/build/deb/postinst +++ b/build/deb/postinst @@ -46,10 +46,25 @@ echo Run the postinst script case "$1" in configure) - configorig="/usr/share/dolibarr/build/deb/apache.conf" + + # Copy include for apache.conf + fileorig="/usr/share/dolibarr/build/deb/apache.conf" config="/etc/dolibarr/apache.conf" mkdir -p /etc/dolibarr - cp -pr $configorig $config + cp -p $fileorig $config + + # Copy install.forced.php + fileorig="/usr/share/dolibarr/build/deb/install.forced.php" + config="/usr/share/dolibarr/htdocs/install/install.forced.php" + cp -p $fileorig $config + + # Create conf.php + if [ ! -f /usr/share/dolibarr/htdocs/conf/conf.php ] + then + touch /usr/share/dolibarr/htdocs/conf/conf.php + chown -R www-data.www-data /usr/share/dolibarr/htdocs/conf/conf.php; + chmod -R 750 /usr/share/dolibarr/htdocs/conf/conf.php; + fi #db_reset "dolibarr/webserver" diff --git a/build/deb/postrm b/build/deb/postrm index 15faadb47c5..22842c9a6bd 100644 --- a/build/deb/postrm +++ b/build/deb/postrm @@ -32,6 +32,7 @@ includefile=/etc/dolibarr/apache.conf case "$1" in purge) + db_get "dolibarr/postrm" if [ "$RET" = "true" ] ; then # Get database configuration @@ -46,9 +47,9 @@ case "$1" in . /usr/share/wwwconfig-common/${dbtype}-dropuser.sh . /usr/share/wwwconfig-common/${dbtype}-dropdb.sh - fi + # Remove include files for server in $webservers ; do error="" conffile="/etc/$server/httpd.conf" @@ -65,16 +66,19 @@ case "$1" in done rm -rf /etc/dolibarr + # Restart servers="apache2-ssl apache2 mysql" . /usr/share/wwwconfig-common/restart.sh + # Remove file and conf file for dir in /usr/share/dolibarr ; do if [ -d ${dir} ] ; then rm -rf ${dir} ; fi done - + db_purge ;; remove) + rm -fr /usr/share/dolibarr/htdocs/install ;; upgrade) ;; diff --git a/build/exe/doliwamp/install.forced.php.install b/build/exe/doliwamp/install.forced.php.install index 8421516e57e..db8ac842535 100644 --- a/build/exe/doliwamp/install.forced.php.install +++ b/build/exe/doliwamp/install.forced.php.install @@ -1,5 +1,5 @@ $BUILDROOT/$PROJECT/usr/share/$PROJECT/htdocs/conf/conf.php`; + print "Remove config file\n"; + $ret=`rm -f $BUILDROOT/$PROJECT/usr/share/$PROJECT/htdocs/conf/conf.php`; print "Edit version in file $BUILDROOT/$PROJECT/DEBIAN/control\n"; open (SPECFROM,"<$SOURCE/build/deb/control") || die "Error"; @@ -405,10 +405,8 @@ if ($nboftargetok) { print "Set permissions/owners on files/dir\n"; $ret=`chown -R root.root $BUILDROOT/$PROJECT`; $ret=`chown -R www-data.www-data $BUILDROOT/$PROJECT/usr/share/$PROJECT/documents`; - $ret=`chown -R www-data.www-data $BUILDROOT/$PROJECT/usr/share/$PROJECT/htdocs/conf/conf.php`; $ret=`chmod -R 555 $BUILDROOT/$PROJECT`; $ret=`chmod -R 755 $BUILDROOT/$PROJECT/usr/share/$PROJECT/documents`; - $ret=`chmod -R 755 $BUILDROOT/$PROJECT/usr/share/$PROJECT/htdocs/conf/conf.php`; $ret=`chmod -R 755 $BUILDROOT/$PROJECT/DEBIAN`; print "Go to directory $BUILDROOT\n"; diff --git a/htdocs/index.php b/htdocs/index.php index 6c5c3cdf748..2a433c35490 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -52,7 +52,7 @@ print_fiche_titre($langs->trans("HomeArea")); if (! empty($conf->global->MAIN_MOTD)) { - $conf->global->MAIN_MOTD=preg_replace('/$/i','',$conf->global->MAIN_MOTD); + $conf->global->MAIN_MOTD=preg_replace('//i','
',$conf->global->MAIN_MOTD); if (! empty($conf->global->MAIN_MOTD)) { print "\n\n"; diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 21c53056cb3..d64eaca922a 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -310,14 +310,27 @@ else print $langs->trans("InstallEasy")." "; print $langs->trans("ChooseYourSetupMode"); - + + $foundrecommandedchoice=0; + + // Array of install choices print ''; # Sho first install line - print ''; + print ''; print ''; + print $langs->trans("FreshInstallDesc"); + if (empty($dolibarr_main_db_host)) // This means install process was not run + { + print '
'; + //print $langs->trans("InstallChoiceRecommanded",DOL_VERSION,$conf->global->MAIN_VERSION_LAST_UPGRADE); + print '
'.$langs->trans("InstallChoiceSuggested").'
'; + // Ok '; + $foundrecommandedchoice=1; // To show only once + } + print ''; print '
'.$langs->trans("FreshInstall").'
'.$langs->trans("FreshInstall").''; + print ''; - print $langs->trans("FreshInstallDesc").''; if ($allowinstall) { @@ -333,6 +346,10 @@ else # Show upgrade lines $allowupgrade=true; + if (empty($dolibarr_main_db_host)) // This means install process was not run + { + $allowupgrade=false; + } if (defined("MAIN_NOT_INSTALLED")) $allowupgrade=false; $migrationscript=array( //array('from'=>'2.0.0', 'to'=>'2.1.0'), //array('from'=>'2.1.0', 'to'=>'2.2.0'), @@ -342,7 +359,6 @@ else array('from'=>'2.6.0', 'to'=>'2.7.0') ); - $foundrecommandedchoice=0; $count=0; foreach ($migrationscript as $migarray) { diff --git a/htdocs/install/etape5.php b/htdocs/install/etape5.php index 11e572e268c..6dd10169a0d 100644 --- a/htdocs/install/etape5.php +++ b/htdocs/install/etape5.php @@ -23,7 +23,7 @@ /** * \file htdocs/install/etape5.php * \ingroup install - * \brief Page de fin d'installation ou de migration + * \brief Last page of upgrade or install process * \version $Id$ */ @@ -285,9 +285,14 @@ if ($_POST["action"] == "set") else { // Install is finished, we create the lock file - $fp = fopen("../../install.lock", "w"); - fwrite($fp, "This is a lock file to prevent use of install pages"); - fclose($fp); + $lockfile="../../install.lock"; + $fp = @fopen($lockfile, "w"); + if ($fp) + { + fwrite($fp, "This is a lock file to prevent use of install pages"); + fclose($fp); + @chmod($lockfile, octdec(444)); + } } print "
"; diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 474236e64dd..166ac548df4 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -56,9 +56,9 @@ dolibarr_install_syslog("Fileconf: Entering fileconf.php page"); pHeader($langs->trans("ConfigurationFile"),"etape0"); -if (! empty($force_install_message_doliwamp)) +if (! empty($force_install_message)) { - print ''.$langs->trans("KeepDefaultValues").'
'; + print ''.$langs->trans($force_install_message).'
'; } ?> diff --git a/htdocs/install/mysql/migration/2.6.0-2.7.0.sql b/htdocs/install/mysql/migration/2.6.0-2.7.0.sql index 837fc16ba63..d6ba3f02f17 100644 --- a/htdocs/install/mysql/migration/2.6.0-2.7.0.sql +++ b/htdocs/install/mysql/migration/2.6.0-2.7.0.sql @@ -460,7 +460,6 @@ alter table llx_propaldet modify special_code integer UNSIGNED DEFAULT 0; alter table llx_societe modify special_code integer NULL; alter table llx_c_forme_juridique modify code integer NOT NULL; -ALTER TABLE llx_adherent_options ADD INDEX uk_adherent_options (adhid); ALTER TABLE llx_bank_class ADD UNIQUE INDEX idx_bank_class_lineid (lineid); ALTER TABLE llx_c_ecotaxe ADD UNIQUE INDEX uk_c_ecotaxe (code); ALTER TABLE llx_c_methode_commande_fournisseur ADD UNIQUE INDEX uk_c_methode_commande_fournisseur (code); diff --git a/htdocs/install/mysql/tables/llx_adherent.sql b/htdocs/install/mysql/tables/llx_adherent.sql index e2c2b2d0804..77161ad590d 100644 --- a/htdocs/install/mysql/tables/llx_adherent.sql +++ b/htdocs/install/mysql/tables/llx_adherent.sql @@ -48,7 +48,7 @@ create table llx_adherent photo varchar(255), -- url vers photo statut smallint NOT NULL DEFAULT 0, public smallint NOT NULL DEFAULT 0, -- certain champ de la fiche sont ils public ou pas ? - datefin datetime, -- date de fin de validité de la cotisation + datefin datetime, -- date de fin de validite de la cotisation note text, datevalid datetime, -- date de validation datec datetime, -- date de creation diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang index 3b31cf218ba..619df5d3d3e 100644 --- a/htdocs/langs/en_US/install.lang +++ b/htdocs/langs/en_US/install.lang @@ -48,15 +48,15 @@ ServerPortDescription=Database server port. Keep empty if unknown. DatabaseServer=Database server DatabaseName=Database name Login=Login -AdminLogin=Login for Dolibarr database administrator. Keep empty if you connect anonymously +AdminLogin=Login for Dolibarr database owner. Password=Password PasswordAgain=Retype password a second time -AdminPassword=Password for Dolibarr database administrator. Keep empty if you connect anonymously +AdminPassword=Password for Dolibarr database owner. CreateDatabase=Create database CreateUser=Create user -DatabaseSuperUserAccess=Database - Superuser access +DatabaseSuperUserAccess=Database server - Superuser access 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. +CheckToCreateUser=Check box if owner does not exist and must be created.
In this case, you must choose its login and password and also fill the login/password for the superuser account at the bottom of this page. If this box is unchecked, owner database and its passwords must exists. Experimental=(experimental) DatabaseRootLoginDescription=Login of 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=Leave empty if user has no password (avoid this) @@ -125,7 +125,8 @@ YouAskLoginCreationSoDolibarrNeedToConnect=You ask to create database login % BecauseConnectionFailedParametersMayBeWrong=As connection failed, host or super user parameters must be wrong. OrphelinsPaymentsDetectedByMethod=Orphans payment detected by method %s RemoveItManuallyAndPressF5ToContinue=Remove it manually and press F5 to continue. -KeepDefaultValues=You use the Doliwamp setup wizard, so values proposed here are already optimized. Change them only if you know what you do. +KeepDefaultValues=You use the Dolibarr setup wizard from DoliWamp, so values proposed here are already optimized. Change them only if you know what you do. +KeepDefaultValuesDeb=You use the Dolibarr setup wizard from an Ubuntu or Debian like package, so values proposed here are already optimized. Change them only if you know what you do. FieldRenamed=Field renamed IfLoginDoesNotExistsCheckCreateUser=If login does not exists yet, you must check option "Create user" ErrorConnection=Server "%s", database name "%s", login "%s", or database password may be wrong or PHP client version may be too old compared to database version. diff --git a/htdocs/langs/fr_FR/install.lang b/htdocs/langs/fr_FR/install.lang index cabcc148d97..a60c70850cc 100644 --- a/htdocs/langs/fr_FR/install.lang +++ b/htdocs/langs/fr_FR/install.lang @@ -48,18 +48,18 @@ ServerPortDescription=Port du serveur. Ne rien mettre si inconnu. DatabaseServer=Serveur de la base de données DatabaseName=Nom de la base de données Login=Login -AdminLogin=Login de l'administrateur de la base de données Dolibarr. +AdminLogin=Login du propriétaire de la base de données Dolibarr. Password=Mot de passe PasswordAgain=Vérification du mot de passe -AdminPassword=Mot de passe de l'administrateur de la base de données Dolibarr. +AdminPassword=Mot de passe du propriétaire de la base de données Dolibarr. CreateDatabase=Créer la base de donnée CreateUser=Créer l'utilisateur -DatabaseSuperUserAccess=Base de données - Accès super utilisateur +DatabaseSuperUserAccess=Serveur de 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.
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. +CheckToCreateUser=Cochez cette option si l'utilisateur propriétaire n'existe pas et doit être créé.
Dans ce cas, il faut renseigner le nom et mot de passe du propriétaire à créer ainsi que le login/mot de passe du superutilisateur au bas de cette page. Si la case n'est pas cochée, le nom et mot de passe du propriétaire doivent exister. Experimental=(expérimental) DatabaseRootLoginDescription=Login de l'utilisateur de la base ayant les droits de création de bases de données ou de comptes 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 (à éviter) +KeepEmptyIfNoPassword=Laissez vide si l'administrateur n'a pas de mot de passe SaveConfigurationFile=Enregistrement du fichier de configuration ConfigurationSaving=Enregistrement du fichier de configuration ServerConnection=Connexion au serveur @@ -127,7 +127,8 @@ YouAskLoginCreationSoDolibarrNeedToConnect=Vous avez demandé la création du lo BecauseConnectionFailedParametersMayBeWrong=La connexion ayant échoué, les paramètres du serveur ou du super utilisateur sont peut-etre incorrects. OrphelinsPaymentsDetectedByMethod=Paiement orphelins detectés par la méthode %s RemoveItManuallyAndPressF5ToContinue=Supprimer le manuellement et appuyez sur F5 pour continuer. -KeepDefaultValues=Comme vous utilisez l'assistant d'installation depuis DoliWamp, les valeurs proposées aux paramètres sont déjà optimisées. Ne les modifier qu'en connaissance de cause. +KeepDefaultValues=Comme vous utilisez l'assistant d'installation Dolibarr depuis DoliWamp, les valeurs proposées aux paramètres sont déjà optimisées. Ne les modifier qu'en connaissance de cause. +KeepDefaultValuesDeb=Comme vous utilisez l'assistant d'installation Dolibarr depuis un package Ubuntu ou Debian, les valeurs proposées aux paramètres sont déjà optimisées. Seuls le mot de passe du propriétaire de la base de données à créer et le mot de passe du superadministrateur du serveur de données sont à renseigner. Ne modifier les autres informations qu'en connaissance de cause. FieldRenamed=Champ renommé IfLoginDoesNotExistsCheckCreateUser=Si le login n'existe pas encore, vous devez cocher l'option "Créer l'utilisateur" ErrorConnection=Le serveur "%s", nom de base "%s", login "%s", ou mot de passe de la base de donnée est peut-être incorrect ou la version du client PHP trop ancienne par rapport à la version de la base de donnée. diff --git a/htdocs/lib/doleditor.class.php b/htdocs/lib/doleditor.class.php index 1c3e737bf8e..5babe057756 100644 --- a/htdocs/lib/doleditor.class.php +++ b/htdocs/lib/doleditor.class.php @@ -57,7 +57,6 @@ class DolEditor $content=dol_htmlentitiesbr($content); // If content is not HTML, we convert to HTML. - //print "\n".$conf->global->MAIN_MOTD."\n".$content;exit; $this->editor = new FCKeditor($htmlname); $this->editor->BasePath = DOL_URL_ROOT.'/includes/fckeditor/' ; diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index f9f02b841f9..5446c4c74d8 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -78,8 +78,8 @@ if (! $result && $_SERVER["GATEWAY_INTERFACE"]) // If install not done and we ar } if (empty($dolibarr_main_db_host)) { - print 'Error: Dolibarr setup was run but was not completed.
'."\n"; - print 'Please, run Dolibarr install process until the end...'."\n"; + print 'Dolibarr setup was run but was not completed.
'."\n"; + print 'Please, click here to finish Dolibarr install process ...'."\n"; exit; } if (empty($dolibarr_main_db_type)) $dolibarr_main_db_type='mysql'; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'