浏览代码

Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0

Conflicts:
	htdocs/langs/en_US/errors.lang
Laurent Destailleur 8 年之前
父节点
当前提交
ae740b7c1b
共有 2 个文件被更改,包括 11 次插入3 次删除
  1. 9 3
      htdocs/admin/tools/update.php
  2. 2 0
      htdocs/langs/en_US/errors.lang

+ 9 - 3
htdocs/admin/tools/update.php

@@ -69,12 +69,18 @@ if ($action=='install')
 	}
 	else
 	{
-		if (! preg_match('/\.zip/i',$original_file))
+		if (! preg_match('/\.zip$/i',$original_file))
 		{
 			$langs->load("errors");
 			setEventMessages($langs->trans("ErrorFileMustBeADolibarrPackage",$original_file), null, 'errors');
 			$error++;
 		}
+		if (! preg_match('/module_.*\-[\d]+\.[\d]+.*$/i',$original_file))
+		{
+			$langs->load("errors");
+			setEventMessages($langs->trans("ErrorFilenameDosNotMatchDolibarrPackageRules",$original_file, 'module_*-x.y*.zip'), null, 'errors');
+			$error++;
+		}
 	}
 
 	if (! $error)
@@ -117,7 +123,7 @@ if ($action=='install')
 					//var_dump($modulenamedir);
 					if (! dol_is_dir($modulenamedir))
 					{
-						setEventMessages($langs->trans("ErrorModuleFileSeemsToHaveAWrongFormat"), null, 'errors');
+						setEventMessages($langs->trans("ErrorModuleFileSeemsToHaveAWrongFormat").'<br>Dir not found: '.$conf->admin->dir_temp.'/'.$tmpdir.'/'.$modulename.'<br>'.$conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulename, null, 'errors');
 						$error++;
 					}
 				}
@@ -168,7 +174,7 @@ print load_fiche_titre($langs->trans("Upgrade"),'','title_setup');
 
 print $langs->trans("CurrentVersion").' : <b>'.DOL_VERSION.'</b><br>';
 
-if (function_exists('curl_init'))
+if (!function_exists('curl_init'))
 {
     $conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
     

+ 2 - 0
htdocs/langs/en_US/errors.lang

@@ -181,6 +181,8 @@ ErrorBankStatementNameMustFollowRegex=Error, bank statement name must follow the
 ErrorPhpMailDelivery=Check that you don't use a too high number of recipients and that your email content is not similar to a Spam. Ask also your administrator to check firewall and server logs files for a more complete information.
 ErrorUserNotAssignedToTask=User must be assigned to task to be able to enter time consumed.
 ErrorTaskAlreadyAssigned=Task already assigned to user
+ErrorModuleFileSeemsToHaveAWrongFormat=The module package seems to have a wrong format.
+ErrorFilenameDosNotMatchDolibarrPackageRules=The name of the module package (<strong>%s</strong>) does not match expected name syntax: <strong>%s</strong>
 
 # Warnings
 WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user.