[evolvis-commits] r7697: Applied patch #255 from Olafur. ↵

mirabilos at evolvis.org mirabilos at evolvis.org
Thu Feb 24 15:47:07 CET 2011


Author: mirabilos
Date: 2011-02-24 15:47:07 +0100 (Thu, 24 Feb 2011)
New Revision: 7697

Modified:
   trunk/gforge_base/evolvisforge-5.1/gforge/utils/new_parse.pl
   trunk/gforge_base/evolvisforge-5.1/gforge/www/include/frs.class
   trunk/gforge_base/evolvisforge-5.1/gforge/www/project/admin/editreleases.php
Log:
Applied patch #255 from Olafur.


Modified: trunk/gforge_base/evolvisforge-5.1/gforge/utils/new_parse.pl
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/utils/new_parse.pl	2011-02-24 14:47:06 UTC (rev 7696)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/utils/new_parse.pl	2011-02-24 14:47:07 UTC (rev 7697)
@@ -168,12 +168,11 @@
 	#LDAP_NOW#push @group_array, "$username:x:$uid:\n";
 	
 	# Now lets create the homedir and copy the contents of /etc/skel into it.
-	mkdir $home_dir, 0751;
+	mkdir $home_dir, 0755;
         chown $uid, $uid, $home_dir;
 	
-	mkdir $home_dir.'/incoming', 0771;
+	mkdir $home_dir.'/incoming', 0755;
 	chown $uid, $uid, $home_dir.'/incoming' ;
-	chmod 0755, $home_dir.'/incoming';
 }
 
 #############################
@@ -189,10 +188,10 @@
 	
         $home_dir = $homedir_prefix.$username;
 	unless (-d $home_dir.'/incoming') {
-	    mkdir $home_dir.'/incoming', 0771;
+	    mkdir $home_dir.'/incoming', 0755;
 	}
         system("chown $username:$username $home_dir/incoming");
-	system("chmod 0771 $home_dir/incoming");
+	system("chmod 0755 $home_dir/incoming");
 
 	#LDAP_NOW#push @passwd_array, "$username:x:$uid:$uid:$realname:/home/users/$username:$shell\n";
 	#LDAP_NOW#push @shadow_array, "$username:$passwd:$date:0:99999:7:::\n";

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/frs.class
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/frs.class	2011-02-24 14:47:06 UTC (rev 7696)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/frs.class	2011-02-24 14:47:07 UTC (rev 7697)
@@ -103,14 +103,15 @@
 	 * frsAddFile() - Add a new file
 	 *
 	 * @param	int		Time of the release
-	 * @param	string	The name of the file to add
-	 * @param	int		The ID of the release this file to which this file is associated
+	 * @param	string		The name of the file to add
+	 * @param	string		The groups unix name
+	 * @param	string		The users unix name
 	 * @param	int		The file size
 	 * @param	int		The post date
-	 * @param	int		The ide of the release
+	 * @param	int		The ID of the release
 	 * @param	int		The ID of the package
 	 */
-	function frsAddFile($release_time, $filename, $file_size, $post_date, $release_id, $package_id) {
+	function frsAddFile($release_time, $filename, $group_unix_name, $user_unix_name, $file_size, $post_date, $release_id, $package_id) {
 		if( !$this->frsVerifyRelease($release_id, $package_id) ) {
 			$this->setError(' FRS Add File Failed: ' . $this->getErrorMessage());
 			return false;
@@ -126,7 +127,7 @@
 		// I know.  I tried it.
 		// [RM]
 		putenv ('sys_dbpasswd='.getenv ('sys_dbpasswd')) ;
-		exec ("/usr/lib/sourceforge/bin/fileforge.pl ".escapeshellarg($file)." ".escapeshellarg($user_unix_name)." ".escapeshellarg($group_unix_name)." 2>&1", $exec_res);
+		exec ("/usr/lib/sourceforge/bin/fileforge.pl ".escapeshellarg($filename)." ".escapeshellarg($user_unix_name)." ".escapeshellarg($group_unix_name)." 2>&1", $exec_res);
 		putenv ('sys_dbpasswd=') ;
 		if ($exec_res[0]) {
 			$this->setError("FRS Add File Failed:<br>$exec_res[0]<br>$exec_res[1]<br>$exec_res[2]");
@@ -141,8 +142,8 @@
 								'$release_id',
 								'$file_size',
 								'$post_date',
-								'100',
-								'100') ");
+								'9999',
+								'9999') ");
 		if (!$res) {
 			$this->setError(' FRS Add File Failed: ' . db_error());
 			return false;

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/project/admin/editreleases.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/project/admin/editreleases.php	2011-02-24 14:47:06 UTC (rev 7696)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/project/admin/editreleases.php	2011-02-24 14:47:07 UTC (rev 7697)
@@ -88,11 +88,13 @@
 // Add file(s) to the release
 if ($step2) {	
 	$group_unix_name=group_getunixname($group_id);
+	$user_unix_name=user_getname();
 	$project_files_dir=$FTPFILES_DIR . '/' . $group_unix_name;
+	$user_incoming_dir=ereg_replace("<USER>",$user_unix_name,$FTPINCOMING_DIR);
 
 	// For every file selected add that file to this release
 	for($x=0;$x<count($file_list);$x++) {
-		$frs->frsAddFile(time(), $file_list[$x], $group_unix_name, $user_unix_name, filesize("$project_files_dir/$file_list[$x]"), time(), $release_id, $package_id, $type_id, $proc_id);
+		$frs->frsAddFile(time(), $file_list[$x], $group_unix_name, $user_unix_name, filesize("$user_incoming_dir/$file_list[$x]"), time(), $release_id, $package_id);
 		if( !$frs->isError() ) {
 			$feedback .= " File(s) Added ";
 		}
@@ -102,11 +104,15 @@
 // Edit/Delete files in a release
 if ($step3) {	
 	// If the user chose to delete the file and he's sure then delete the file
-	if( $step3 == "Delete File" && $im_sure ) {
-		// delete the file from the database
-		$frs->frsDeleteFile($file_id, $group_id);
-		if( !$frs->isError() ) {
-			$feedback .= " File Deleted ";
+	if( $step3 == "Delete File") {
+		if ( $im_sure ) {
+			// delete the file from the database
+			$frs->frsDeleteFile($file_id, $group_id);
+			if( !$frs->isError() ) {
+				$feedback .= " File Deleted ";
+			}
+		} else {
+			$feedback .= " File Not Deleted, you must be sure ";
 		}
 	// Otherwise update the file information
 	} else {



More information about the evolvis-commits mailing list