[vhffs-dev] [708] Modified language setting code on user' s prefs page to apply changes immediately.

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


Revision: 708
Author:   beuss
Date:     2007-07-11 08:39:18 +0000 (Wed, 11 Jul 2007)

Log Message:
-----------
Modified language setting code on user's prefs page to apply changes immediately.
Added default value for available shells.

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Conf.pm
    trunk/vhffs-api/src/Vhffs/Panel/User.pm


Modified: trunk/vhffs-api/src/Vhffs/Conf.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Conf.pm	2007-07-11 08:38:12 UTC (rev 707)
+++ trunk/vhffs-api/src/Vhffs/Conf.pm	2007-07-11 08:39:18 UTC (rev 708)
@@ -75,16 +75,16 @@
 				 );
     %Config = $conf->getall();
 
-	$Config{'users'}{'default_city'} = "City" if ( !defined $Config{'users'}{'default_city'} );
-	$Config{'users'}{'default_country'} = "Country" if ( !defined $Config{'users'}{'default_country'} );
-	$Config{'users'}{'default_lastname'} = "Lastname" if ( !defined $Config{'users'}{'default_lastname'} );
-	$Config{'users'}{'default_firstname'} = "Firstname" if ( !defined $Config{'users'}{'default_firstname'} );
-	$Config{'users'}{'default_mail'} = "user\@domain.ex" if ( !defined $Config{'users'}{'default_mail'} );
-	$Config{'users'}{'default_zipcode'} = "121231" if ( !defined $Config{'users'}{'default_zipcode'} );
-	$Config{'users'}{'default_address'} = "1 in the street" if ( !defined $Config{'users'}{'default_address'} );
+	$Config{users}{default_city} = 'City' unless( defined $Config{'users'}{'default_city'} );
+	$Config{users}{default_country} = 'Country' unless( defined $Config{'users'}{'default_country'} );
+	$Config{users}{default_lastname} = 'Lastname' unless( defined $Config{'users'}{'default_lastname'} );
+	$Config{users}{default_firstname} = 'Firstname' unless( defined $Config{'users'}{'default_firstname'} );
+	$Config{users}{default_mail} = 'user\@domain.ex' unless( defined $Config{'users'}{'default_mail'} );
+	$Config{users}{default_zipcode} = '121231' unless( defined $Config{'users'}{'default_zipcode'} );
+	$Config{users}{default_address} = '1 in the street' unless( defined $Config{'users'}{'default_address'} );
+    $Config{users}{available_shells} = '/bin/false' unless( defined $Config{'users'}{'available_shells'} );
+	$Config{users}{default_shell} = '/bin/false' unless( defined $Config{'users'}{'default_shell'} );
 
-	$Config{'users'}{'default_shell'} = "/bin/false" if( ! defined $Config{'users'}{'default_shell'} );
-
     return \%Config;
 }
 

Modified: trunk/vhffs-api/src/Vhffs/Panel/User.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/User.pm	2007-07-11 08:38:12 UTC (rev 707)
+++ trunk/vhffs-api/src/Vhffs/Panel/User.pm	2007-07-11 08:39:18 UTC (rev 708)
@@ -129,6 +129,8 @@
     my $sql = 'UPDATE vhffs_users SET language = ? WHERE uid = ?';
     my $sth = $user->{db}->prepare($sql);
     $sth->execute($lang, $user->get_uid) or return -1;
+    $user->{language} = $lang;
+    setlocale(LC_ALL, $lang);
 }
 
 


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