4 use CXGN
::DB
::Connection
;
5 use CXGN
::Scrap
::AjaxPage
;
9 my $page = CXGN
::Scrap
::AjaxPage
->new();
10 my $dbh = CXGN
::DB
::Connection
->new();
12 my %args = $page->get_all_encoded_arguments();
13 $page->caller("UserPrefs");
14 $page->send_http_header();
15 print $page->header();
23 my $user_prefs = $args{user_prefs
};
24 my $sgn_session_id = $args{sgn_session_id
};
26 my $sp_person_id = undef;
28 $sp_person_id = CXGN
::Login
->new($dbh)->query_from_cookie($sgn_session_id);
31 $sp_person_id = CXGN
::Login
->new($dbh)->has_session();
35 if($sp_person_id && $user_prefs){
36 my $up = CXGN
::UserPrefs
->new($dbh,$sp_person_id);
37 $up->set_user_pref_string($user_prefs);
43 $errmsg .= "sp_person_id could not be resolved\n";
46 $errmsg .= "user_prefs was found in arguments list\n";
55 print "<updated>$updated</updated>\n";
57 print "<errmsg>$errmsg</errmsg>\n";
60 print "<fatalmsg>$fatalmsg</fatalmsg>\n";
63 print $page->footer();