[vhffs-dev] [962] First subquery don't use vhffs_acl anymore

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


Revision: 962
Author:   gradator
Date:     2007-10-05 19:14:03 +0000 (Fri, 05 Oct 2007)

Log Message:
-----------
First subquery don't use vhffs_acl anymore

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Acl.pm
    trunk/vhffs-panel/acl/view.pl


Modified: trunk/vhffs-api/src/Vhffs/Acl.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Acl.pm	2007-10-05 15:47:45 UTC (rev 961)
+++ trunk/vhffs-api/src/Vhffs/Acl.pm	2007-10-05 19:14:03 UTC (rev 962)
@@ -203,7 +203,7 @@
 	   (
 	      ( SELECT allusers.object_id AS granted_oid, allusers.name, aclusers.perm
 	      FROM
-	         ( SELECT u.object_id, u.username AS name FROM vhffs_users u INNER JOIN vhffs_user_group ug ON ug.uid=u.uid INNER JOIN vhffs_groups g ON ug.gid=g.gid INNER JOIN vhffs_acl acl ON acl.granted_oid=g.object_id WHERE acl.target_oid=? )
+	         ( SELECT u.object_id, u.username AS name FROM vhffs_users u INNER JOIN vhffs_user_group ug ON ug.uid=u.uid INNER JOIN vhffs_groups g ON ug.gid=g.gid INNER JOIN vhffs_object o ON o.owner_gid=g.gid WHERE o.object_id=? )
 	            AS allusers
 	      LEFT OUTER JOIN
 	         ( SELECT acl.granted_oid, acl.perm FROM vhffs_acl acl INNER JOIN vhffs_users u ON u.object_id=acl.granted_oid WHERE target_oid=? )

Modified: trunk/vhffs-panel/acl/view.pl
===================================================================
--- trunk/vhffs-panel/acl/view.pl	2007-10-05 15:47:45 UTC (rev 961)
+++ trunk/vhffs-panel/acl/view.pl	2007-10-05 19:14:03 UTC (rev 962)
@@ -61,8 +61,6 @@
 my $templatedir = $vhffs->get_config->get_templatedir;
 my $template;
 
-
-
 my $object = Vhffs::Object::get_by_oid($vhffs, $oid);
 my $access_level = Vhffs::Acl::get_perm( $vhffs , $object , $user );
 
@@ -77,23 +75,7 @@
         $template->param( MESSAGE => gettext('You\'re not allowed to view this object\'s ACL') );
     } else {
         # access OK, let's see if some action was requested
-        if(defined $cgi->param('add_acl_user_submit')) {
-            my $perm = $cgi->param('perm');
-            my $username = $cgi->param('username');
-            my $acl_user;
-            my $ret;
-            if(! (defined $perm && defined $username) ) {
-                $panel->add_error( gettext('CGI Error') );
-            } elsif( ! defined($acl_user = Vhffs::User::get_by_username( $vhffs, $username ) ) ) {
-                $panel->add_error( gettext('User not found') );
-            } elsif( ( $access_level < Vhffs::Constants::ACL_MANAGEACL ) && ( $user->is_admin != 1 ) ) {
-                $panel->add_error( gettext('You\'re not allowed to manage this object\'s ACL') );
-            } elsif( Vhffs::Acl::add_acl ($acl_user, $object, $perm, $vhffs ) < 0 ) {
-                $panel->add_error( gettext('Sorry, can\'t add ACL') );
-            } else {
-                $panel->add_info( gettext('ACL sucessfuly added') );
-            }
-        } elsif(defined $cgi->param('update_acl_submit')) {
+        if(defined $cgi->param('update_acl_submit')) {
             my $granted_oid = $cgi->param('granted_oid');
             my $perm = $cgi->param('perm'.$granted_oid);
             my $granted;


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