[vhffs-dev] [446] Now using light panel API for public pages, fixed an error string in subscribe.pl

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


Revision: 446
Author:   gradator
Date:     2007-02-11 20:30:53 +0000 (Sun, 11 Feb 2007)

Log Message:
-----------
Now using light panel API for public pages, fixed an error string in subscribe.pl

Modified Paths:
--------------
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Main.pm
    branches/vhffs_4.1/vhffs-panel/auth.pl
    branches/vhffs_4.1/vhffs-panel/lost.pl
    branches/vhffs_4.1/vhffs-panel/panel.pl
    branches/vhffs_4.1/vhffs-panel/public/allgroups.pl
    branches/vhffs_4.1/vhffs-panel/public/allwebsites.pl
    branches/vhffs_4.1/vhffs-panel/public/group.pl
    branches/vhffs_4.1/vhffs-panel/public/index.pl
    branches/vhffs_4.1/vhffs-panel/public/lastgroups.pl
    branches/vhffs_4.1/vhffs-panel/public/lastusers.pl
    branches/vhffs_4.1/vhffs-panel/public/user.pl
    branches/vhffs_4.1/vhffs-panel/public/websearch.pl
    branches/vhffs_4.1/vhffs-panel/subscribe.pl
    trunk/vhffs-panel/subscribe.pl


Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Main.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Main.pm	2007-02-10 17:44:32 UTC (rev 445)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Main.pm	2007-02-11 20:30:53 UTC (rev 446)
@@ -26,7 +26,6 @@
 	my $templatedir = $vhffs->get_config->get_templatedir;
 	my $template;	
 
-
 	if( $vhffs->is_valid() == 0 )
 	{   
 		$template = new HTML::Template( filename => $templatedir."/main/close.tmpl" );
@@ -48,6 +47,8 @@
 		display_light Vhffs::Panel::Main( $template );
 		exit( 0 );
 	}
+
+	return 0;
 }
 
 
@@ -200,6 +201,8 @@
 	( $lang, $langcookie ) = cookie_lang( $vhffs , $cgi );
 	( $theme, $themecookie ) = cookie_theme( $vhffs , $cgi );
 
+	Vhffs::Panel::Main::check( $vhffs );
+
 	my $config = $vhffs->get_config;
 	my $templatedir = $vhffs->get_config->get_templatedir;
 
@@ -627,6 +630,8 @@
 	my ( $lang, $langcookie ) = cookie_lang( $vhffs , $cgi );
 	my ( $theme, $themecookie ) = cookie_theme( $vhffs , $cgi );
 
+	Vhffs::Panel::Main::check( $vhffs );
+
 	my $data = {};
 	$data->{'vhffs'} = $vhffs;
 	$data->{'templatedir'} = $templatedir;

Modified: branches/vhffs_4.1/vhffs-panel/auth.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/auth.pl	2007-02-10 17:44:32 UTC (rev 445)
+++ branches/vhffs_4.1/vhffs-panel/auth.pl	2007-02-11 20:30:53 UTC (rev 446)
@@ -42,19 +42,15 @@
 use Vhffs::Panel::Main;
 use Vhffs::Constants;
 
-my $vhffs = init Vhffs::Main;
+my $panel = new_light Vhffs::Panel::Main();
+my $vhffs = $panel->{'vhffs'};
+my $templatedir = $panel->{'templatedir'};
 
-my $templatedir = $vhffs->get_config->get_templatedir;
 my $hostname = $vhffs->get_config->get_host_name;
-my $cgi = new CGI;
-my $template;
 
-Vhffs::Panel::Main::check( $vhffs );
+#my $template = new HTML::Template( filename => $templatedir."/main/auth.tmpl", associate => $cgi );
+my $template = new HTML::Template( filename => $templatedir."/main/auth.tmpl" );
 
-my $panel = new_light Vhffs::Panel::Main();
-
-$template = new HTML::Template( filename => $templatedir."/main/auth.tmpl", associate => $cgi );
-
 $template->param( TITLE => gettext("VHFFS Login") );
 $template->param( TEXT_WELCOME => sprintf( gettext("Welcome on %s") , $hostname )   );
 $template->param( VHFFS_INFO => sprintf( "Run VHFFS %s (%s)" , Vhffs::Constants::VHFFS_VERSION , Vhffs::Constants::VHFFS_RELEASE_NAME ) );

Modified: branches/vhffs_4.1/vhffs-panel/lost.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/lost.pl	2007-02-10 17:44:32 UTC (rev 445)
+++ branches/vhffs_4.1/vhffs-panel/lost.pl	2007-02-11 20:30:53 UTC (rev 446)
@@ -44,7 +44,6 @@
 my $panel = new_light Vhffs::Panel::Main();
 my $vhffs = $panel->{'vhffs'};
 my $templatedir = $panel->{'templatedir'};
-
 my $cgi = $panel->{'cgi'};
 
 my $tmpl = new HTML::Template( filename => $templatedir."/main/lost.tmpl", associate => $cgi );

Modified: branches/vhffs_4.1/vhffs-panel/panel.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/panel.pl	2007-02-10 17:44:32 UTC (rev 445)
+++ branches/vhffs_4.1/vhffs-panel/panel.pl	2007-02-11 20:30:53 UTC (rev 446)
@@ -61,9 +61,6 @@
 my $projectname = $cgi->param("project");
 my $templatedir = $vhffs->get_config->get_templatedir;
 
-Vhffs::Panel::Main::check( $vhffs );
-
-
 #We try to know if an admin want to su
 if( defined $su_user )
 {

Modified: branches/vhffs_4.1/vhffs-panel/public/allgroups.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/public/allgroups.pl	2007-02-10 17:44:32 UTC (rev 445)
+++ branches/vhffs_4.1/vhffs-panel/public/allgroups.pl	2007-02-11 20:30:53 UTC (rev 446)
@@ -43,13 +43,14 @@
 use Vhffs::Panel::Main;
 use Vhffs::Constants;
 use CGI;
-my $vhffs = init Vhffs::Main;
-my $cookie = Vhffs::Panel::Main::cookie_lang( $vhffs );
 
-my $cgi = new CGI;
+my $panel = new_light Vhffs::Panel::Main();
+my $vhffs = $panel->{'vhffs'};
+my $cgi = $panel->{'cgi'};
+my $templatedir = $panel->{'templatedir'};
+
 my $subtemplate;
 my $template;
-my $templatedir = $vhffs->get_config->get_templatedir;
 my $group;
 my $letter = ( defined $cgi->param('letter') ? $cgi->param('letter') : 'a' );
 undef $letter if( $letter eq 'all');
@@ -57,9 +58,7 @@
 my $output_final="";
 my $maintemplate = new HTML::Template( filename => $templatedir."/public/lastgroups.tmpl" );
 
-my $hostname;
-$hostname = $vhffs->get_config->get_host_name;
-$hostname = "VHFFS" if( ! defined $hostname );
+my $hostname = $vhffs->get_config->get_host_name;
 
 
 $maintemplate->param( THEME => Vhffs::Panel::Main::get_theme( $vhffs ) );
@@ -117,4 +116,6 @@
 $maintemplate->param( BANNER => $subtemplate->output );
 
 $maintemplate->param( VALUES => $output_final );
-print "Content-Type: text/html; charset=utf-8\n\n" . $maintemplate->output;
+
+
+display_light Vhffs::Panel::Main( $panel , $maintemplate );

Modified: branches/vhffs_4.1/vhffs-panel/public/allwebsites.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/public/allwebsites.pl	2007-02-10 17:44:32 UTC (rev 445)
+++ branches/vhffs_4.1/vhffs-panel/public/allwebsites.pl	2007-02-11 20:30:53 UTC (rev 446)
@@ -46,11 +46,12 @@
 use Vhffs::Panel::Main;
 use Vhffs::Services::Httpd;
 
-my $vhffs = init Vhffs::Main;
-my $cookie = Vhffs::Panel::Main::cookie_lang( $vhffs );
-my $cgi = new CGI;
+my $panel = new_light Vhffs::Panel::Main();
+my $vhffs = $panel->{'vhffs'};
+my $cgi = $panel->{'cgi'};
+my $templatedir = $panel->{'templatedir'};
+
 my $template;
-my $templatedir = $vhffs->get_config->get_templatedir;
 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) );
 undef $letter if ( $letter eq 'all' );
@@ -104,4 +105,4 @@
 $maintemplate->param( BANNER => $subtemplate->output );
 
 
-print "Content-Type: text/html; charset=utf-8\n\n" . $maintemplate->output;
+display_light Vhffs::Panel::Main( $panel , $maintemplate );

Modified: branches/vhffs_4.1/vhffs-panel/public/group.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/public/group.pl	2007-02-10 17:44:32 UTC (rev 445)
+++ branches/vhffs_4.1/vhffs-panel/public/group.pl	2007-02-11 20:30:53 UTC (rev 446)
@@ -47,12 +47,13 @@
 use Vhffs::Panel::Main;
 use Vhffs::Functions;
 
-my $vhffs = init Vhffs::Main;
-my $cookie = Vhffs::Panel::Main::cookie_lang( $vhffs );
+my $panel = new_light Vhffs::Panel::Main();
+my $vhffs = $panel->{'vhffs'};
+my $cgi = $panel->{'cgi'};
+my $templatedir = $panel->{'templatedir'};
+
 my $template;
 my $subtemplate;
-my $templatedir = $vhffs->get_config->get_templatedir;
-my $cgi = new CGI;
 my $repos;
 my $files;
 my $objs;
@@ -225,6 +226,6 @@
 	$subtemplate->param( SEARCH => gettext( "Search:" ) );
 	$template->param( BANNER => $subtemplate->output );
 }
-print "Content-Type: text/html; charset=utf-8\n\n" . $template->output;
 
 
+display_light Vhffs::Panel::Main( $panel , $template );

Modified: branches/vhffs_4.1/vhffs-panel/public/index.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/public/index.pl	2007-02-10 17:44:32 UTC (rev 445)
+++ branches/vhffs_4.1/vhffs-panel/public/index.pl	2007-02-11 20:30:53 UTC (rev 446)
@@ -44,18 +44,16 @@
 use Vhffs::Acl;
 use Vhffs::Constants;
 use Vhffs::Panel::Main;
-my $vhffs = init Vhffs::Main;
+
+my $panel = new_light Vhffs::Panel::Main();
+my $vhffs = $panel->{'vhffs'};
+my $templatedir = $panel->{'templatedir'};
+my $cgi = $panel->{'cgi'};
+my $hostname = $vhffs->get_config->get_host_name;
+
 my $template;
 my $subtemplate;
-my $templatedir = $vhffs->get_config->get_templatedir;
-my $hostname;
-my $cgi = new CGI;
 
-$hostname = $vhffs->get_config->get_host_name;
-$hostname = "VHFFS" if( ! defined $hostname );
-my $cookie = Vhffs::Panel::Main::cookie_lang( $vhffs );
-
-
 $template = new HTML::Template( filename => $templatedir."/public/index.tmpl" );
 $template->param( THEME => Vhffs::Panel::Main::get_theme( $vhffs ) );
 
@@ -90,4 +88,4 @@
 $template->param( BANNER => $subtemplate->output );
 
 
-print "Content-Type: text/html; charset=utf-8\n\n" . $template->output;
+display_light Vhffs::Panel::Main( $panel , $template );

Modified: branches/vhffs_4.1/vhffs-panel/public/lastgroups.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/public/lastgroups.pl	2007-02-10 17:44:32 UTC (rev 445)
+++ branches/vhffs_4.1/vhffs-panel/public/lastgroups.pl	2007-02-11 20:30:53 UTC (rev 446)
@@ -43,21 +43,19 @@
 use Vhffs::Panel::Main;
 use CGI;
 
+my $panel = new_light Vhffs::Panel::Main();
+my $vhffs = $panel->{'vhffs'};
+my $templatedir = $panel->{'templatedir'};
+my $cgi = $panel->{'cgi'};
 
-my $vhffs = init Vhffs::Main;
-my $cookie = Vhffs::Panel::Main::cookie_lang( $vhffs );
-my $cgi = new CGI;
 my $template;
 my $subtemplate;
-my $templatedir = $vhffs->get_config->get_templatedir;
 my $group;
 my $groups = Vhffs::Group::get_last_groups( $vhffs );
 my $output_final="";
 my $maintemplate = new HTML::Template( filename => $templatedir."/public/lastgroups.tmpl" );
 
-my $hostname;
-$hostname = $vhffs->get_config->get_host_name;
-$hostname = "VHFFS" if( ! defined $hostname );
+my $hostname = $vhffs->get_config->get_host_name;
 
 
 $maintemplate->param( THEME => Vhffs::Panel::Main::get_theme( $vhffs ) );
@@ -111,4 +109,5 @@
 
 
 $maintemplate->param( VALUES => $output_final );
-print "Content-Type: text/html; charset=utf-8\n\n" . $maintemplate->output;
+
+display_light Vhffs::Panel::Main( $panel , $maintemplate );

Modified: branches/vhffs_4.1/vhffs-panel/public/lastusers.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/public/lastusers.pl	2007-02-10 17:44:32 UTC (rev 445)
+++ branches/vhffs_4.1/vhffs-panel/public/lastusers.pl	2007-02-11 20:30:53 UTC (rev 446)
@@ -45,20 +45,20 @@
 use Vhffs::Constants;
 use Vhffs::Panel::Main;
 use Vhffs::Conf;
-my $vhffs = init Vhffs::Main;
-my $cookie = Vhffs::Panel::Main::cookie_lang( $vhffs );
+
+my $panel = new_light Vhffs::Panel::Main();
+my $vhffs = $panel->{'vhffs'};
+my $templatedir = $panel->{'templatedir'};
+my $cgi = $panel->{'cgi'};
+
 my $template;
-my $templatedir = $vhffs->get_config->get_templatedir;
 my $users = Vhffs::User::get_last_users( $vhffs );
 my $output_final = "";	
 my $user;
 my $maintemplate;
 my $subtemplate;
-my $cgi = new CGI;
 
-my $hostname;
-$hostname = $vhffs->get_config->get_host_name;
-$hostname = "VHFFS" if( ! defined $hostname );
+my $hostname = $vhffs->get_config->get_host_name;
 
 
 $maintemplate = new HTML::Template( filename => $templatedir."/public/lastusers.tmpl" );
@@ -117,4 +117,4 @@
 $maintemplate->param( VALUES => $output_final );
 $maintemplate->param( BANNER => $subtemplate->output );
 
-print "Content-Type: text/html; charset=utf-8\n\n" . $maintemplate->output;
+display_light Vhffs::Panel::Main( $panel , $maintemplate );

Modified: branches/vhffs_4.1/vhffs-panel/public/user.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/public/user.pl	2007-02-10 17:44:32 UTC (rev 445)
+++ branches/vhffs_4.1/vhffs-panel/public/user.pl	2007-02-11 20:30:53 UTC (rev 446)
@@ -47,12 +47,13 @@
 use Vhffs::Panel::Main;
 use Vhffs::Functions;
 
-my $vhffs = init Vhffs::Main;
-my $cookie = Vhffs::Panel::Main::cookie_lang( $vhffs );
+my $panel = new_light Vhffs::Panel::Main();
+my $vhffs = $panel->{'vhffs'};
+my $templatedir = $panel->{'templatedir'};
+my $cgi = $panel->{'cgi'};
+
 my $template;
 my $subtemplate;
-my $templatedir = $vhffs->get_config->get_templatedir;
-my $cgi = new CGI;
 
 my $name = $cgi->param("name");
 $name = Vhffs::Functions::check_arg( $name );
@@ -120,4 +121,4 @@
 
 }
 
-print "Content-Type: text/html; charset=utf-8\n\n" . $template->output;
+display_light Vhffs::Panel::Main( $panel , $template );

Modified: branches/vhffs_4.1/vhffs-panel/public/websearch.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/public/websearch.pl	2007-02-10 17:44:32 UTC (rev 445)
+++ branches/vhffs_4.1/vhffs-panel/public/websearch.pl	2007-02-11 20:30:53 UTC (rev 446)
@@ -47,14 +47,15 @@
 use Vhffs::Services::Httpd;
 use Vhffs::Functions;
 
-my $vhffs = init Vhffs::Main;
+my $panel = new_light Vhffs::Panel::Main();
+my $vhffs = $panel->{'vhffs'};
+my $templatedir = $panel->{'templatedir'};
+my $cgi = $panel->{'cgi'};
+
 my $template;
-my $templatedir = $vhffs->get_config->get_templatedir;
-
 my $output_final = "";	
 my $web;
 my $maintemplate;
-my $cgi = new CGI;
 my $name = $cgi->param("name");
 
 $name = Vhffs::Functions::check_arg( $name );
@@ -90,4 +91,4 @@
 
 $maintemplate->param( VALUES => $output );
 
-print "Content-Type: text/html; charset=utf-8\n\n" . $maintemplate->output;
+display_light Vhffs::Panel::Main( $panel , $maintemplate );

Modified: branches/vhffs_4.1/vhffs-panel/subscribe.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/subscribe.pl	2007-02-10 17:44:32 UTC (rev 445)
+++ branches/vhffs_4.1/vhffs-panel/subscribe.pl	2007-02-11 20:30:53 UTC (rev 446)
@@ -58,8 +58,6 @@
 my $cgi = $panel->{'cgi'};
 my $uid;
 
-Vhffs::Panel::Main::check( $vhffs );
-
 my $submitted	= $cgi->param( "CREATE_SUBMIT" );
 my $mail 		= $cgi->param( "MAIL" );
 my $username 	= $cgi->param( "USERNAME" );
@@ -134,7 +132,7 @@
 	}
 	if( ! ( $lastname =~ /^[\w\d\s\-]+$/ ) )
 	{
-                push(@errors, {error => gettext("Please enter a correct firstname")});
+                push(@errors, {error => gettext("Please enter a correct lastname")});
 	}
 	if( ! ( $city =~ /^[^(\(\)\\\.\_\e\'\")]+$/ ) )
 	{

Modified: trunk/vhffs-panel/subscribe.pl
===================================================================
--- trunk/vhffs-panel/subscribe.pl	2007-02-10 17:44:32 UTC (rev 445)
+++ trunk/vhffs-panel/subscribe.pl	2007-02-11 20:30:53 UTC (rev 446)
@@ -147,7 +147,7 @@
 	}
 	if( ! ( $lastname =~ /^[\w\d\s\-]+$/ ) )
 	{
-                push(@errors, {error => gettext("Please enter a correct firstname")});
+                push(@errors, {error => gettext("Please enter a correct lastname")});
 	}
 	if( ! ( $city =~ /^[^(\(\)\\\.\_\e\'\")]+$/ ) )
 	{


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