[evolvis-commits] r14070: Tracker gateway: No reply if no pattern found in mail

mirabilos at evolvis.org mirabilos at evolvis.org
Mon Feb 28 03:48:17 CET 2011


Author: mirabilos
Date: 2011-02-28 03:48:17 +0100 (Mon, 28 Feb 2011)
New Revision: 14070

Modified:
   trunk/gforge_base/evolvisforge-5.1/gforge/cronjobs/tracker_gateway.php
Log:
Tracker gateway: No reply if no pattern found in mail

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/cronjobs/tracker_gateway.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/cronjobs/tracker_gateway.php	2011-02-28 02:48:14 UTC (rev 14069)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/cronjobs/tracker_gateway.php	2011-02-28 02:48:17 UTC (rev 14070)
@@ -135,6 +135,7 @@
 			$artifactid_end=(strpos($subj,'['.$arr[2].']')) + strlen('['.$arr[2].']');
 			$this->Subject = addslashes(substr($subj,$artifactid_end));
 		} else {
+			$this->FromEmail = ''; // Do not reply if no pattern found.
 			$this->Subject = addslashes($subj);
 			$this->ArtifactId=0; // Not supported at the moment
 			$this->setError("ArtifactId needed at the moment. Artifact creation not supported");
@@ -145,10 +146,10 @@
 		// find first occurrence of the marker in the message
 		$begin = strpos($body, ARTIFACT_MAIL_MARKER);
 		if ($begin === false) {
-			$this->setError("Response message wasn't found in your mail. Please verify that 
-you entered your message between the correct text markers.
-\nYour message was:
-\n".$mp->getBody());
+			$this->setError("Response message wasn't found in your mail. Please verify that ".
+							"you entered your message between the correct text markers.".
+							"\nYour message was:".
+							"\n".$mp->getBody());
 			return false;
 		}
 		// get the part of the message located after the marker
@@ -156,10 +157,10 @@
 		// now look for the ending marker
 		$end = strpos($body, ARTIFACT_MAIL_MARKER);
 		if ($end === false) {
-			$this->setError("Response message wasn't found in your mail. Please verify that 
-you entered your message between the correct text markers.
-\nYour message was:
-\n".$mp->getBody());
+			$this->setError("Response message wasn't found in your mail. Please verify that ".
+							"you entered your message between the correct text markers.".
+							"\nYour message was:".
+							"\n".$mp->getBody());
 			return false;
 		}
 		$message = substr($body, 0, $end);
@@ -278,6 +279,8 @@
 $debug = 0;
 $myTrackerGateway = new TrackerGateway();
 if ($myTrackerGateway->isError()) {
+	DBG ("From: ". $myTrackerGateway->FromEmail);
+	DBG ("Subject: ". $myTrackerGateway->Subject);
 	if ($myTrackerGateway->FromEmail) {
 		mail ($myTrackerGateway->FromEmail,'Tracker Post Rejected',$myTrackerGateway->getErrorMessage());
 	}



More information about the evolvis-commits mailing list