[vhffs-dev] [407] Fixes bug #0000083, improved a bit the handling of theme and lang in branch 4.1 (no I don' t want to waste time to fix that in 4. 0 which is becoming more and more obsolete day after day)

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


Revision: 407
Author:   gradator
Date:     2007-01-19 00:56:25 +0000 (Fri, 19 Jan 2007)

Log Message:
-----------
Fixes bug #0000083, improved a bit the handling of theme and lang in branch 4.1 (no I don't want to waste time to fix that in 4.0 which is becoming more and more obsolete day after day)

Modified Paths:
--------------
    branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Main.pm
    trunk/vhffs-api/src/Vhffs/Panel/Main.pm


Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Main.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Main.pm	2007-01-19 00:24:24 UTC (rev 406)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Main.pm	2007-01-19 00:56:25 UTC (rev 407)
@@ -194,11 +194,12 @@
 	my ( $lang, $langcookie );
 	my ( $theme, $themecookie );
 
-	# get current cgi
 	my $cgi = new CGI;
-
-	# Init the Vhffs Main System
 	my $vhffs = init Vhffs::Main;
+
+	( $lang, $langcookie ) = cookie_lang( $vhffs , $cgi );
+	( $theme, $themecookie ) = cookie_theme( $vhffs , $cgi );
+
 	my $config = $vhffs->get_config;
 	my $templatedir = $vhffs->get_config->get_templatedir;
 
@@ -229,8 +230,6 @@
 			$bad_news = gettext("User does not exist");
 		} elsif( $user->get_status != Vhffs::Constants::ACTIVATED ) {
 			$bad_news = gettext("You're are not allowed to browse panel");
-		} else {
-			( $lang, $langcookie ) = cookie_lang( $vhffs , $cgi );
 		}
 	}
 
@@ -239,6 +238,7 @@
 		my $template = new HTML::Template( filename => $templatedir."/main/login_failed.tmpl" );
 		$template->param( TEXT_LOGINFAILED => $bad_news);
 		$template->param( TEXT_LOGIN => gettext("Login") );
+		$template->param( THEME => get_theme( $vhffs ) );
 		print "Content-type: text/html\n\n" , $template->output;
 		return 0;
 	}
@@ -260,11 +260,8 @@
 
 	my $maintemplate = new HTML::Template( filename => $templatedir."/main/panel.tmpl" );
 	$maintemplate->param( PANEL_TITLE => gettext("VHFFS Panel") );
-
-	( $theme, $themecookie ) = cookie_theme( $vhffs , $cgi );
 	$maintemplate->param( THEME => $theme );
 
-
 	my $data = {};
 	$data->{'vhffs'} = $vhffs;
 	$data->{'session'} = $session;

Modified: trunk/vhffs-api/src/Vhffs/Panel/Main.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Main.pm	2007-01-19 00:24:24 UTC (rev 406)
+++ trunk/vhffs-api/src/Vhffs/Panel/Main.pm	2007-01-19 00:56:25 UTC (rev 407)
@@ -166,6 +166,7 @@
 		my $template = new HTML::Template( filename => $templatedir."/main/login_failed.tmpl" );
 		$template->param( TEXT_LOGINFAILED => $bad_news);
 		$template->param( TEXT_LOGIN => gettext("Login") );
+		$template->param( THEME => get_theme( $vhffs ) );
 		print "Content-type: text/html\n\n" , $template->output;
 		return 0;
 	}


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