[vhffs-dev] [1732] No more HTML::Template in SVN deletion... |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 1732
Author: beuss
Date: 2011-05-14 22:28:48 +0200 (Sat, 14 May 2011)
Log Message:
-----------
No more HTML::Template in SVN deletion...
Anyway SVN, CVS, Mercurial and Bazaar support should burn in hell, Git
rulez them all.
Modified Paths:
--------------
trunk/vhffs-panel/svn/delete.pl
Modified: trunk/vhffs-panel/svn/delete.pl
===================================================================
--- trunk/vhffs-panel/svn/delete.pl 2011-05-14 20:28:37 UTC (rev 1731)
+++ trunk/vhffs-panel/svn/delete.pl 2011-05-14 20:28:48 UTC (rev 1732)
@@ -32,7 +32,6 @@
use utf8;
use POSIX qw(locale_h);
-use HTML::Template;
use locale;
use Locale::gettext;
use CGI;
@@ -40,13 +39,9 @@
use strict;
use lib '%VHFFS_LIB_DIR%';
-use Vhffs::User;
-use Vhffs::Main;
-use Vhffs::Group;
use Vhffs::Panel::Main;
use Vhffs::Panel::Menu;
-use Vhffs::Panel::Group;
-use Vhffs::Services::Cvs;
+use Vhffs::Services::Svn;
my $panel = new Vhffs::Panel::Main();
exit 0 unless $panel;
@@ -54,52 +49,32 @@
exit 0 unless $session;
my $vhffs = $panel->{'vhffs'};
-my $maintemplate = $panel->{'template'};
my $user = $panel->{'user'};
my $cgi = $panel->{'cgi'};
my $message;
-my $owner = $cgi->param("PROJECT_OWNER");
my $repo = $cgi->param( "name" );
my $sure = $cgi->param( "DELETE" );
my $svn = Vhffs::Services::Svn::get_by_reponame( $vhffs , $repo );
-my $templatedir = $vhffs->get_config->get_templatedir;
-
-if( ( ! defined $repo ) || ( ! defined $sure ) )
-{
+if( ( ! defined $repo ) || ( ! defined $sure ) ) {
$message = gettext("CGI Error !");
-}
-elsif( ! defined $svn )
-{
+} elsif( ! defined $svn ) {
$message = gettext( "Cannot retrieve informations about this repository" );
-}
-elsif( !$user->can_delete( $svn ) )
-{
+} elsif( !$user->can_delete( $svn ) ) {
$message = gettext( 'You\'re not allowed to do this, object is not in active state or you don\'t have enough ACL rights' );
-}
-elsif( $sure == 0 )
-{
+} elsif( $sure == 0 ) {
$message = gettext( "This subversion repository will NOT be deleted" );
-}
-else
-{
+} else {
$svn->set_status( Vhffs::Constants::TO_DELETE );
# Commit all the changes for the current user
- if( $svn->commit < 0 )
- {
- $message = gettext("An error occured while deleting the Subversion repository");
- }
- else
- {
+ if( $svn->commit < 0 ) {
+ $message = gettext("An error occured while deleting the Subversion repository");
+ } else {
$message = gettext("This repository will be deleted");
}
}
-my $template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
-$template->param( MESSAGE => $message );
-
-$panel->build( $template );
-$panel->display;
+$panel->render('misc/message.tt', { message => $message } );