[Fusionforge-commits] r9363 - trunk/gforge/cronjobs

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Tue Apr 6 14:46:44 CEST 2010


Author: aljeux
Date: 2010-04-06 14:46:43 +0200 (Tue, 06 Apr 2010)
New Revision: 9363

Modified:
   trunk/gforge/cronjobs/tracker_gateway.php
Log:
addslash() removed and indent cleanup

Modified: trunk/gforge/cronjobs/tracker_gateway.php
===================================================================
--- trunk/gforge/cronjobs/tracker_gateway.php	2010-04-06 12:08:43 UTC (rev 9362)
+++ trunk/gforge/cronjobs/tracker_gateway.php	2010-04-06 12:46:43 UTC (rev 9363)
@@ -7,7 +7,7 @@
  * Copyright 2009, Roland Mas
  *
  * @author Tim Perdue tim at gforge.org
- * @author Sung Kim 
+ * @author Sung Kim
  * @author Francisco Gimeno <kikov at kikov.org>
  *
  * This file is part of GForge.
@@ -78,8 +78,7 @@
 	
 		return true;
 	}
-	
-	
+
 	/**
 	 * function - Copy mail(from stdin to tmp and return the tmp file
 	 *
@@ -95,10 +94,10 @@
 		while($buffer = fgets($in, 4096)) {
 			fputs($out, $buffer);
 		}
-	
+
 		fclose($in);
 		fclose($out);
-	
+
 		return $tmpfile;
 	}
 
@@ -111,7 +110,7 @@
 	 */
 	function parseMail($input_file) {
 		global $argv;
-		
+
 		if (!$mp = new MailParser($input_file)) {
 			$this->setError('Error In MailParser');
 			return false;
@@ -142,14 +141,14 @@
 			return false;
 		}
 
-		$body = addslashes($mp->getBody());
+		$body = $mp->getBody();
 		// 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());
+					"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
@@ -158,21 +157,21 @@
 		$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());
+					"you entered your message between the correct text markers.".
+					"\nYour message was:".
+					"\n".$mp->getBody());
 			return false;
 		}
 		$message = substr($body, 0, $end);
 		$message = trim($message);
-		
+
 		// maybe the last line was "> (ARTIFACT_MAIL_MARKER)". In that case, delete the last ">"
 		$message = preg_replace('/>$/', '', $message);
 		$this->Message = $message;
-		
+
 		return true;
 	}
-	
+
 	/**
 	 * Insert data into the tracker db
 	 *
@@ -194,7 +193,7 @@
 		if (!$Artifact || !is_object($Artifact)) {
 			$this->setError("Could Not Get Artifact");
 			return false;
-		} 
+		}
 		if (!$user_id && !$Artifact->ArtifactType->allowsAnon()) {
 			$this->setError("Could Not Match Sender Email Address to User and Tracker Does Not Allow Anonymous Posts");
 			return false;
@@ -213,7 +212,7 @@
 
 
 	/*------------------------------------------------------------------------
-	 *  Utility functions 
+	 *  Utility functions
 	 *-----------------------------------------------------------------------*/
 
 	/* Find user_id from email */
@@ -229,29 +228,29 @@
 			$user_id = db_result($res,0,'user_id');
 		}
 		db_free_result($res);
-	
+
 		return $user_id;
 	}
 
 	function &getArtifact() {
 		global $argv;
 
-			// $Group not needed, but let the code here to support
-			// tracker additions in the Future
-			$Group =& group_get_object_by_name($argv[1]);
-			if (!$Group || !is_object($Group)) {
-				$this->setError('Could Not Get Group Object');
-				return false;
-			} elseif ($Group->isError()) {
-				$this->setError('Getting Group Object: '.$Group->getErrorMessage());
-				return false;
-			}
-			// DBG("Artifact_get_object(".$this->ArtifactId.");");
-			$this->Artifact =& artifact_get_object($this->ArtifactId);
-	
+		// $Group not needed, but let the code here to support
+		// tracker additions in the Future
+		$Group =& group_get_object_by_name($argv[1]);
+		if (!$Group || !is_object($Group)) {
+			$this->setError('Could Not Get Group Object');
+			return false;
+		} elseif ($Group->isError()) {
+			$this->setError('Getting Group Object: '.$Group->getErrorMessage());
+			return false;
+		}
+		// DBG("Artifact_get_object(".$this->ArtifactId.");");
+		$this->Artifact =& artifact_get_object($this->ArtifactId);
+
 		return $this->Artifact;
 	}
- 
+
 }
 
 
@@ -261,19 +260,18 @@
  * Add this in /etc/syslog.conf and see /var/log/debug file:
  * # Debug
  * *.=debug			/var/log/debug
- * 
+ *
  */
 function DBG($str) {
 	global $debug;
 
 	if ($debug==1) {
-		system("echo \"artifact: ".$str."\n\" >> /tmp/tracker.log");
+		system("echo \"artifact: ".$str."\n\" >> /tmp/tracker-gateway.log");
 		syslog(LOG_DEBUG, "artifact_gateway: ". $str);
 	} else if ($debug==2) {
 		echo $str."\n";
 	}
 }
- 
 
 /* Main routine */
 $debug = 0;




More information about the Fusionforge-commits mailing list