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" );
|
|
|
|
|
2008-04-27 10:39:21 +00:00
|
|
|
my $page = 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);
|
|
|
|
|
2008-04-27 10:39:21 +00:00
|
|
|
$page = get_page_array(@userinfo);
|
2008-04-27 00:42:15 +00:00
|
|
|
|
|
|
|
my $message = XML::LibXML::Element->new( "message" );
|
|
|
|
$message->setAttribute("type", "information");
|
|
|
|
$message->setAttribute("text", "information_settings_changed");
|
2008-04-27 10:39:21 +00:00
|
|
|
$page->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'});
|
2008-04-27 10:39:21 +00:00
|
|
|
$page->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");
|
2008-04-27 10:39:21 +00:00
|
|
|
$page->appendChild($message);
|
2007-10-27 11:59:23 +00:00
|
|
|
}
|
|
|
|
|
2008-04-27 10:39:21 +00:00
|
|
|
$doc->setDocumentElement($page);
|
2008-04-27 00:42:15 +00:00
|
|
|
|
|
|
|
output_page($doc);
|