Browse Source

Email test: added a check for linux (sendmail_path)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@271 a333f486-631f-4898-b8df-5754b55c2be0
romainq 15 năm trước cách đây
mục cha
commit
78e7053599
1 tập tin đã thay đổi với 11 bổ sung1 xóa
  1. 11 1
      setup/email.test.php

+ 11 - 1
setup/email.test.php

@@ -26,7 +26,7 @@ function CheckEmailSetting($oP)
 		$sPhpIniFile = 'php.ini';
 	}
 
-	$bIsWindows = (array_key_exists('WINDIR', $_SERVER)); 
+	$bIsWindows = (array_key_exists('WINDIR', $_SERVER));
 	if ($bIsWindows)
 	{	
 		$sSmtpServer = ini_get('SMTP');
@@ -62,6 +62,16 @@ function CheckEmailSetting($oP)
 	else
 	{
 		// Not a windows system
+		$sSendMail = ini_get('sendmail_path');
+		if (empty($sSendMail))
+		{
+			$oP->error("The command to send mail is not defined. Please add the 'sendmail_path' directive into $sPhpIniFile. A recommended setting is <em>sendmail_path=sendmail -t -i</em>");
+			$bRet = false;
+		}
+		else
+		{
+			$oP->info("The command to send mail: <strong>$sSendMail</strong>. To change this value, modify the 'sendmail_path' directive into $sPhpIniFile");
+		}
 	}
 	if ($bRet)
 	{