yolanda/trunk/upload.pl

35 lines
854 B
Perl
Raw Normal View History

#!/usr/bin/perl
require "include.pl";
require "functions.pl";
#create or resume session
CGI::Session->name($session_name);
my $session = new CGI::Session;
my $username = get_username_from_sid($session->id);
%page = ();
#if a username is associated with session id, username is nonempty
$page->{'username'} = $username;
$page->{'locale'} = $locale;
$page->{'stylesheet'} = $stylesheet;
$page->{'xmlns:dc'} = $xmlns_dc;
$page->{'xmlns:cc'} = $xmlns_cc;
$page->{'xmlns:rdf'} = $xmlns_rdf;
if($username)
{
$page->{uploadform} = {'page' => '2'};
}
else
{
$page->{'message'}->{'type'} = "error";
$page->{'message'}->{'text'} = "error_202c";
}
#print xml http header along with session cookie
print $session->header(-type=>'text/xml', -charset=>'UTF-8');
print XMLout($page, KeyAttr => {}, XMLDecl => $XMLDecl, RootName => 'page', AttrIndent => '1');