2007-10-27 11:59:23 +00:00
|
|
|
require "functions.pl";
|
|
|
|
|
|
|
|
#initialize session data
|
2008-04-15 18:56:13 +00:00
|
|
|
CGI::Session->name($config->{"page_cookie_name"});
|
2007-10-27 11:59:23 +00:00
|
|
|
$query = new CGI;
|
|
|
|
$session = new CGI::Session;
|
|
|
|
|
2008-04-27 00:42:15 +00:00
|
|
|
my @userinfo = get_userinfo_from_sid($session->id);
|
|
|
|
|
|
|
|
my $doc = XML::LibXML::Document->new( "1.0", "UTF-8" );
|
|
|
|
|
|
|
|
my $root = get_page_array(@userinfo);
|
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-23 07:08:14 +00:00
|
|
|
$dbh->do(qq{update users set pagesize = ? where id = ?}, undef, $query->param('pagesize'), $userinfo->{'id'} ) or die $dbh->errstr;
|
2008-02-14 22:15:38 +00:00
|
|
|
|
2008-04-27 00:42:15 +00:00
|
|
|
@userinfo = get_userinfo_from_sid($session->id);
|
|
|
|
|
|
|
|
$root = get_page_array(@userinfo);
|
|
|
|
|
|
|
|
my $message = XML::LibXML::Element->new( "message" );
|
|
|
|
$message->setAttribute("type", "information");
|
|
|
|
$message->setAttribute("text", "information_settings_changed");
|
|
|
|
$root->appendChild($message);
|
2008-02-14 22:15:38 +00:00
|
|
|
}
|
2007-12-17 12:38:02 +00:00
|
|
|
}
|
|
|
|
|
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-04-27 00:42:15 +00:00
|
|
|
my $settings = XML::LibXML::Element->new( "settings" );
|
|
|
|
$settings->setAttribute("pagesize", $userinfo->{'pagesize'});
|
|
|
|
$root->appendChild($settings);
|
2007-10-27 11:59:23 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-04-27 00:42:15 +00:00
|
|
|
my $message = XML::LibXML::Element->new( "message" );
|
|
|
|
$message->setAttribute("type", "error");
|
|
|
|
$message->setAttribute("text", "error_202c");
|
|
|
|
$root->appendChild($message);
|
2007-10-27 11:59:23 +00:00
|
|
|
}
|
|
|
|
|
2008-04-27 00:42:15 +00:00
|
|
|
$doc->setDocumentElement($root);
|
|
|
|
|
|
|
|
output_page($doc);
|