[vhffs-dev] [1517] Fixed #265 for svn repositories

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


Revision: 1517
Author:   beuss
Date:     2009-08-07 08:19:41 +0200 (Fri, 07 Aug 2009)

Log Message:
-----------
Fixed #265 for svn repositories

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


Modified: trunk/vhffs-api/src/Vhffs/Panel/Svn.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Svn.pm	2009-08-07 05:30:17 UTC (rev 1516)
+++ trunk/vhffs-api/src/Vhffs/Panel/Svn.pm	2009-08-07 06:19:41 UTC (rev 1517)
@@ -81,10 +81,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 s.reponame, o.description FROM vhffs_svn s INNER JOIN vhffs_object o ON o.object_id = s.object_id WHERE o.owner_gid = ? AND o.state = ?';
+    my $sql = 'SELECT s.reponame, o.description FROM vhffs_svn s INNER JOIN vhffs_object o ON o.object_id = s.object_id '.
+	'WHERE '.($public_only ? 's.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/