[vhffs-dev] [590] Closing public part now really disable all public pages.

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


Revision: 590
Author:   beuss
Date:     2007-04-22 07:43:27 +0000 (Sun, 22 Apr 2007)

Log Message:
-----------
Closing public part now really disable all public pages.
Fixed some template problems.

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Panel/Main.pm
    trunk/vhffs-panel/public/allgroups.pl
    trunk/vhffs-panel/public/allwebsites.pl
    trunk/vhffs-panel/public/group.pl
    trunk/vhffs-panel/public/index.pl
    trunk/vhffs-panel/public/lastgroups.pl
    trunk/vhffs-panel/public/lastusers.pl
    trunk/vhffs-panel/public/rss/lastgroups.pl
    trunk/vhffs-panel/public/rss/lastusers.pl
    trunk/vhffs-panel/public/user.pl
    trunk/vhffs-panel/public/websearch.pl
    trunk/vhffs-panel/templates/public/simplemsg.tmpl


Modified: trunk/vhffs-api/src/Vhffs/Panel/Main.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Main.pm	2007-04-21 19:41:41 UTC (rev 589)
+++ trunk/vhffs-api/src/Vhffs/Panel/Main.pm	2007-04-22 07:43:27 UTC (rev 590)
@@ -68,6 +68,21 @@
 }
 
 
+sub check_public {
+    my $self = shift;
+    my $vhffs = $self->{vhffs};
+    my $templatedir = $vhffs->get_config->get_templatedir;
+    if( $vhffs->get_config->get_panel_public != 1 ) {
+        my $template = new HTML::Template( filename => $templatedir.'/main/close.tmpl' );
+        $template->param( TITLE         => gettext('Public area not available') );
+        $template->param( TEXT_CLOSE    => gettext('Public area not available') );
+        $template->param( TEXT_EXPLAIN  => gettext('Public area is not available on this platform.') );
+        
+        $self->display_light( $template );
+        exit( 0 );
+    }
+}
+
 sub list_themes
 {
 	my $vhffs = shift;

Modified: trunk/vhffs-panel/public/allgroups.pl
===================================================================
--- trunk/vhffs-panel/public/allgroups.pl	2007-04-21 19:41:41 UTC (rev 589)
+++ trunk/vhffs-panel/public/allgroups.pl	2007-04-22 07:43:27 UTC (rev 590)
@@ -49,6 +49,8 @@
 my $cgi = $panel->{'cgi'};
 my $templatedir = $panel->{'templatedir'};
 
+$panel->check_public();
+
 my $subtemplate;
 my $template;
 my $group;

Modified: trunk/vhffs-panel/public/allwebsites.pl
===================================================================
--- trunk/vhffs-panel/public/allwebsites.pl	2007-04-21 19:41:41 UTC (rev 589)
+++ trunk/vhffs-panel/public/allwebsites.pl	2007-04-22 07:43:27 UTC (rev 590)
@@ -51,6 +51,8 @@
 my $cgi = $panel->{'cgi'};
 my $templatedir = $panel->{'templatedir'};
 
+$panel->check_public();
+
 my $template;
 my $letters = Vhffs::Services::Httpd::get_used_letters($vhffs);
 my $letter = ( defined $cgi->param('letter') ? $cgi->param('letter') : (defined $letters->[0] ? $letters->[0]->{letter} : undef) );

Modified: trunk/vhffs-panel/public/group.pl
===================================================================
--- trunk/vhffs-panel/public/group.pl	2007-04-21 19:41:41 UTC (rev 589)
+++ trunk/vhffs-panel/public/group.pl	2007-04-22 07:43:27 UTC (rev 590)
@@ -52,6 +52,8 @@
 my $cgi = $panel->{'cgi'};
 my $templatedir = $panel->{'templatedir'};
 
+$panel->check_public();
+
 my $template;
 my $subtemplate;
 my $repos;
@@ -59,7 +61,6 @@
 my $objs;
 
 my $name = $cgi->param("name");
-$name = Vhffs::Functions::check_arg( $name );
 
 
 my $group;
@@ -67,20 +68,21 @@
 
 if( ! defined $name )
 {
-	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
+	$template = new HTML::Template( filename => $templatedir.'/public/simplemsg.tmpl' );
 	$message = gettext( "CGI ERROR!");
 	$template->param( MESSAGE => $message );
 }
 elsif( ! defined ($group= Vhffs::Group::get_by_groupname( $vhffs , $name ) ) )
 {
 
-	$template = new HTML::Template( filename => $templatedir."/misc/simplemsg.tmpl" );
+	$template = new HTML::Template( filename => $templatedir.'/public/simplemsg.tmpl' );
 	$message = gettext( "No such group");
 	$template->param( MESSAGE => $message );
 
 }
 else
 {
+    $name = Vhffs::Functions::check_arg( $name );
 	$template = new HTML::Template( filename => $templatedir."/public/group.tmpl" );
 	$template->param( THEME => Vhffs::Panel::Main::get_theme( $vhffs ) );
 	$template->param( TEXT_TITLE => $group->get_groupname );

Modified: trunk/vhffs-panel/public/index.pl
===================================================================
--- trunk/vhffs-panel/public/index.pl	2007-04-21 19:41:41 UTC (rev 589)
+++ trunk/vhffs-panel/public/index.pl	2007-04-22 07:43:27 UTC (rev 590)
@@ -51,6 +51,8 @@
 my $cgi = $panel->{'cgi'};
 my $hostname = $vhffs->get_config->get_host_name;
 
+$panel->check_public();
+
 my $template;
 my $subtemplate;
 

Modified: trunk/vhffs-panel/public/lastgroups.pl
===================================================================
--- trunk/vhffs-panel/public/lastgroups.pl	2007-04-21 19:41:41 UTC (rev 589)
+++ trunk/vhffs-panel/public/lastgroups.pl	2007-04-22 07:43:27 UTC (rev 590)
@@ -48,6 +48,8 @@
 my $templatedir = $panel->{'templatedir'};
 my $cgi = $panel->{'cgi'};
 
+$panel->check_public();
+
 my $template;
 my $subtemplate;
 my $group;

Modified: trunk/vhffs-panel/public/lastusers.pl
===================================================================
--- trunk/vhffs-panel/public/lastusers.pl	2007-04-21 19:41:41 UTC (rev 589)
+++ trunk/vhffs-panel/public/lastusers.pl	2007-04-22 07:43:27 UTC (rev 590)
@@ -51,6 +51,8 @@
 my $templatedir = $panel->{'templatedir'};
 my $cgi = $panel->{'cgi'};
 
+$panel->check_public();
+
 my $template;
 my $users = Vhffs::User::get_last_users( $vhffs );
 my $output_final = "";	

Modified: trunk/vhffs-panel/public/rss/lastgroups.pl
===================================================================
--- trunk/vhffs-panel/public/rss/lastgroups.pl	2007-04-21 19:41:41 UTC (rev 589)
+++ trunk/vhffs-panel/public/rss/lastgroups.pl	2007-04-22 07:43:27 UTC (rev 590)
@@ -40,11 +40,12 @@
 use strict;
 
 my $vhffs = init Vhffs::Main;
+
 my $url;
 $url = "" if( ! defined ( $url = $vhffs->get_config->get_panel_url ) );
 
 
-if( $vhffs->get_config->get_panel_rss_groups == 1 )
+if( $vhffs->get_config->get_panel_rss_groups == 1 && $vhffs->get_config->get_panel_public == 1)
 {
 	my $groups = Vhffs::Group::get_last_groups( $vhffs );
 	

Modified: trunk/vhffs-panel/public/rss/lastusers.pl
===================================================================
--- trunk/vhffs-panel/public/rss/lastusers.pl	2007-04-21 19:41:41 UTC (rev 589)
+++ trunk/vhffs-panel/public/rss/lastusers.pl	2007-04-22 07:43:27 UTC (rev 590)
@@ -43,7 +43,7 @@
 my $url;
 $url = "" if( ! defined ( $url = $vhffs->get_config->get_panel_url ) );
 
-if( $vhffs->get_config->get_panel_rss_users == 1 )
+if( $vhffs->get_config->get_panel_rss_users == 1 && $vhffs->get_config->get_panel_public == 1 )
 {
 	my $users = Vhffs::User::get_last_users( $vhffs );
 

Modified: trunk/vhffs-panel/public/user.pl
===================================================================
--- trunk/vhffs-panel/public/user.pl	2007-04-21 19:41:41 UTC (rev 589)
+++ trunk/vhffs-panel/public/user.pl	2007-04-22 07:43:27 UTC (rev 590)
@@ -52,6 +52,8 @@
 my $templatedir = $panel->{'templatedir'};
 my $cgi = $panel->{'cgi'};
 
+$panel->check_public();
+
 my $template;
 my $subtemplate;
 

Modified: trunk/vhffs-panel/public/websearch.pl
===================================================================
--- trunk/vhffs-panel/public/websearch.pl	2007-04-21 19:41:41 UTC (rev 589)
+++ trunk/vhffs-panel/public/websearch.pl	2007-04-22 07:43:27 UTC (rev 590)
@@ -52,6 +52,8 @@
 my $templatedir = $panel->{'templatedir'};
 my $cgi = $panel->{'cgi'};
 
+$panel->check_public();
+
 my $template;
 my $output_final = "";	
 my $web;

Modified: trunk/vhffs-panel/templates/public/simplemsg.tmpl
===================================================================
--- trunk/vhffs-panel/templates/public/simplemsg.tmpl	2007-04-21 19:41:41 UTC (rev 589)
+++ trunk/vhffs-panel/templates/public/simplemsg.tmpl	2007-04-22 07:43:27 UTC (rev 590)
@@ -1,2 +1,20 @@
-		<h1 class="message"><tmpl_var name="MESSAGE"></h1>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>
+<html xmlns="http://www.w3.org/1999/xhtml";>
+    <head>
 
+        <title><tmpl_var name="TITLE"></title>
+
+        <link rel="stylesheet" type="text/css" href="/themes/<tmpl_var name="THEME">/main.css" />
+        <meta http-equiv="Pragma" content="no-cache" />
+        <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+
+    </head>
+    <body>
+        <div class="logo">
+        </div>
+
+        <div class="misc" id="misc">
+            <h1 class="message"><tmpl_var name="MESSAGE"></h1>
+        </div>
+    </body>
+</html>


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