[vhffs-dev] [1518] Fixes #265 for CVS & GIT

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1518
Author:   beuss
Date:     2009-08-07 10:06:51 +0200 (Fri, 07 Aug 2009)

Log Message:
-----------
Fixes #265 for CVS & GIT

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Panel/Cvs.pm
    trunk/vhffs-api/src/Vhffs/Panel/Git.pm


Modified: trunk/vhffs-api/src/Vhffs/Panel/Cvs.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Cvs.pm	2009-08-07 06:19:41 UTC (rev 1517)
+++ trunk/vhffs-api/src/Vhffs/Panel/Cvs.pm	2009-08-07 08:06:51 UTC (rev 1518)
@@ -122,10 +122,12 @@
 }
 
 sub get_repos_per_group {
-    my ($main, $gid) = @_;
+    my ($main, $gid, $public_only) = @_;
+    $public_only = 1 unless(defined $public_only);
 
     my $dbh = $main->get_db_object;
-    my $sql = 'SELECT c.cvsroot, o.description FROM vhffs_cvs c INNER JOIN vhffs_object o ON o.object_id = c.object_id WHERE o.owner_gid = ? AND o.state = ?';
+    my $sql = 'SELECT c.cvsroot, o.description FROM vhffs_cvs c INNER JOIN vhffs_object o ON o.object_id = c.object_id '.
+	'WHERE '.($public_only ? 'c.public = true AND ' : '').'o.owner_gid = ? AND o.state = ?';
     return $dbh->selectall_arrayref($sql, { Slice => {} }, $gid, Vhffs::Constants::ACTIVATED);
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Panel/Git.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Git.pm	2009-08-07 06:19:41 UTC (rev 1517)
+++ trunk/vhffs-api/src/Vhffs/Panel/Git.pm	2009-08-07 08:06:51 UTC (rev 1518)
@@ -82,10 +82,12 @@
 }
 
 sub get_repos_per_group {
-    my ($main, $gid) = @_;
+    my ($main, $gid, $public_only) = @_;
+    $public_only = 1 unless(defined $public_only);
 
     my $dbh = $main->get_db_object;
-    my $sql = 'SELECT g.reponame, o.description FROM vhffs_git g INNER JOIN vhffs_object o ON o.object_id = g.object_id WHERE o.owner_gid = ? AND o.state = ?';
+    my $sql = 'SELECT g.reponame, o.description FROM vhffs_git g INNER JOIN vhffs_object o ON o.object_id = g.object_id '.
+	'WHERE '.($public_only ? 'public = 1 AND ' : '').'o.owner_gid = ? AND o.state = ?';
     return $dbh->selectall_arrayref($sql, { Slice => {} }, $gid, Vhffs::Constants::ACTIVATED);
 }
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/