Преглед изворни кода

Add notice in security to show if installmodules.lock exists.

Laurent Destailleur пре 2 година
родитељ
комит
72750c3b8d
2 измењених фајлова са 32 додато и 1 уклоњено
  1. 28 1
      htdocs/admin/system/security.php
  2. 4 0
      htdocs/langs/en_US/admin.lang

+ 28 - 1
htdocs/admin/system/security.php

@@ -241,14 +241,41 @@ print '<br>';
 print '<br>';
 
 $installlock = DOL_DATA_ROOT.'/install.lock';
+$upgradeunlock = DOL_DATA_ROOT.'/upgrade.unlock';
+$installmoduleslock = DOL_DATA_ROOT.'/installmodules.lock';
+
+// Is install (upgrade) locked
 print '<strong>'.$langs->trans("DolibarrSetup").'</strong>: ';
 if (file_exists($installlock)) {
-	print img_picto('', 'tick').' '.$langs->trans("InstallAndUpgradeLockedBy", $installlock);
+	if (file_exists($upgradeunlock)) {
+		print img_picto('', 'tick').' '.$langs->trans("InstallLockedBy", $installlock);
+	} else {
+		print img_picto('', 'tick').' '.$langs->trans("InstallAndUpgradeLockedBy", $installlock);
+	}
 } else {
 	print img_warning().' '.$langs->trans("WarningLockFileDoesNotExists", DOL_DATA_ROOT);
 }
 print '<br>';
 
+// Is upgrade unlocked
+if (file_exists($installlock)) {	// If install not locked, no need to show this.
+	if (file_exists($upgradeunlock)) {
+		print '<strong>'.$langs->trans("DolibarrUpgrade").'</strong>: ';
+		print img_warning().' '.$langs->trans("UpgradeHasBeenUnlocked", $upgradeunlock);
+		print '<br>';
+	}
+}
+
+// Is addon install locked ?
+print '<strong>'.$langs->trans("DolibarrAddonInstall").'</strong>: ';
+if (file_exists($installmoduleslock)) {
+	print img_picto('', 'tick').' '.$langs->trans("InstallAndUpgradeLockedBy", $installmoduleslock);
+} else {
+	print $langs->trans("InstallOfAddonIsNotBlocked", DOL_DATA_ROOT);
+}
+print '<br>';
+
+
 
 // File conf.php
 

+ 4 - 0
htdocs/langs/en_US/admin.lang

@@ -51,6 +51,8 @@ ClientSortingCharset=Client collation
 WarningModuleNotActive=Module <b>%s</b> must be enabled
 WarningOnlyPermissionOfActivatedModules=Only permissions related to activated modules are shown here. You can activate other modules in the Home->Setup->Modules page.
 DolibarrSetup=Dolibarr install or upgrade
+DolibarrUpgrade=Dolibarr upgrade
+DolibarrAddonInstall=Installation of Addon/External modules (uploaded or generated)
 InternalUsers=Internal users
 ExternalUsers=External users
 UserInterface=User interface
@@ -2264,6 +2266,8 @@ DatabasePasswordNotObfuscated=Database password is NOT obfuscated in conf file
 APIsAreNotEnabled=APIs modules are not enabled
 YouShouldSetThisToOff=You should set this to 0 or off
 InstallAndUpgradeLockedBy=Install and upgrades are locked by the file <b>%s</b>
+InstallLockedBy=Install/Reinstall is locked by the file <b>%s</b>
+InstallOfAddonIsNotBlocked=Installations of addons are not locked. Create a file <b>installmodules.lock</b> into directory <b>%s</b> to block installations of external addons/modules.
 OldImplementation=Old implementation
 PDF_SHOW_LINK_TO_ONLINE_PAYMENT=If some online payment modules are enabled (Paypal, Stripe, ...), add a link on the PDF to make the online payment
 DashboardDisableGlobal=Disable globally all the thumbs of open objects