[Fusionforge-commits] r8177 - in trunk/gforge/www: admin export include

Roland Mas lolando at libremir.placard.fr.eu.org
Fri Sep 25 10:28:13 CEST 2009


Author: lolando
Date: 2009-09-25 10:28:13 +0200 (Fri, 25 Sep 2009)
New Revision: 8177

Modified:
   trunk/gforge/www/admin/grouplist.php
   trunk/gforge/www/export/rss20_newreleases.php
   trunk/gforge/www/export/rss20_news.php
   trunk/gforge/www/include/project_home.php
Log:
Fixed bad logic for conditional clauses in SQL

Modified: trunk/gforge/www/admin/grouplist.php
===================================================================
--- trunk/gforge/www/admin/grouplist.php	2009-09-24 21:30:46 UTC (rev 8176)
+++ trunk/gforge/www/admin/grouplist.php	2009-09-25 08:28:13 UTC (rev 8177)
@@ -49,7 +49,7 @@
 LEFT JOIN user_group ON user_group.group_id=groups.group_id, licenses
 WHERE license_id=license
 AND lower(group_name) LIKE $1
-AND (status=$2 AND 1=$3)
+AND (status=$2 OR 1!=$3)
 GROUP BY group_name,register_time,unix_group_name,groups.group_id,is_public,status,license_name',
 					array (strtolower ("$group_name_search%"),
 					       'P',

Modified: trunk/gforge/www/export/rss20_newreleases.php
===================================================================
--- trunk/gforge/www/export/rss20_newreleases.php	2009-09-24 21:30:46 UTC (rev 8176)
+++ trunk/gforge/www/export/rss20_newreleases.php	2009-09-25 08:28:13 UTC (rev 8177)
@@ -18,7 +18,6 @@
 if ($limit > 100) $limit = 100;
 
 if ($group_id) {
-	$where = "frs_package.group_id=$group_id AND ";
 	$res = db_query_params ('SELECT group_name FROM groups WHERE group_id=$1 AND is_public=1',
 				array ($group_id)) ;
 	$row = db_fetch_array($res);
@@ -34,7 +33,6 @@
 	  $webmaster = $GLOBALS['sys_admin_email'];
 	}
 } else {
-	$where = "";
 	$title = "";
 	$link = "/new/";
 	$description = "";
@@ -75,7 +73,7 @@
   AND frs_package.group_id=groups.group_id
   AND frs_release.status_id=1
   AND groups.is_public=1
-  AND (package.group_id=$1 AND 1=$2)
+  AND (package.group_id=$1 OR 1!=$2)
   AND frs_file.release_id=frs_release.release_id
 ORDER BY frs_file.release_time DESC',
 			array ($group_id,

Modified: trunk/gforge/www/export/rss20_news.php
===================================================================
--- trunk/gforge/www/export/rss20_news.php	2009-09-24 21:30:46 UTC (rev 8176)
+++ trunk/gforge/www/export/rss20_news.php	2009-09-25 08:28:13 UTC (rev 8177)
@@ -16,8 +16,6 @@
 if ($limit > 100) $limit = 100;
 
 if ($group_id) {
-	$where = "AND g.group_id=$group_id";
-
 	$res = db_query_params ('SELECT group_name FROM groups WHERE group_id=$1 AND is_public=1',
 				array($group_id),
 				1);
@@ -35,7 +33,6 @@
 	  $webmaster = $GLOBALS['sys_admin_email'];
 	}
 } else {
-	$where = "AND is_approved=1";
 	$title = "";
 	$link = "";
 	$description = "";
@@ -64,8 +61,8 @@
 AND g.is_public=1
 AND g.status=$1
 AND news_bytes.is_approved <> 4
-AND (g.group_id=$group_id AND 1 = $3)
-AND (is_approved=1 AND 1 = $4)
+AND (g.group_id=$group_id OR 1 != $3)
+AND (is_approved=1 OR 1 != $4)
 ORDER BY post_date DESC',
 			array ('A',
 			       $group_id,

Modified: trunk/gforge/www/include/project_home.php
===================================================================
--- trunk/gforge/www/include/project_home.php	2009-09-24 21:30:46 UTC (rev 8176)
+++ trunk/gforge/www/include/project_home.php	2009-09-25 08:28:13 UTC (rev 8177)
@@ -210,7 +210,7 @@
 			WHERE frs_package.package_id=frs_release.package_id 
 			AND frs_package.group_id=$1 
 			AND frs_release.status_id=1 
-			AND (frs_package.is_public=1 AND 1=$2)
+			AND (frs_package.is_public=1 OR 1 != $2)
 			ORDER BY frs_package.package_id,frs_release.release_date DESC',
 			array ($group_id,
 				$public_required));




More information about the Fusionforge-commits mailing list