2007-10-27 11:59:23 +00:00
require "functions.pl" ;
#initialize session data
CGI::Session - > name ( $ session_name ) ;
$ query = new CGI ;
$ session = new CGI:: Session ;
2007-10-29 15:00:40 +00:00
@ userinfo = get_userinfo_from_sid ( $ session - > id ) ;
2007-10-27 11:59:23 +00:00
2007-12-17 12:38:02 +00:00
if ( $ userinfo - > { 'username' } )
{
2008-02-14 22:15:38 +00:00
if ( $ query - > param ( 'submit' ) )
{
2008-04-03 12:44:59 +00:00
$ dbh - > do ( qq{ update users set locale = ?, pagesize = ? where id = ? } , undef , $ query - > param ( 'locale' ) , $ query - > param ( 'pagesize' ) , $ userinfo - > { 'id' } ) or die $ dbh - > errstr ;
2008-02-14 22:15:38 +00:00
$ page - > { 'message' } - > { 'type' } = "information" ;
$ page - > { 'message' } - > { 'text' } = "information_settings_changed" ;
}
2007-12-17 12:38:02 +00:00
}
@ userinfo = get_userinfo_from_sid ( $ session - > id ) ;
2007-10-29 15:00:40 +00:00
@ page = get_page_array ( @ userinfo ) ;
2008-02-14 22:15:38 +00:00
2007-10-29 15:00:40 +00:00
if ( $ userinfo - > { 'username' } )
2007-10-27 11:59:23 +00:00
{
2008-02-14 22:15:38 +00:00
$ page - > { 'settings' } - > { 'locale' } = $ userinfo - > { 'locale' } ;
$ page - > { 'settings' } - > { 'pagesize' } = $ userinfo - > { 'pagesize' } ;
2007-10-27 11:59:23 +00:00
}
else
{
2008-02-14 22:15:38 +00:00
$ page - > { 'message' } - > { 'type' } = "error" ;
$ page - > { 'message' } - > { 'text' } = "error_202c" ;
2007-10-27 11:59:23 +00:00
}
2007-12-17 18:55:33 +00:00
print output_page ( ) ;