[vhffs-dev] [372] cookie_lang now produce a long term cookie

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


Revision: 372
Author:   beuss
Date:     2006-12-11 06:18:29 +0000 (Mon, 11 Dec 2006)

Log Message:
-----------
cookie_lang now produce a long term cookie

Modified Paths:
--------------
    branches/vhffs_4.1/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	2006-12-11 06:15:55 UTC (rev 371)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/Panel/Main.pm	2006-12-11 06:18:29 UTC (rev 372)
@@ -94,10 +94,13 @@
 	$cgi = new CGI;
 
 	$lang = $cgi->param( "lang" );
-	$cookie = CGI->cookie( "language" => $lang ) if ( defined $lang );
 	$lang = CGI->cookie( "language" ) if ( ! defined $lang );
-	$lang = $vhffs->get_config->get_default_language() if ( ! defined $lang );
-	$lang = "en_US" if ( ! defined $lang );
+    if ( defined $lang ){
+        $cookie = CGI->cookie( -name=>"language", -value=>$lang, -expires=>'+1y' );
+    } else {
+        $lang = $vhffs->get_config->get_default_language();
+        $lang = "en_US" if ( ! defined $lang );
+    }
 
 	setlocale(LC_ALL, $lang );
 	bindtextdomain("vhffs", $vhffs->get_config->get_intldir);


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