[vhffs-dev] [948] now working for moderators, removed useless files

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


Revision: 948
Author:   gradator
Date:     2007-09-29 16:37:31 +0000 (Sat, 29 Sep 2007)

Log Message:
-----------
now working for moderators, removed useless files

Modified Paths:
--------------
    trunk/vhffs-panel/Makefile.am
    trunk/vhffs-panel/admin/web/list.pl
    trunk/vhffs-panel/templates/admin/web/part-modo.tmpl

Removed Paths:
-------------
    trunk/vhffs-panel/admin/web/edit.pl
    trunk/vhffs-panel/admin/web/edit_submit.pl
    trunk/vhffs-panel/admin/web/show.pl


Modified: trunk/vhffs-panel/Makefile.am
===================================================================
--- trunk/vhffs-panel/Makefile.am	2007-09-27 21:54:42 UTC (rev 947)
+++ trunk/vhffs-panel/Makefile.am	2007-09-29 16:37:31 UTC (rev 948)
@@ -77,12 +77,9 @@
 	admin/user/list.pl \
 	admin/user/search.pl \
 	admin/user/show.pl \
-	admin/web/edit_submit.pl \
-	admin/web/edit.pl \
 	admin/web/index.pl \
 	admin/web/list.pl \
 	admin/web/search.pl \
-	admin/web/show.pl \
 	admin/broadcast_delete.pl \
 	admin/broadcast_list.pl \
 	admin/broadcast_submit.pl \

Deleted: trunk/vhffs-panel/admin/web/edit.pl
===================================================================
--- trunk/vhffs-panel/admin/web/edit.pl	2007-09-27 21:54:42 UTC (rev 947)
+++ trunk/vhffs-panel/admin/web/edit.pl	2007-09-29 16:37:31 UTC (rev 948)
@@ -1,191 +0,0 @@
-#!%PERL% -w 
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without 
-# modification, are permitted provided that the following conditions 
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright 
-#   notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in 
-#   the documentation and/or other materials provided with the 
-#   distribution.
-#3. Neither the name of vhffs nor the names of its contributors 
-#   may be used to endorse or promote products derived from this 
-#   software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-# POSSIBILITY OF SUCH DAMAGE.
-
-
-use POSIX qw(locale_h);
-use HTML::Template;
-use locale;
-use Locale::gettext;
-use CGI;
-use CGI::Session;
-use strict;
-
-
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::User;
-use Vhffs::Group;
-use Vhffs::Main;
-use Vhffs::Panel::Main;
-use Vhffs::Panel::Menu;
-use Vhffs::Stats;
-use Vhffs::Constants;
-
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
-
-my $vhffs = $panel->{'vhffs'};
-my $maintemplate = $panel->{'template'};
-my $user = $panel->{'user'};
-#my $group = $panel->{'group'};
-my $projectname = $session->param("project");
-my $cgi = $panel->{'cgi'};
-my $webname = $cgi->param("NAME");
-my $template;
-
-my $templatedir = $vhffs->get_config->get_templatedir;
-
-my $object;
-
-if( $user->is_admin != 1 )
-{
-	
-	$template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
-	my $message = gettext( "You are not allowed to see it");
-	$template->param( MESSAGE => $message );
-}
-elsif( ! defined $webname )
-{
-	$template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
-	my $message = gettext( "CGI ERROR !");
-	$template->param( MESSAGE => $message );
-}
-elsif( ! defined ( $object = Vhffs::Services::Web::get_by_servername( $vhffs , $webname ) ) )
-{
-	$template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
-	my $message = gettext( "Cannot fetch object");
-	$template->param( MESSAGE => $message );
-}
-else
-{
-	$template = new HTML::Template( filename => $templatedir."/panel/admin/web/edit.tmpl" );
-
-	$template->param( TITLE => gettext("Edit Web Area") );
-
-
-	$template->param( TEXT_SERVERNAME => gettext("Servername") );
-	$template->param( TEXT_GROUP => gettext("Group") );
-	$template->param( TEXT_OWNER => gettext("Owner") );
-	$template->param( TEXT_STATUS => gettext("Status") );
-	$template->param( TEXT_DESCRIPTION => gettext("Description") );
-	$template->param( SEND => gettext("Send") );
-	$template->param( TEXT_HISTORY => gettext("History") );
-
-	$template->param( VALUE_DESCRIPTION => CGI::escapeHTML( $object->get_description ) );
-	$template->param( VALUE_SERVERNAME => $object->get_servername );
-	$template->param( VALUE_GROUP => Vhffs::Group::get_name_by_gid( $vhffs , $object->get_owner_gid ));
-	$template->param( VALUE_OWNER => Vhffs::User::get_name_by_uid( $vhffs , $object->get_owner_uid ));
-
-	my $oid = $object->{'object_id'};
-	$template->param( VALUE_HISTORY => "/history.pl?OID=$oid" );
-
-	$template->param( TEXT_STATUS_WAITING_FOR_VALIDATION => gettext("Waiting for validation") );
-	$template->param( TEXT_STATUS_VALIDATION_REFUSED => gettext("Validation refused") );
-	$template->param( TEXT_STATUS_WAITING_FOR_CREATION => gettext("Waiting for creation") );
-	$template->param( TEXT_STATUS_CREATING_ERROR => gettext("Creating error") );
-	$template->param( TEXT_STATUS_ACTIVATED => gettext("Activated") );
-	$template->param( TEXT_STATUS_CREATED => gettext("Created") );
-	$template->param( TEXT_STATUS_SUSPENDED => gettext("Suspended") );
-	$template->param( TEXT_STATUS_SUSPENDED_BEFORE_DELETED => gettext("Suspended") );
-	$template->param( TEXT_STATUS_WAITING_FOR_MODIFICATION => gettext("Waiting for modification") );
-	$template->param( TEXT_STATUS_MODIFICATION_ERROR => gettext("Modification error") );
-	$template->param( TEXT_STATUS_MODIFICATION_APPLIED => gettext("Modification applied") );
-	$template->param( TEXT_STATUS_TO_DELETE => gettext("Will be deleted") );
-
-
-	$template->param( VALUE_STATUS_WAITING_FOR_VALIDATION => Vhffs::Constants::WAITING_FOR_VALIDATION );
-	$template->param( VALUE_STATUS_VALIDATION_REFUSED => Vhffs::Constants::VALIDATION_REFUSED );
-	$template->param( VALUE_STATUS_WAITING_FOR_CREATION => Vhffs::Constants::WAITING_FOR_CREATION );
-	$template->param( VALUE_STATUS_CREATING_ERROR => Vhffs::Constants::CREATING_ERROR );
-	$template->param( VALUE_STATUS_ACTIVATED => Vhffs::Constants::ACTIVATED );
-	$template->param( VALUE_STATUS_CREATED => Vhffs::Constants::CREATED );
-	$template->param( VALUE_STATUS_SUSPENDED => Vhffs::Constants::SUSPENDED );
-	$template->param( VALUE_STATUS_SUSPENDED_BEFORE_DELETED => Vhffs::Constants::SUSPENDED_BEFORE_DELETED );
-	$template->param( VALUE_STATUS_WAITING_FOR_MODIFICATION => Vhffs::Constants::WAITING_FOR_MODIFICATION );
-	$template->param( VALUE_STATUS_MODIFICATION_ERROR => Vhffs::Constants::MODIFICATION_ERROR );
-	$template->param( VALUE_STATUS_MODIFICATION_APPLIED => Vhffs::Constants::MODIFICATION_APPLIED );
-	$template->param( VALUE_STATUS_TO_DELETE => Vhffs::Constants::TO_DELETE );
-
-	my $status = $object->get_status;
-
-	if( $status == Vhffs::Constants::WAITING_FOR_VALIDATION )
-	{
-		$template->param( SELECTED_STATUS_WAITING_FOR_VALIDATION => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::VALIDATION_REFUSED )
-	{
-		$template->param( SELECTED_STATUS_VALIDATION_REFUSED => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::WAITING_FOR_CREATION )
-	{
-		$template->param( SELECTED_STATUS_WAITING_FOR_CREATION => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::CREATING_ERROR )
-	{
-		$template->param( SELECTED_STATUS_CREATING_ERROR => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::CREATED )
-	{
-		$template->param( SELECTED_STATUS_CREATED => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::ACTIVATED )
-	{
-		$template->param( SELECTED_STATUS_ACTIVATED => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::SUSPENDED )
-	{
-		$template->param( SELECTED_STATUS_SUSPENDED => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::SUSPENDED_BEFORE_DELETED )
-	{
-		$template->param( SELECTED_STATUS_SUSPENDED_BEFORE_DELETED => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::WAITING_FOR_MODIFICATION )
-	{
-		$template->param( SELECTED_STATUS_WAITING_FOR_MODIFICATION => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::MODIFICATION_ERROR )
-	{
-		$template->param( SELECTED_STATUS_MODIFICATION_ERROR => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::MODIFICATION_APPLIED )
-	{
-		$template->param( SELECTED_STATUS_MODIFICATION_APPLIED => "selected" );
-	}
-	elsif( $status == Vhffs::Constants::TO_DELETE )
-	{
-		$template->param( SELECTED_STATUS_TO_DELETE => "selected" );
-	}
-}
-
-$panel->build( $template );
-$panel->display;

Deleted: trunk/vhffs-panel/admin/web/edit_submit.pl
===================================================================
--- trunk/vhffs-panel/admin/web/edit_submit.pl	2007-09-27 21:54:42 UTC (rev 947)
+++ trunk/vhffs-panel/admin/web/edit_submit.pl	2007-09-29 16:37:31 UTC (rev 948)
@@ -1,110 +0,0 @@
-#!%PERL% -w 
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without 
-# modification, are permitted provided that the following conditions 
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright 
-#   notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in 
-#   the documentation and/or other materials provided with the 
-#   distribution.
-#3. Neither the name of vhffs nor the names of its contributors 
-#   may be used to endorse or promote products derived from this 
-#   software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-# POSSIBILITY OF SUCH DAMAGE.
-
-
-use POSIX qw(locale_h);
-use HTML::Template;
-use locale;
-use Locale::gettext;
-use CGI;
-use CGI::Session;
-use strict;
-
-
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::User;
-use Vhffs::Group;
-use Vhffs::Main;
-use Vhffs::Panel::Main;
-use Vhffs::Panel::Menu;
-use Vhffs::Stats;
-use Vhffs::Constants;
-
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
-
-my $vhffs = $panel->{'vhffs'};
-my $maintemplate = $panel->{'template'};
-my $user = $panel->{'user'};
-#my $group = $panel->{'group'};
-my $projectname = $session->param("project");
-my $cgi = $panel->{'cgi'};
-my $servername = $cgi->param("NAME");
-my $template;
-
-my $templatedir = $vhffs->get_config->get_templatedir;
-
-my $object;
-my $message;
-if( $user->is_admin != 1 )
-{
-	
-	$template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
-	my $message = gettext( "You are not allowed to see it");
-	$template->param( MESSAGE => $message );
-}
-elsif( ! defined $servername )
-{
-	$template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
-	my $message = gettext( "CGI ERROR !");
-	$template->param( MESSAGE => $message );
-}
-elsif( ! defined ( $object = Vhffs::Services::Web::get_by_servername( $vhffs , $servername ) ) )
-{
-	$template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
-	my $message = gettext( "Cannot fetch object");
-	$template->param( MESSAGE => $message );
-}
-else
-{
-
-	$template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
-
-	$object->set_status( $cgi->param( "STATUS" ) );
-
-	if( $object->commit < 0 )
-	{
-		$message = gettext("Can't modify object ...");
-	}
-	else
-	{
-		$message = gettext("Modifications successfully applied");
-	}
-
-	$template->param( MESSAGE => $message );
-}
-
-
-$panel->set_refresh_url( "/admin/web/list.pl" );
-$panel->build( $template );
-$panel->display;

Modified: trunk/vhffs-panel/admin/web/list.pl
===================================================================
--- trunk/vhffs-panel/admin/web/list.pl	2007-09-27 21:54:42 UTC (rev 947)
+++ trunk/vhffs-panel/admin/web/list.pl	2007-09-29 16:37:31 UTC (rev 948)
@@ -90,7 +90,7 @@
             $subtemplate->param( EDIT => gettext('Edit this Website') );
 		}  else   {
 			$subtemplate = new HTML::Template( filename => $templatedir."/panel/admin/web/part-modo.tmpl", global_vars => 1 );
-            $subtemplate->param( EDIT => gettext('Show this Website'));
+            $subtemplate->param( SHOW => gettext('Show this Website'));
 		}
 
         $subtemplate->param( WEBS => $webs );

Deleted: trunk/vhffs-panel/admin/web/show.pl
===================================================================
--- trunk/vhffs-panel/admin/web/show.pl	2007-09-27 21:54:42 UTC (rev 947)
+++ trunk/vhffs-panel/admin/web/show.pl	2007-09-29 16:37:31 UTC (rev 948)
@@ -1,113 +0,0 @@
-#!%PERL% -w 
-# Copyright (c) vhffs project and its contributors
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without 
-# modification, are permitted provided that the following conditions 
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright 
-#   notice, this list of conditions and the following disclaimer.
-#2. Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in 
-#   the documentation and/or other materials provided with the 
-#   distribution.
-#3. Neither the name of vhffs nor the names of its contributors 
-#   may be used to endorse or promote products derived from this 
-#   software without specific prior written permission.
-#
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
-#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
-#FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
-#COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
-#INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
-#BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
-#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
-#CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
-# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
-# POSSIBILITY OF SUCH DAMAGE.
-
-
-use POSIX qw(locale_h);
-use HTML::Template;
-use locale;
-use Locale::gettext;
-use CGI;
-use CGI::Session;
-use strict;
-
-
-use lib '%VHFFS_LIB_DIR%';
-use Vhffs::User;
-use Vhffs::Group;
-use Vhffs::Main;
-use Vhffs::Panel::Main;
-use Vhffs::Panel::Menu;
-use Vhffs::Stats;
-use Vhffs::Constants;
-
-my $panel = new Vhffs::Panel::Main();
-exit 0 unless $panel;
-my $session = $panel->get_session;
-exit 0 unless $session;
-
-my $vhffs = $panel->{'vhffs'};
-my $maintemplate = $panel->{'template'};
-my $user = $panel->{'user'};
-#my $group = $panel->{'group'};
-my $projectname = $session->param("project");
-my $cgi = $panel->{'cgi'};
-my $webname = $cgi->param("NAME");
-my $template;
-
-my $templatedir = $vhffs->get_config->get_templatedir;
-
-my $object;
-
-if( ($user->is_moderator != 1 ) && ( $user->is_admin != 1 ) )
-{
-	
-	$template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
-	my $message = gettext( "You are not allowed to see it");
-	$template->param( MESSAGE => $message );
-}
-elsif( ! defined $webname )
-{
-	$template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
-	my $message = gettext( "CGI ERROR !");
-	$template->param( MESSAGE => $message );
-}
-elsif( ! defined ( $object = Vhffs::Services::Web::get_by_servername( $vhffs , $webname ) ) )
-{
-	$template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
-	my $message = gettext( "Cannot fetch object");
-	$template->param( MESSAGE => $message );
-}
-else
-{
-	$template = new HTML::Template( filename => $templatedir."/panel/admin/web/show.tmpl" );
-
-	$template->param( TITLE => gettext("Show Web Area") );
-
-	$template->param( TEXT_SERVERNAME => gettext("Servername") );
-	$template->param( TEXT_GROUP => gettext("Group") );
-	$template->param( TEXT_OWNER => gettext("Owner") );
-	$template->param( TEXT_STATUS => gettext("Status") );
-	$template->param( TEXT_DESCRIPTION => gettext("Description") );
-	$template->param( TEXT_HISTORY => gettext("History") );
-
-	$template->param( VALUE_DESCRIPTION => CGI::escapeHTML( $object->get_description ) );
-	$template->param( VALUE_SERVERNAME => $object->get_servername );
-	$template->param( VALUE_GROUP => Vhffs::Group::get_name_by_gid( $vhffs , $object->get_owner_gid ));
-	$template->param( VALUE_OWNER => Vhffs::User::get_name_by_uid( $vhffs , $object->get_owner_uid ));
-
-	my $oid = $object->{'object_id'};
-	$template->param( VALUE_HISTORY => "/history.pl?OID=$oid" );
-
-	$template->param( VALUE_STATUS => Vhffs::Functions::status_string_from_status_id ($object->get_status) );
-}
-
-$panel->build( $template );
-$panel->display;

Modified: trunk/vhffs-panel/templates/admin/web/part-modo.tmpl
===================================================================
--- trunk/vhffs-panel/templates/admin/web/part-modo.tmpl	2007-09-27 21:54:42 UTC (rev 947)
+++ trunk/vhffs-panel/templates/admin/web/part-modo.tmpl	2007-09-29 16:37:31 UTC (rev 948)
@@ -10,11 +10,7 @@
 		<TMPL_VAR NAME="STATE"> 
 	</td>
 	<td>
-		<form method="post" action="show.pl">
-			<input type="hidden" name="OID" value="<TMPL_VAR NAME="OID">" />
-			<input type="hidden" name="NAME" value="<TMPL_VAR NAME="SERVERNAME">" />
-			<input type="submit" value="<TMPL_VAR NAME="SEND">" />
-		</form>
+		<a href="/web/prefs.pl?name=<TMPL_VAR NAME="SERVERNAME">"><TMPL_VAR NAME="SHOW"></a>
 	</td>
 </tr>
 </TMPL_LOOP>


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