[vhffs-dev] [1772] No more HTML::Template in dns/index |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 1772
Author: beuss
Date: 2011-05-19 07:44:18 +0200 (Thu, 19 May 2011)
Log Message:
-----------
No more HTML::Template in dns/index
Modified Paths:
--------------
trunk/vhffs-panel/dns/index.pl
Modified: trunk/vhffs-panel/dns/index.pl
===================================================================
--- trunk/vhffs-panel/dns/index.pl 2011-05-19 05:44:11 UTC (rev 1771)
+++ trunk/vhffs-panel/dns/index.pl 2011-05-19 05:44:18 UTC (rev 1772)
@@ -49,24 +49,30 @@
my $vhffs = $panel->{vhffs};
my $cgi = $panel->{'cgi'};
my $group = Vhffs::Group::get_by_groupname( $vhffs , $cgi->param('group') );
+my $user = $panel->{user};
if( ! defined($group) ) {
- $panel->set_title( gettext('Error') );
- $panel->add_error( gettext('You have to select a group first') );
- $panel->build;
- $panel->display;
+ $panel->render('misc/message.tt', { message => gettext('You have to select a group first') } );
} else {
- # Group is in session => access is granted for user and group is activated
- # no need to check
+ if($group->get_status != Vhffs::Constants::ACTIVATED) {
+ $panel->render( 'misc/message.tt', { message => gettext('This group is not activated yet') } );
+ } elsif( ! $user->can_modify( $group ) ) {
+ $panel->render('misc/message.tt', { message => gettext( 'You\'re not allowed to do this (ACL rights)' ) } );
+ }
+
$panel->set_title( sprintf(gettext('Domain names for %s'), $group->get_groupname) );
my $dns = Vhffs::Panel::DNS::getall_per_group( $vhffs, $group->get_gid );
+
if($dns < 0) {
- $panel->add_error( gettext('Unable to get DNS') );
- $panel->build;
- $panel->display;
+ $panel->render('misc/message.tt', { message => gettext('Unable to get DNS') } );
} else {
- $panel->build( $panel->create_service_index('dns', $dns) );
- $panel->display;
+ $panel->render( 'misc/service-index.tt', {
+ label => 'Domain names',
+ group => $group,
+ list => $dns,
+ help_url => $vhffs->get_config->get_service('dns')->{url_doc},
+ type => 'dns'
+ });
}
}