[Fusionforge-commits] r7607 - trunk/gforge/utils

Roland Mas lolando at libremir.placard.fr.eu.org
Tue May 5 13:31:39 CEST 2009


Author: lolando
Date: 2009-05-05 13:31:39 +0200 (Tue, 05 May 2009)
New Revision: 7607

Modified:
   trunk/gforge/utils/inject-files.php
Log:
Fixes to the FRS injector

Modified: trunk/gforge/utils/inject-files.php
===================================================================
--- trunk/gforge/utils/inject-files.php	2009-05-05 11:31:32 UTC (rev 7606)
+++ trunk/gforge/utils/inject-files.php	2009-05-05 11:31:39 UTC (rev 7607)
@@ -62,9 +62,12 @@
 	$filepath = $array[3] ;
 	$notes = $array[4] ;
 	$changes = $array[5] ;
-	$type = $array[6] ;
+	$typeid = $array[6] ;
 	$processorid = $array[7] ;
 
+	$admin = user_get_object_by_name ('admin') ;
+	session_set_new ($admin->getID ()) ;
+
 	$g = group_get_object_by_name ($projectname);
 	if (! $g) {
 		print "Error: invalid group\n" ;
@@ -94,14 +97,16 @@
 
 	$releases = $package->getReleases () ;
 	$release = false ;
-	foreach ($releases as $cur) {
-		if ($cur->getName () == $releasename) {
-			$release = $cur ;
-			break ;
+	if ($releases) {
+		foreach ($releases as $cur) {
+			if ($cur->getName () == $releasename) {
+				$release = $cur ;
+				break ;
+			}
 		}
 	}
 	if (!$release) {
-		$release = new FRSRelease ($g) ;
+		$release = new FRSRelease ($package) ;
 		$r = $release->create ($releasename, $notes, $changes, false) ;
 	}
 	if (!$r || !$release) {




More information about the Fusionforge-commits mailing list