[vhffs-dev] [1035] Admin parts are no more displayed for non admin users

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


Revision: 1035
Author:   gradator
Date:     2007-10-26 20:21:23 +0000 (Fri, 26 Oct 2007)

Log Message:
-----------
Admin parts are no more displayed for non admin users

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Panel/Object.pm
    trunk/vhffs-panel/cvs/prefs.pl
    trunk/vhffs-panel/dns/prefs.pl
    trunk/vhffs-panel/git/prefs.pl
    trunk/vhffs-panel/group/prefs.pl
    trunk/vhffs-panel/mail/prefs.pl
    trunk/vhffs-panel/mailinglist/prefs.pl
    trunk/vhffs-panel/mysql/prefs.pl
    trunk/vhffs-panel/pgsql/prefs.pl
    trunk/vhffs-panel/repository/prefs.pl
    trunk/vhffs-panel/svn/prefs.pl
    trunk/vhffs-panel/user/prefs.pl
    trunk/vhffs-panel/web/prefs.pl


Modified: trunk/vhffs-api/src/Vhffs/Panel/Object.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Object.pm	2007-10-26 20:04:59 UTC (rev 1034)
+++ trunk/vhffs-api/src/Vhffs/Panel/Object.pm	2007-10-26 20:21:23 UTC (rev 1035)
@@ -82,13 +82,13 @@
 	my $panel = shift;
 	my $object = shift;
 
-	#return undef unless defined $object;
+	return undef unless defined $object;
 
 	my $vhffs = $panel->{vhffs};
 	my $templatedir = $panel->{templatedir};
 	my $user = $panel->{user};
 
-	#return undef if( $user->is_admin != 1 );
+	return undef if( $user->is_admin != 1 );
 
 	my $template = new HTML::Template( filename => $templatedir.'/panel/admin/object/editembedded.tmpl' );
 

Modified: trunk/vhffs-panel/cvs/prefs.pl
===================================================================
--- trunk/vhffs-panel/cvs/prefs.pl	2007-10-26 20:04:59 UTC (rev 1034)
+++ trunk/vhffs-panel/cvs/prefs.pl	2007-10-26 20:21:23 UTC (rev 1035)
@@ -137,7 +137,8 @@
 
     $template->param( PUBLIC => $cvs->is_public );
 
-	$template->param( ADMIN_PART => Vhffs::Panel::Object::admin_part( $panel, $cvs )->output );
+	my $adminpart = Vhffs::Panel::Object::admin_part( $panel, $cvs );
+	$template->param( ADMIN_PART => $adminpart->output ) if( $adminpart );
 }
 
 $panel->build( $template );

Modified: trunk/vhffs-panel/dns/prefs.pl
===================================================================
--- trunk/vhffs-panel/dns/prefs.pl	2007-10-26 20:04:59 UTC (rev 1034)
+++ trunk/vhffs-panel/dns/prefs.pl	2007-10-26 20:21:23 UTC (rev 1035)
@@ -426,7 +426,8 @@
 			$template->param( OPART => $subtemplate->output );
 	}
 
-	$template->param( ADMIN_PART => Vhffs::Panel::Object::admin_part( $panel, $dns )->output );
+	my $adminpart = Vhffs::Panel::Object::admin_part( $panel, $dns );
+	$template->param( ADMIN_PART => $adminpart->output ) if( defined $adminpart );
 }
 
 $panel->build( $template );

Modified: trunk/vhffs-panel/git/prefs.pl
===================================================================
--- trunk/vhffs-panel/git/prefs.pl	2007-10-26 20:04:59 UTC (rev 1034)
+++ trunk/vhffs-panel/git/prefs.pl	2007-10-26 20:21:23 UTC (rev 1035)
@@ -146,7 +146,8 @@
         $template->param( OPART => $subtemplate->output );
     }
 
-	$template->param( ADMIN_PART => Vhffs::Panel::Object::admin_part( $panel, $git )->output );
+	my $adminpart = Vhffs::Panel::Object::admin_part( $panel, $git );
+	$template->param( ADMIN_PART => $adminpart->output ) if( defined $adminpart );
 }
 
 $panel->build( $template );

Modified: trunk/vhffs-panel/group/prefs.pl
===================================================================
--- trunk/vhffs-panel/group/prefs.pl	2007-10-26 20:04:59 UTC (rev 1034)
+++ trunk/vhffs-panel/group/prefs.pl	2007-10-26 20:21:23 UTC (rev 1035)
@@ -257,7 +257,8 @@
 	$template->param( USERS_TEXT => gettext( 'Users' ) );
 	$template->param( CURRENT_USERS => gettext( 'All users in this group' ) );
 
-	$template->param( ADMIN_PART => Vhffs::Panel::Object::admin_part( $panel, $group )->output );
+	my $adminpart = Vhffs::Panel::Object::admin_part( $panel, $group );
+	$template->param( ADMIN_PART => $adminpart->output ) if( defined $adminpart );
 }
 
 $panel->build( $template );

Modified: trunk/vhffs-panel/mail/prefs.pl
===================================================================
--- trunk/vhffs-panel/mail/prefs.pl	2007-10-26 20:04:59 UTC (rev 1034)
+++ trunk/vhffs-panel/mail/prefs.pl	2007-10-26 20:21:23 UTC (rev 1035)
@@ -173,7 +173,8 @@
 	my @forwards = sort { $a->{local_part} cmp $b->{local_part} } (values %{$mail->get_forwards});
     $template->param( FORWARDS => ( \@forwards ) );
 
-	$template->param( ADMIN_PART => Vhffs::Panel::Object::admin_part( $panel, $mail )->output );
+	my $adminpart = Vhffs::Panel::Object::admin_part( $panel, $mail );
+	$template->param( ADMIN_PART => $adminpart->output ) if( defined $adminpart );
 }
 
 $panel->build( $template );

Modified: trunk/vhffs-panel/mailinglist/prefs.pl
===================================================================
--- trunk/vhffs-panel/mailinglist/prefs.pl	2007-10-26 20:04:59 UTC (rev 1034)
+++ trunk/vhffs-panel/mailinglist/prefs.pl	2007-10-26 20:21:23 UTC (rev 1035)
@@ -208,7 +208,8 @@
             $template->param( OPART => $subtemplate->output );
     }
 
-	$template->param( ADMIN_PART => Vhffs::Panel::Object::admin_part( $panel, $list )->output );
+	my $adminpart = Vhffs::Panel::Object::admin_part( $panel, $list );
+	$template->param( ADMIN_PART => $adminpart->output ) if( defined $adminpart );
 }
 
 $panel->build( $template );

Modified: trunk/vhffs-panel/mysql/prefs.pl
===================================================================
--- trunk/vhffs-panel/mysql/prefs.pl	2007-10-26 20:04:59 UTC (rev 1034)
+++ trunk/vhffs-panel/mysql/prefs.pl	2007-10-26 20:21:23 UTC (rev 1035)
@@ -127,7 +127,8 @@
 	$template->param( NO => gettext("No, I'm not sure, I prefer to keep this project.") );
 	$template->param( TEXT_DELETE => gettext("Delete") );
 
-	$template->param( ADMIN_PART => Vhffs::Panel::Object::admin_part( $panel, $mysql )->output );
+	my $adminpart = Vhffs::Panel::Object::admin_part( $panel, $mysql );
+	$template->param( ADMIN_PART => $adminpart->output ) if( defined $adminpart );
 }
 
 $panel->build( $template );

Modified: trunk/vhffs-panel/pgsql/prefs.pl
===================================================================
--- trunk/vhffs-panel/pgsql/prefs.pl	2007-10-26 20:04:59 UTC (rev 1034)
+++ trunk/vhffs-panel/pgsql/prefs.pl	2007-10-26 20:21:23 UTC (rev 1035)
@@ -111,7 +111,8 @@
 	$template->param( NO => gettext("No, I'm not sure, I prefer to keep this project.") );
 	$template->param( TEXT_DELETE => gettext("Delete") );
 
-	$template->param( ADMIN_PART => Vhffs::Panel::Object::admin_part( $panel, $pgsql )->output );
+	my $adminpart = Vhffs::Panel::Object::admin_part( $panel, $pgsql );
+	$template->param( ADMIN_PART => $adminpart->output ) if( defined $adminpart );
 }
 
 $panel->build( $template );

Modified: trunk/vhffs-panel/repository/prefs.pl
===================================================================
--- trunk/vhffs-panel/repository/prefs.pl	2007-10-26 20:04:59 UTC (rev 1034)
+++ trunk/vhffs-panel/repository/prefs.pl	2007-10-26 20:21:23 UTC (rev 1035)
@@ -113,7 +113,8 @@
     $template->param( EXPLAIN_ADMIN_ACL => "You can Manage rights on this service for each user in the VHFFS database. Please read help before manage it." );
     $template->param( ADMIN_ACL => "Ok, go to ACL admin" );
 
-	$template->param( ADMIN_PART => Vhffs::Panel::Object::admin_part( $panel, $repo )->output );
+	my $adminpart = Vhffs::Panel::Object::admin_part( $panel, $repo );
+	$template->param( ADMIN_PART => $adminpart->output ) if( defined $adminpart );
 }
 
 $panel->build( $template );

Modified: trunk/vhffs-panel/svn/prefs.pl
===================================================================
--- trunk/vhffs-panel/svn/prefs.pl	2007-10-26 20:04:59 UTC (rev 1034)
+++ trunk/vhffs-panel/svn/prefs.pl	2007-10-26 20:21:23 UTC (rev 1035)
@@ -141,7 +141,8 @@
         $template->param( OPART => $subtemplate->output );
     }
 
-	$template->param( ADMIN_PART => Vhffs::Panel::Object::admin_part( $panel, $svn )->output );
+	my $adminpart = Vhffs::Panel::Object::admin_part( $panel, $svn );
+	$template->param( ADMIN_PART => $adminpart->output ) if( defined $adminpart );
 }
 
 $panel->build( $template );

Modified: trunk/vhffs-panel/user/prefs.pl
===================================================================
--- trunk/vhffs-panel/user/prefs.pl	2007-10-26 20:04:59 UTC (rev 1034)
+++ trunk/vhffs-panel/user/prefs.pl	2007-10-26 20:21:23 UTC (rev 1035)
@@ -444,7 +444,8 @@
 		$template->param( MAILUSER => $subtemplate->output );
 	}
 
-	$template->param( ADMIN_PART => Vhffs::Panel::Object::admin_part( $panel, $userp )->output );
+	my $adminpart = Vhffs::Panel::Object::admin_part( $panel, $userp );
+	$template->param( ADMIN_PART => $adminpart->output ) if( defined $adminpart );
 }
 
 $panel->build( $template );

Modified: trunk/vhffs-panel/web/prefs.pl
===================================================================
--- trunk/vhffs-panel/web/prefs.pl	2007-10-26 20:04:59 UTC (rev 1034)
+++ trunk/vhffs-panel/web/prefs.pl	2007-10-26 20:21:23 UTC (rev 1035)
@@ -114,7 +114,8 @@
 	$template->param( NO => gettext("No, I'm not sure, I prefer to keep it.") );
 	$template->param( TEXT_DELETE => gettext("Delete") );
 
-	$template->param( ADMIN_PART => Vhffs::Panel::Object::admin_part( $panel, $web )->output );
+	my $adminpart = Vhffs::Panel::Object::admin_part( $panel, $web );
+	$template->param( ADMIN_PART => $adminpart->output ) if( defined $adminpart );
 }
 
 $panel->build( $template );


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