[vhffs-dev] [1928] changed all references to panel .pl file, removed all remaining exit () from API |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 1928
Author: gradator
Date: 2012-01-23 22:01:52 +0100 (Mon, 23 Jan 2012)
Log Message:
-----------
changed all references to panel .pl file, removed all remaining exit() from API
Modified Paths:
--------------
trunk/vhffs-api/src/Vhffs/Panel/Main.pm
trunk/vhffs-api/src/Vhffs/Panel/Public.pm
trunk/vhffs-api/src/Vhffs/Panel/Svn.pm
trunk/vhffs-api/src/Vhffs/Panel/Tag.pm
trunk/vhffs-api/src/Vhffs/Panel/User.pm
Modified: trunk/vhffs-api/src/Vhffs/Panel/Main.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Main.pm 2012-01-23 20:49:48 UTC (rev 1927)
+++ trunk/vhffs-api/src/Vhffs/Panel/Main.pm 2012-01-23 21:01:52 UTC (rev 1928)
@@ -48,13 +48,9 @@
=cut
sub check_public {
- my $self = shift;
- my $vhffs = $self->{vhffs};
- if( $vhffs->get_config->get_panel->{'use_public'} ne 'yes' ) {
- $self->render('misc/closed.tt', undef);
- # TODO : remove exit
- exit( 0 );
- }
+ my $panel = shift;
+ my $vhffs = $panel->{vhffs};
+ return Vhffs::Functions::strtobool( $vhffs->get_config->get_panel->{'use_public'} );
}
=pod
@@ -71,7 +67,6 @@
sub is_open {
my $panel = shift;
my $vhffs = $panel->{vhffs};
- use Vhffs::Functions;
return Vhffs::Functions::strtobool( $vhffs->get_config->get_panel->{'open'} );
}
@@ -227,18 +222,6 @@
-sub select_lang {
- my $self = shift;
- my @langs = $self->{vhffs}->get_config->get_available_languages;
- my $txt = '';
- foreach my $l ( @langs )
- {
- $txt .= "<a href=\"auth.pl?lang=".$l."\"><img src=\"/themes/".$self->{theme}."/images/".$l.".png\" alt=\"".$l."language\"/></a>";
- }
- return $txt;
-}
-
-
sub new
{
my $class = ref($_[0]) || $_[0];
Modified: trunk/vhffs-api/src/Vhffs/Panel/Public.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Public.pm 2012-01-23 20:49:48 UTC (rev 1927)
+++ trunk/vhffs-api/src/Vhffs/Panel/Public.pm 2012-01-23 21:01:52 UTC (rev 1928)
@@ -49,7 +49,7 @@
sub new {
my $class = shift;
my $panel = $class->SUPER::new(@_);
- $panel->check_public();
+ return undef unless $panel->check_public();
return $panel;
}
Modified: trunk/vhffs-api/src/Vhffs/Panel/Svn.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Svn.pm 2012-01-23 20:49:48 UTC (rev 1927)
+++ trunk/vhffs-api/src/Vhffs/Panel/Svn.pm 2012-01-23 21:01:52 UTC (rev 1928)
@@ -166,7 +166,6 @@
$vars->{description} = $description;
}
- # Since redirect exits, we've error or have not been submitted
$vars->{group} = $group;
$panel->render('svn/create.tt', $vars);
}
Modified: trunk/vhffs-api/src/Vhffs/Panel/Tag.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Tag.pm 2012-01-23 20:49:48 UTC (rev 1927)
+++ trunk/vhffs-api/src/Vhffs/Panel/Tag.pm 2012-01-23 21:01:52 UTC (rev 1928)
@@ -538,7 +538,7 @@
unless(defined ($request_id = $cgi->param('request_id'))) {
$panel->render('misc/message.tt', {
message => gettext('CGI Error'),
- refresh_url => '/admin/tag/request/list.pl'
+ refresh_url => '?do=tagrequestlist'
});
return;
}
@@ -548,7 +548,7 @@
unless(defined ($request = Vhffs::Tag::Request::get_by_request_id($vhffs, $request_id))) {
$panel->render('misc/message.tt', {
message => gettext('Tag request not found'),
- refresh_url => '/admin/tag/request/list.pl'
+ refresh_url => '?do=tagrequestlist'
});
return;
}
@@ -557,7 +557,7 @@
if(_accept_request( $panel, $request )) {
$panel->render('misc/message.tt', {
message => gettext('Tag request accepted'),
- refresh_url => '/admin/tag/request/list.pl'
+ refresh_url => '?do=tagrequestlist'
});
return;
}
@@ -572,7 +572,7 @@
$request->delete();
$panel->render('misc/message.tt', {
message => gettext('Tag request deleted'),
- refresh_url => '/admin/tag/request/list.pl'
+ refresh_url => '?do=tagrequestlist'
});
return;
}
Modified: trunk/vhffs-api/src/Vhffs/Panel/User.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/User.pm 2012-01-23 20:49:48 UTC (rev 1927)
+++ trunk/vhffs-api/src/Vhffs/Panel/User.pm 2012-01-23 21:01:52 UTC (rev 1928)
@@ -601,7 +601,7 @@
}
}
- $panel->render('misc/message.tt', { message => $message, refresh_url => '/panel.pl' });
+ $panel->render('misc/message.tt', { message => $message, refresh_url => '?do=login' });
return;
}