From f67f0df6099c976d87a7e1a15da0430309052936 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 16 Feb 2018 12:11:39 +0100 Subject: [PATCH 1/8] Fix preview link not visible with long file names --- htdocs/core/class/html.formfile.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 74ea44c84e7..ebbdc22a097 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -716,13 +716,13 @@ class FormFile if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) $documenturl=$conf->global->DOL_URL_ROOT_DOCUMENT_PHP; // To use another wrapper // Show file name with link to download - $out.= ''; + $out.= ''; $out.= 'trans("File").': '.$file["name"]); - $out.= $file["name"]; + $out.= dol_trunc($file["name"], 150); $out.= ''."\n"; $out.= $this->showPreview($file,$modulepart,$relativepath,0,$param); $out.= ''; @@ -1087,7 +1087,7 @@ class FormFile print ''; // File name - print ''; + print ''; // Show file name with link to download //print "XX".$file['name']; //$file['name'] must be utf8 @@ -1110,7 +1110,7 @@ class FormFile } else { - print $file['name']; + print dol_trunc($file['name'], 200); print ''; } // Preview link From 8db6b1ecc03825b039348502ece1555f54025d12 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 16 Feb 2018 17:19:04 +0100 Subject: [PATCH 2/8] Fix package for debian --- build/debian/rules | 13 ++++++++++++- build/makepack-dolibarr.pl | 8 ++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/build/debian/rules b/build/debian/rules index 50866c03e68..1fe2360133f 100755 --- a/build/debian/rules +++ b/build/debian/rules @@ -10,12 +10,23 @@ export DH_OPTIONS=-v %: dh $@ +# Replace standard debian package actions with a new one +######################################################## + override_dh_auto_clean: # Do nothing. Added to disable launchpad to use bugged dh_auto_clean search for ant override_dh_auto_build: # Do nothing. Added to disable launchpad to use bugged dh_auto_build search for ant - + +#override_dh_compress: +# dh_compress --no-act -X.png + +# We disable this for png file because it modify content of original file so make +# the dolibarr signature not valid. +override_dh_strip_nondeterminism: + dh_strip_nondeterminism -X.png + override_dh_install: dh_install # Delete files diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 7da6d180dcb..aa73d4abf65 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -558,7 +558,7 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/adapters`; # Keep this removal in case we embed libraries $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/samples`; # Keep this removal in case we embed libraries - #$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball for official debian, not for the rest $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/select2/release.sh`; @@ -915,8 +915,8 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/mike42/escpos-php/LICENSE.md`; $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/mobiledetect/mobiledetectlib/LICENSE.txt`; - # Removed files we don't need - $ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/ckeditor/_source`; + # Removed files we don't need (already removed) + #$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/ckeditor/_source`; # Rename upstream changelog to match debian rules $ret=`mv $BUILDROOT/$PROJECT.tmp/ChangeLog $BUILDROOT/$PROJECT.tmp/changelog`; @@ -978,7 +978,7 @@ if ($nboftargetok) { $ret=`chmod 755 $BUILDROOT/$PROJECT.tmp/debian/rules`; $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/translation/autotranslator.class.php`; $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/actions_mymodule.class.php`; - $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/api_myobject.class.php`; + $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/api_mymodule.class.php`; $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/myobject.class.php`; $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/core/modules/modMyModule.class.php`; $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/mymoduleindex.php`; From c513ffe1f794e587a30290d5e8a9c7fe976c104c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 16 Feb 2018 18:21:18 +0100 Subject: [PATCH 3/8] Fix debian package --- .../patches/use-etc-dolibarr-conf.patch | 26 ----------------- build/rpm/dolibarr-forrpm.patch | 28 ------------------- htdocs/filefunc.inc.php | 8 ++++-- htdocs/support/inc.php | 9 ++++-- 4 files changed, 11 insertions(+), 60 deletions(-) diff --git a/build/debian/patches/use-etc-dolibarr-conf.patch b/build/debian/patches/use-etc-dolibarr-conf.patch index 3bca20ee66f..04543e5fac6 100644 --- a/build/debian/patches/use-etc-dolibarr-conf.patch +++ b/build/debian/patches/use-etc-dolibarr-conf.patch @@ -9,19 +9,6 @@ Forwarded: not-needed Last-Update: 2013-07-29 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ ---- a/htdocs/filefunc.inc.php -+++ b/htdocs/filefunc.inc.php -@@ -63,8 +63,8 @@ $conffiletoshowshort = "conf.php"; - $conffile = "conf/conf.php"; - $conffiletoshow = "htdocs/conf/conf.php"; - // For debian/redhat like systems --//$conffile = "/etc/dolibarr/conf.php"; --//$conffiletoshow = "/etc/dolibarr/conf.php"; -+$conffile = "/etc/dolibarr/conf.php"; -+$conffiletoshow = "/etc/dolibarr/conf.php"; - - - // Include configuration --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -73,8 +73,8 @@ $conffiletoshowshort = "conf.php"; @@ -34,17 +21,4 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +$conffiletoshow = "/etc/dolibarr/conf.php"; - // Load conf file if it is already defined ---- a/htdocs/support/inc.php -+++ b/htdocs/support/inc.php -@@ -69,8 +69,8 @@ $conffiletoshowshort = "conf.php"; - $conffile = "../conf/conf.php"; - $conffiletoshow = "htdocs/conf/conf.php"; - // For debian/redhat like systems --//$conffile = "/etc/dolibarr/conf.php"; --//$conffiletoshow = "/etc/dolibarr/conf.php"; -+$conffile = "/etc/dolibarr/conf.php"; -+$conffiletoshow = "/etc/dolibarr/conf.php"; - - // Load conf file if it is already defined diff --git a/build/rpm/dolibarr-forrpm.patch b/build/rpm/dolibarr-forrpm.patch index 6c484345be9..ae9cf5cb2de 100644 --- a/build/rpm/dolibarr-forrpm.patch +++ b/build/rpm/dolibarr-forrpm.patch @@ -1,17 +1,3 @@ -diff -up htdocs/filefunc.inc.php.patch htdocs/filefunc.inc.php ---- htdocs/filefunc.inc.php.patch 2011-09-03 02:32:48.666952000 +0200 -+++ htdocs/filefunc.inc.php 2011-09-03 02:33:00.510952001 +0200 -@@ -63,8 +63,8 @@ - $conffile = "conf/conf.php"; - $conffiletoshow = "htdocs/conf/conf.php"; - // For debian/redhat like systems --//$conffile = "/etc/dolibarr/conf.php"; --//$conffiletoshow = "/etc/dolibarr/conf.php"; -+$conffile = "/etc/dolibarr/conf.php"; -+$conffiletoshow = "/etc/dolibarr/conf.php"; - - - // Include configuration diff -up htdocs/install/inc.php.patch htdocs/install/inc.php --- htdocs/install/inc.php.patch 2011-09-03 02:33:26.450952000 +0200 +++ htdocs/install/inc.php 2011-09-03 02:33:36.286952001 +0200 @@ -25,18 +11,4 @@ diff -up htdocs/install/inc.php.patch htdocs/install/inc.php +$conffiletoshow = "/etc/dolibarr/conf.php"; - // Load conf file if it is already defined -diff -up htdocs/support/inc.php.patch htdocs/support/inc.php ---- htdocs/support/inc.php.patch 2011-09-03 02:34:39.606952000 +0200 -+++ htdocs/support/inc.php 2011-09-03 02:33:59.814952000 +0200 -@@ -69,8 +69,8 @@ - $conffile = "../conf/conf.php"; - $conffiletoshow = "htdocs/conf/conf.php"; - // For debian/redhat like systems --//$conffile = "/etc/dolibarr/conf.php"; --//$conffiletoshow = "/etc/dolibarr/conf.php"; -+$conffile = "/etc/dolibarr/conf.php"; -+$conffiletoshow = "/etc/dolibarr/conf.php"; - - // Load conf file if it is already defined diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 256501048ba..f0f35ada857 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -62,9 +62,11 @@ $conffiletoshowshort = "conf.php"; $conffile = "conf/conf.php"; $conffiletoshow = "htdocs/conf/conf.php"; // For debian/redhat like systems -//$conffile = "/etc/dolibarr/conf.php"; -//$conffiletoshow = "/etc/dolibarr/conf.php"; - +if (! file_exists($conffile)) +{ + $conffile = "/etc/dolibarr/conf.php"; + $conffiletoshow = "/etc/dolibarr/conf.php"; +} // Include configuration // --- End of part replaced by Dolibarr packager makepack-dolibarr diff --git a/htdocs/support/inc.php b/htdocs/support/inc.php index 2ec9a70351b..c1cf83097b6 100644 --- a/htdocs/support/inc.php +++ b/htdocs/support/inc.php @@ -58,8 +58,11 @@ $conffiletoshowshort = "conf.php"; $conffile = "../conf/conf.php"; $conffiletoshow = "htdocs/conf/conf.php"; // For debian/redhat like systems -//$conffile = "/etc/dolibarr/conf.php"; -//$conffiletoshow = "/etc/dolibarr/conf.php"; +if (! file_exists($conffile)) +{ + $conffile = "/etc/dolibarr/conf.php"; + $conffiletoshow = "/etc/dolibarr/conf.php"; +} // Load conf file if it is already defined @@ -208,7 +211,7 @@ function pHeader($soutitre,$next,$action='none') // On force contenu dans format sortie header("Content-type: text/html; charset=".$conf->file->character_set_client); header("X-Content-Type-Options: nosniff"); - + print ''."\n"; print ''."\n"; print ''."\n"; From a4b155fc91eb3fdca514cd8592ebb2a375c7726f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 16 Feb 2018 20:42:40 +0100 Subject: [PATCH 4/8] Fix typo and --- htdocs/langs/en_US/admin.lang | 14 +++++++------- htdocs/langs/en_US/errors.lang | 2 +- htdocs/langs/en_US/main.lang | 4 ++-- htdocs/langs/en_US/trips.lang | 2 +- htdocs/langs/en_US/users.lang | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f5daf6c8d27..2daa092c5db 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -341,7 +341,7 @@ ErrorCantUseRazIfNoYearInMask=Error, can't use option @ to reset counter each ye ErrorCantUseRazInStartedYearIfNoYearMonthInMask=Error, can't use option @ if sequence {yy}{mm} or {yyyy}{mm} is not in mask. UMask=UMask parameter for new files on Unix/Linux/BSD/Mac file system. UMaskExplanation=This parameter allow you to define permissions set by default on files created by Dolibarr on server (during upload for example).
It must be the octal value (for example, 0666 means read and write for everyone).
This parameter is useless on a Windows server. -SeeWikiForAllTeam=Take a look at the wiki page for full list of all actors and their organisation +SeeWikiForAllTeam=Take a look at the wiki page for full list of all actors and their organization UseACacheDelay= Delay for caching export response in seconds (0 or empty for no cache) DisableLinkToHelpCenter=Hide link "Need help or support" on login page DisableLinkToHelp=Hide link to online help "%s" @@ -910,8 +910,8 @@ TypeOfRevenueStamp=Type of revenue stamp VATManagement=VAT Management VATIsUsedDesc=By default when creating prospects, invoices, orders etc the VAT rate follows the active standard rule:
If the seller is not subjected to VAT, then VAT defaults to 0. End of rule.
If the (selling country= buying country), then the VAT by default equals the VAT of the product in the selling country. End of rule.
If seller and buyer are both in the European Community and goods are transport products (car, ship, plane), the default VAT is 0 ( The VAT should be paid by the buyer to the customoffice of his country and not to the seller). End of rule.
If seller and buyer are both in the European Community and the buyer is not a company, then the VAT by defaults to the VAT of the product sold. End of rule.
If seller and buyer are both in the European Community and the buyer is a company, then the VAT is 0 by default . End of rule.
In any othe case the proposed default is VAT=0. End of rule. VATIsNotUsedDesc=By default the proposed VAT is 0 which can be used for cases like associations, individuals ou small companies. -VATIsUsedExampleFR=In France, it means companies or organisations having a real fiscal system (Simplified real or normal real). A system in which VAT is declared. -VATIsNotUsedExampleFR=In France, it means associations that are non VAT declared or companies, organisations or liberal professions that have chosen the micro enterprise fiscal system (VAT in franchise) and paid a franchise VAT without any VAT declaration. This choice will display the reference "Non applicable VAT - art-293B of CGI" on invoices. +VATIsUsedExampleFR=In France, it means companies or organizations having a real fiscal system (Simplified real or normal real). A system in which VAT is declared. +VATIsNotUsedExampleFR=In France, it means associations that are non VAT declared or companies, organizations or liberal professions that have chosen the micro enterprise fiscal system (VAT in franchise) and paid a franchise VAT without any VAT declaration. This choice will display the reference "Non applicable VAT - art-293B of CGI" on invoices. ##### Local Taxes ##### LTRate=Rate LocalTax1IsNotUsed=Do not use second tax @@ -976,7 +976,7 @@ Host=Server DriverType=Driver type SummarySystem=System information summary SummaryConst=List of all Dolibarr setup parameters -MenuCompanySetup=Company/Organisation +MenuCompanySetup=Company/Organization DefaultMenuManager= Standard menu manager DefaultMenuSmartphoneManager=Smartphone menu manager Skin=Skin theme @@ -992,8 +992,8 @@ PermanentLeftSearchForm=Permanent search form on left menu DefaultLanguage=Default language to use (language code) EnableMultilangInterface=Enable multilingual interface EnableShowLogo=Show logo on left menu -CompanyInfo=Company/organisation information -CompanyIds=Company/organisation identities +CompanyInfo=Company/organization information +CompanyIds=Company/organization identities CompanyName=Name CompanyAddress=Address CompanyZip=Zip @@ -1549,7 +1549,7 @@ SupposedToBeInvoiceDate=Invoice date used Buy=Buy Sell=Sell InvoiceDateUsed=Invoice date used -YourCompanyDoesNotUseVAT=Your company has been defined to not use VAT (Home - Setup - Company/Organisation), so there is no VAT options to setup. +YourCompanyDoesNotUseVAT=Your company has been defined to not use VAT (Home - Setup - Company/Organization), so there is no VAT options to setup. AccountancyCode=Accounting Code AccountancyCodeSell=Sale account. code AccountancyCodeBuy=Purchase account. code diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 4ed104af7df..f87a30ecfb2 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -127,7 +127,7 @@ ErrorFailedToAddToMailmanList=Failed to add record %s to Mailman list %s or SPIP ErrorFailedToRemoveToMailmanList=Failed to remove record %s to Mailman list %s or SPIP base ErrorNewValueCantMatchOldValue=New value can't be equal to old one ErrorFailedToValidatePasswordReset=Failed to reinit password. May be the reinit was already done (this link can be used only one time). If not, try to restart the reinit process. -ErrorToConnectToMysqlCheckInstance=Connect to database fails. Check Mysql server is running (in most cases, you can launch it from command line with 'sudo /etc/init.d/mysql start'). +ErrorToConnectToMysqlCheckInstance=Connect to database fails. Check database server is running (for example, with mysql/mariadb, you can launch it from command line with 'sudo service mysql start'). ErrorFailedToAddContact=Failed to add contact ErrorDateMustBeBeforeToday=The date cannot be greater than today ErrorPaymentModeDefinedToWithoutSetup=A payment mode was set to type %s but setup of module Invoice was not completed to define information to show for this payment mode. diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 933412e8688..cde8a485e59 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -44,7 +44,7 @@ ErrorConstantNotDefined=Parameter %s not defined ErrorUnknown=Unknown error ErrorSQL=SQL Error ErrorLogoFileNotFound=Logo file '%s' was not found -ErrorGoToGlobalSetup=Go to 'Company/Organisation' setup to fix this +ErrorGoToGlobalSetup=Go to 'Company/Organization' setup to fix this ErrorGoToModuleSetup=Go to Module setup to fix this ErrorFailedToSendMail=Failed to send mail (sender=%s, receiver=%s) ErrorFileNotUploaded=File was not uploaded. Check that size does not exceed maximum allowed, that free space is available on disk and that there is not already a file with same name in this directory. @@ -421,7 +421,7 @@ ActionRunningShort=In progress ActionDoneShort=Finished ActionUncomplete=Uncomplete LatestLinkedEvents=Latest %s linked events -CompanyFoundation=Company/Organisation +CompanyFoundation=Company/Organization ContactsForCompany=Contacts for this third party ContactsAddressesForCompany=Contacts/addresses for this third party AddressesForCompany=Addresses for this third party diff --git a/htdocs/langs/en_US/trips.lang b/htdocs/langs/en_US/trips.lang index a5ab097aa0e..2b254bf91e7 100644 --- a/htdocs/langs/en_US/trips.lang +++ b/htdocs/langs/en_US/trips.lang @@ -12,7 +12,7 @@ ShowTrip=Show expense report NewTrip=New expense report LastExpenseReports=Latest %s expense reports AllExpenseReports=All expense reports -CompanyVisited=Company/organisation visited +CompanyVisited=Company/organization visited FeesKilometersOrAmout=Amount or kilometers DeleteTrip=Delete expense report ConfirmDeleteTrip=Are you sure you want to delete this expense report? diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang index 3c1a8644bf0..b34be6b4421 100644 --- a/htdocs/langs/en_US/users.lang +++ b/htdocs/langs/en_US/users.lang @@ -67,8 +67,8 @@ InternalUser=Internal user ExportDataset_user_1=Dolibarr's users and properties DomainUser=Domain user %s Reactivate=Reactivate -CreateInternalUserDesc=This form allows you to create an user internal to your company/organisation. To create an external user (customer, supplier, ...), use the button 'Create Dolibarr user' from third party's contact card. -InternalExternalDesc=An internal user is a user that is part of your company/organisation.
An external user is a customer, supplier or other.

In both cases, permissions defines rights on Dolibarr, also external user can have a different menu manager than internal user (See Home - Setup - Display) +CreateInternalUserDesc=This form allows you to create an user internal to your company/organization. To create an external user (customer, supplier, ...), use the button 'Create Dolibarr user' from third party's contact card. +InternalExternalDesc=An internal user is a user that is part of your company/organization.
An external user is a customer, supplier or other.

In both cases, permissions defines rights on Dolibarr, also external user can have a different menu manager than internal user (See Home - Setup - Display) PermissionInheritedFromAGroup=Permission granted because inherited from one of a user's group. Inherited=Inherited UserWillBeInternalUser=Created user will be an internal user (because not linked to a particular third party) From b3e567c31055c0e913faecade2f6d48d2b59b549 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 16 Feb 2018 20:47:28 +0100 Subject: [PATCH 5/8] Fix rpm package for apache 2.4, selinux and php packages --- build/makepack-dolibarr.pl | 4 +-- build/rpm/dolibarr-forrpm.patch | 2 +- build/rpm/dolibarr_fedora.spec | 3 +-- build/rpm/dolibarr_generic.spec | 11 ++++---- build/rpm/dolibarr_mandriva.spec | 1 - build/rpm/dolibarr_opensuse.spec | 1 - build/rpm/httpd-dolibarr.conf | 44 +++++++++++++++++++++++++++----- 7 files changed, 46 insertions(+), 20 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index aa73d4abf65..839a8092a7c 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -767,8 +767,8 @@ if ($nboftargetok) { $cmd="cp -pr '$BUILDROOT/$PROJECT' '$BUILDROOT/$FILENAMETGZ2'"; $ret=`$cmd`; - # Removed files we don't need - $ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/htdocs/includes/ckeditor/_source`; + # Removed files we don't need (already removed before) + #$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/htdocs/includes/ckeditor/_source`; print "Set permissions on files/dir\n"; $ret=`chmod -R 755 $BUILDROOT/$FILENAMETGZ2`; diff --git a/build/rpm/dolibarr-forrpm.patch b/build/rpm/dolibarr-forrpm.patch index ae9cf5cb2de..5ea52664b98 100644 --- a/build/rpm/dolibarr-forrpm.patch +++ b/build/rpm/dolibarr-forrpm.patch @@ -1,7 +1,7 @@ diff -up htdocs/install/inc.php.patch htdocs/install/inc.php --- htdocs/install/inc.php.patch 2011-09-03 02:33:26.450952000 +0200 +++ htdocs/install/inc.php 2011-09-03 02:33:36.286952001 +0200 -@@ -71,8 +71,8 @@ +@@ -74,8 +74,8 @@ $conffile = "../conf/conf.php"; $conffiletoshow = "htdocs/conf/conf.php"; // For debian/redhat like systems diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 077aaeb9483..db3ca84ec03 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -25,7 +25,7 @@ BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build Group: Applications/Productivity -Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mysql, php-adodb, php-nusoap, dejavu-sans-fonts +Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mysqli, php-adodb, php-nusoap, dejavu-sans-fonts Requires: mysql-server, mysql #BuildRequires: desktop-file-utils @@ -215,7 +215,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/*.ico -%_datadir/dolibarr/htdocs/*.patch %_datadir/dolibarr/htdocs/*.php %_datadir/dolibarr/htdocs/*.txt diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 5b39bac7761..efffb54d092 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -46,7 +46,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} Group: Applications/Productivity -Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mysql, php-adodb, php-nusoap, dejavu-sans-fonts +Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mysqli, php-adodb, php-nusoap, dejavu-sans-fonts, php-mbstring, php-xml Requires: mysql-server, mysql BuildRequires: desktop-file-utils %else @@ -63,9 +63,9 @@ Requires: mysql-community-server, mysql-community-server-client BuildRequires: update-desktop-files fdupes %else Group: Applications/Productivity -Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap +Requires: httpd, php >= 5.3.0, php-cli, php-gd, php-ldap, php-imap, php-mbstring, php-xml Requires: mysql-server, mysql -Requires: php-mysql >= 4.1.0 +Requires: php-mysqli >= 4.1.0 %endif %endif %endif @@ -295,7 +295,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/*.ico -%_datadir/dolibarr/htdocs/*.patch %_datadir/dolibarr/htdocs/*.php %_datadir/dolibarr/htdocs/*.txt @@ -441,8 +440,8 @@ if [ "x$os" = "xfedora-redhat" -a -s /sbin/restorecon ]; then %else echo Add SE Linux permissions for dolibarr # semanage add records into /etc/selinux/targeted/contexts/files/file_contexts.local - semanage fcontext -a -t httpd_sys_script_rw_t "/etc/dolibarr(/.*?)" - semanage fcontext -a -t httpd_sys_script_rw_t "/var/lib/dolibarr(/.*?)" + semanage fcontext -a -t httpd_sys_rw_content_t "/etc/dolibarr(/.*)?" + semanage fcontext -a -t httpd_sys_rw_content_t "/var/lib/dolibarr(/.*)?" restorecon -R -v /etc/dolibarr restorecon -R -v /var/lib/dolibarr %endif diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index 1034615c80a..438f2bd096d 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -212,7 +212,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/*.ico -%_datadir/dolibarr/htdocs/*.patch %_datadir/dolibarr/htdocs/*.php %_datadir/dolibarr/htdocs/*.txt diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index eb1887f229f..aa3844073a7 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -223,7 +223,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/*.ico -%_datadir/dolibarr/htdocs/*.patch %_datadir/dolibarr/htdocs/*.php %_datadir/dolibarr/htdocs/*.txt diff --git a/build/rpm/httpd-dolibarr.conf b/build/rpm/httpd-dolibarr.conf index 5e778e15b38..1126d4fe442 100644 --- a/build/rpm/httpd-dolibarr.conf +++ b/build/rpm/httpd-dolibarr.conf @@ -15,8 +15,14 @@ Alias /dolibarr /usr/share/dolibarr/htdocs # Directory for web pages - Order deny,allow - Allow from all + = 2.3> + Require all granted + + + Order deny,allow + Allow from all + + DirectoryIndex index.php Options +FollowSymLinks +Indexes @@ -60,27 +66,51 @@ Alias /dolibarr /usr/share/dolibarr/htdocs # Directory for public pages - AllowOverride All + = 2.3> + Require all granted + + Order deny,allow Allow from all + + + AllowOverride All # Config files - AllowOverride All + = 2.3> + Require all granted + + Order deny,allow Allow from all + + + AllowOverride All # Directory for data files - AllowOverride All + = 2.3> + Require all granted + + Order deny,allow Allow from all + + + AllowOverride All - AllowOverride All - Order deny,allow + = 2.3> + Require all granted + + + Order allow,deny Allow from all + + + AllowOverride All From 9bed2ce8e2a25918a9ea0c5a8463e02153eb7f88 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 16 Feb 2018 22:00:34 +0100 Subject: [PATCH 6/8] Fix ignore file integrity check on filefunc.inc.php for deb/rpm package --- .../patches/use-etc-dolibarr-conf.patch | 13 +++++++++++ build/rpm/dolibarr-forrpm.patch | 14 ++++++++++++ build/rpm/dolibarr_fedora.spec | 1 + build/rpm/dolibarr_generic.spec | 1 + build/rpm/dolibarr_mandriva.spec | 1 + build/rpm/dolibarr_opensuse.spec | 1 + htdocs/admin/system/dolibarr.php | 2 +- htdocs/core/lib/files.lib.php | 22 +++++++++++++++---- htdocs/filefunc.inc.php | 22 ++++--------------- 9 files changed, 54 insertions(+), 23 deletions(-) diff --git a/build/debian/patches/use-etc-dolibarr-conf.patch b/build/debian/patches/use-etc-dolibarr-conf.patch index 04543e5fac6..07346ad4e63 100644 --- a/build/debian/patches/use-etc-dolibarr-conf.patch +++ b/build/debian/patches/use-etc-dolibarr-conf.patch @@ -9,6 +9,19 @@ Forwarded: not-needed Last-Update: 2013-07-29 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/htdocs/filefunc.inc.php ++++ b/htdocs/filefunc.inc.php +@@ -63,8 +63,8 @@ $conffiletoshowshort = "conf.php"; + $conffile = "conf/conf.php"; + $conffiletoshow = "htdocs/conf/conf.php"; + // For debian/redhat like systems +-//$conffile = "/etc/dolibarr/conf.php"; +-//$conffiletoshow = "/etc/dolibarr/conf.php"; ++$conffile = "/etc/dolibarr/conf.php"; ++$conffiletoshow = "/etc/dolibarr/conf.php"; + + + // Include configuration --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -73,8 +73,8 @@ $conffiletoshowshort = "conf.php"; diff --git a/build/rpm/dolibarr-forrpm.patch b/build/rpm/dolibarr-forrpm.patch index 5ea52664b98..5413702efa3 100644 --- a/build/rpm/dolibarr-forrpm.patch +++ b/build/rpm/dolibarr-forrpm.patch @@ -1,3 +1,17 @@ +diff -up htdocs/filefunc.inc.php.patch htdocs/filefunc.inc.php +--- htdocs/filefunc.inc.php.patch 2011-09-03 02:32:48.666952000 +0200 ++++ htdocs/filefunc.inc.php 2011-09-03 02:33:00.510952001 +0200 +@@ -63,8 +63,8 @@ + $conffile = "conf/conf.php"; + $conffiletoshow = "htdocs/conf/conf.php"; + // For debian/redhat like systems +-//$conffile = "/etc/dolibarr/conf.php"; +-//$conffiletoshow = "/etc/dolibarr/conf.php"; ++$conffile = "/etc/dolibarr/conf.php"; ++$conffiletoshow = "/etc/dolibarr/conf.php"; + + + // Include configuration diff -up htdocs/install/inc.php.patch htdocs/install/inc.php --- htdocs/install/inc.php.patch 2011-09-03 02:33:26.450952000 +0200 +++ htdocs/install/inc.php 2011-09-03 02:33:36.286952001 +0200 diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index db3ca84ec03..6df6ccf052e 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -215,6 +215,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/*.ico +%_datadir/dolibarr/htdocs/*.patch %_datadir/dolibarr/htdocs/*.php %_datadir/dolibarr/htdocs/*.txt diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index efffb54d092..f99836b7f74 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -295,6 +295,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/*.ico +%_datadir/dolibarr/htdocs/*.patch %_datadir/dolibarr/htdocs/*.php %_datadir/dolibarr/htdocs/*.txt diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index 438f2bd096d..1034615c80a 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -212,6 +212,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/*.ico +%_datadir/dolibarr/htdocs/*.patch %_datadir/dolibarr/htdocs/*.php %_datadir/dolibarr/htdocs/*.txt diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index aa3844073a7..eb1887f229f 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -223,6 +223,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/webservices %_datadir/dolibarr/htdocs/website %_datadir/dolibarr/htdocs/*.ico +%_datadir/dolibarr/htdocs/*.patch %_datadir/dolibarr/htdocs/*.php %_datadir/dolibarr/htdocs/*.txt diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 8c4711f98c0..c36db521f70 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -49,7 +49,7 @@ $version='0.0'; if ($action == 'getlastversion') { - $result = getURLContent('http://sourceforge.net/projects/dolibarr/rss'); + $result = getURLContent('https://sourceforge.net/projects/dolibarr/rss'); //var_dump($result['content']); $sfurl = simplexml_load_string($result['content']); } diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 206d1bb8099..f62fb14c68b 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2777,28 +2777,42 @@ function dol_readcachefile($directory, $filename) */ function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '', $pathref = '', &$checksumconcat = array()) { + global $conffile; + $exclude = 'install'; foreach ($dir->md5file as $file) // $file is a simpleXMLElement { $filename = $path.$file['name']; $file_list['insignature'][] = $filename; + $expectedmd5 = (string) $file; //if (preg_match('#'.$exclude.'#', $filename)) continue; if (!file_exists($pathref.'/'.$filename)) { - $file_list['missing'][] = array('filename'=>$filename, 'expectedmd5'=>(string) $file); + $file_list['missing'][] = array('filename'=>$filename, 'expectedmd5'=>$expectedmd5); } else { $md5_local = md5_file($pathref.'/'.$filename); - if ($md5_local != (string) $file) $file_list['updated'][] = array('filename'=>$filename, 'expectedmd5'=>(string) $file, 'md5'=>(string) $md5_local); - $checksumconcat[] = $md5_local; + + if ($conffile == '/etc/dolibarr/conf.php' && $filename == '/filefunc.inc.php') // For install with deb or rpm, we ignore test on filefunc.inc.php that was modified by package + { + $checksumconcat[] = $expectedmd5; + } + else + { + if ($md5_local != $expectedmd5) $file_list['updated'][] = array('filename'=>$filename, 'expectedmd5'=>$expectedmd5, 'md5'=>(string) $md5_local); + $checksumconcat[] = $md5_local; + } } } - foreach ($dir->dir as $subdir) getFilesUpdated($file_list, $subdir, $path.$subdir['name'].'/', $pathref, $checksumconcat); + foreach ($dir->dir as $subdir) // $subdir['name'] is '' or '/accountancy/admin' for example + { + getFilesUpdated($file_list, $subdir, $path.$subdir['name'].'/', $pathref, $checksumconcat); + } return $file_list; } diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index f0f35ada857..3e9fffae38b 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -62,30 +62,16 @@ $conffiletoshowshort = "conf.php"; $conffile = "conf/conf.php"; $conffiletoshow = "htdocs/conf/conf.php"; // For debian/redhat like systems -if (! file_exists($conffile)) -{ - $conffile = "/etc/dolibarr/conf.php"; - $conffiletoshow = "/etc/dolibarr/conf.php"; -} +//$conffile = "/etc/dolibarr/conf.php"; +//$conffiletoshow = "/etc/dolibarr/conf.php"; + // Include configuration // --- End of part replaced by Dolibarr packager makepack-dolibarr -// Replace conf filename with "conf" parameter on url by GET -/* Disabled. This is a serious security hole -if (! empty($_GET['conf'])) -{ - $confname=basename($_GET['conf']); - setcookie('dolconf', $confname, 0, '/'); - $conffile = 'conf/'.$confname.'.php'; -} else { - $confname=basename(empty($_COOKIE['dolconf']) ? 'conf' : $_COOKIE['dolconf']); - $conffile = 'conf/'.$confname.'.php'; -} -*/ // Include configuration -$result=@include_once $conffile; // Keep @ because with some error reporting this break the redirect +$result=@include_once $conffile; // Keep @ because with some error reporting this break the redirect done when file not found if (! $result && ! empty($_SERVER["GATEWAY_INTERFACE"])) // If install not done and we are in a web session { From 5c5d2cbefab36d744bc125c98011d88ea06adb0b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 16 Feb 2018 23:49:08 +0100 Subject: [PATCH 7/8] Fix smtp warning message --- htdocs/admin/mails.php | 15 ++++++++++++--- htdocs/langs/en_US/admin.lang | 3 ++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index d482322a054..f6868eb7348 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -689,10 +689,19 @@ else print ''; - if ($conf->global->MAIN_MAIL_SENDMODE == 'mail' && ! in_array($action, array('testconnect', 'test', 'testhtml'))) + if (! in_array($action, array('testconnect', 'test', 'testhtml'))) { - $text = $langs->trans("WarningPHPMail"); - print info_admin($text); + $text = ''; + if ($conf->global->MAIN_MAIL_SENDMODE == 'mail') + { + $text.= $langs->trans("WarningPHPMail"); + } + //$conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS='1.2.3.4'; + if (! empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS)) + { + $text.= ($text?'
':'').$langs->trans("WarningPHPMail2", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS); + } + if ($text) print info_admin($text); } // Run the test to connect diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 2daa092c5db..30df45facd2 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -448,7 +448,8 @@ ModuleCompanyCodePanicum=Return an empty accounting code. ModuleCompanyCodeDigitaria=Accounting code depends on third party code. The code is composed of the character "C" in the first position followed by the first 5 characters of the third party code. Use3StepsApproval=By default, Purchase Orders need to be created and approved by 2 different users (one step/user to create and one step/user to approve. Note that if user has both permission to create and approve, one step/user will be enough). You can ask with this option to introduce a third step/user approval, if amount is higher than a dedicated value (so 3 steps will be necessary: 1=validation, 2=first approval and 3=second approval if amount is enough).
Set this to empty if one approval (2 steps) is enough, set it to a very low value (0.1) if a second approval (3 steps) is always required. UseDoubleApproval=Use a 3 steps approval when amount (without tax) is higher than... -WarningPHPMail=WARNING: Some email providers (like Yahoo) does not allow you to send an email from another server than the Yahoo server if the email address used as a sender is your Yahoo email (like myemail@yahoo.com, myemail@yahoo.fr, ...). Your current setup use the server of the application to send email, so some recipients (the one compatible with the restrictive DMARC protocol), will ask Yahoo if they can accept your email and Yahoo will respond "no" because the server is not a server owned by Yahoo, so few of your sent Emails may not be accepted.
If your Email provider (like Yahoo) has this restriction, you must change Email setup to choose the other method "SMTP server" and enter the SMTP server and credentials provided by your Email provider (ask your EMail provider to get SMTP credentials for your account). +WarningPHPMail=WARNING: It is often better to setup outgoing email to use the email server of your provider than the default setup. Some email providers (like Yahoo) does not allow you to send an email from another server than their own server. Your current setup use the server of the application to send email and not the server of your email provider, so some recipients (the one compatible with the restrictive DMARC protocol), will ask your email provider if they can accept your email and some email providers (like Yahoo) may respond "no" because the server is not a server of them, so few of your sent Emails may not be accepted.
If your Email provider (like Yahoo) has this restriction, you must change Email setup to choose the other method "SMTP server" and enter the SMTP server and credentials provided by your Email provider (ask your EMail provider to get SMTP credentials for your account). +WarningPHPMail2=If your email SMTP provider need to restrict email client to some IP addresses (very rare), this is the IP address of your ERP CRM application: %s. ClickToShowDescription=Click to show description DependsOn=This module need the module(s) RequiredBy=This module is required by module(s) From 46c941c823735364e05b8d0ff5cd13f8d0dd7240 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 16 Feb 2018 23:57:35 +0100 Subject: [PATCH 8/8] Translation --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 30df45facd2..efb9839ade2 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -448,7 +448,7 @@ ModuleCompanyCodePanicum=Return an empty accounting code. ModuleCompanyCodeDigitaria=Accounting code depends on third party code. The code is composed of the character "C" in the first position followed by the first 5 characters of the third party code. Use3StepsApproval=By default, Purchase Orders need to be created and approved by 2 different users (one step/user to create and one step/user to approve. Note that if user has both permission to create and approve, one step/user will be enough). You can ask with this option to introduce a third step/user approval, if amount is higher than a dedicated value (so 3 steps will be necessary: 1=validation, 2=first approval and 3=second approval if amount is enough).
Set this to empty if one approval (2 steps) is enough, set it to a very low value (0.1) if a second approval (3 steps) is always required. UseDoubleApproval=Use a 3 steps approval when amount (without tax) is higher than... -WarningPHPMail=WARNING: It is often better to setup outgoing email to use the email server of your provider than the default setup. Some email providers (like Yahoo) does not allow you to send an email from another server than their own server. Your current setup use the server of the application to send email and not the server of your email provider, so some recipients (the one compatible with the restrictive DMARC protocol), will ask your email provider if they can accept your email and some email providers (like Yahoo) may respond "no" because the server is not a server of them, so few of your sent Emails may not be accepted.
If your Email provider (like Yahoo) has this restriction, you must change Email setup to choose the other method "SMTP server" and enter the SMTP server and credentials provided by your Email provider (ask your EMail provider to get SMTP credentials for your account). +WarningPHPMail=WARNING: It is often better to setup outgoing emails to use the email server of your provider instead of the default setup. Some email providers (like Yahoo) does not allow you to send an email from another server than their own server. Your current setup use the server of the application to send email and not the server of your email provider, so some recipients (the one compatible with the restrictive DMARC protocol), will ask your email provider if they can accept your email and some email providers (like Yahoo) may respond "no" because the server is not a server of them, so few of your sent Emails may not be accepted (be car also to your email provider sending quota).
If your Email provider (like Yahoo) has this restriction, you must change Email setup to choose the other method "SMTP server" and enter the SMTP server and credentials provided by your Email provider (ask your EMail provider to get SMTP credentials for your account). WarningPHPMail2=If your email SMTP provider need to restrict email client to some IP addresses (very rare), this is the IP address of your ERP CRM application: %s. ClickToShowDescription=Click to show description DependsOn=This module need the module(s)