diff --git a/trunk/download.pl b/trunk/download.pl index 9e7b45a..1d27557 100644 --- a/trunk/download.pl +++ b/trunk/download.pl @@ -68,9 +68,24 @@ if($query->param('id')) } else { - #the requested id doesn't exist - print $session->header(); - print "this video doesn't exist"; + %page = (); + + #if a username is associated with session id, username is nonempty + $page->{'username'} = get_username_from_sid($session->id); + $page->{'locale'} = $locale; + $page->{'stylesheet'} = $stylesheet; + $page->{'xmlns:dc'} = $xmlns_dc; + $page->{'xmlns:cc'} = $xmlns_cc; + $page->{'xmlns:rdf'} = $xmlns_rdf; + + $page->{'message'}->{'type'} = "error"; + $page->{'message'}->{'text'} = "error_202c"; + + #print xml http header along with session cookie + print $session->header(-type=>'text/xml'); + + #print xml + print XMLout($page, KeyAttr => {}, XMLDecl => $XMLDecl, RootName => 'page'); } #disconnect db @@ -78,7 +93,22 @@ if($query->param('id')) } else { - #if not, print error - print $session->header(); - print "you stupid moron forgot to pass an id..."; + %page = (); + + #if a username is associated with session id, username is nonempty + $page->{'username'} = get_username_from_sid($session->id); + $page->{'locale'} = $locale; + $page->{'stylesheet'} = $stylesheet; + $page->{'xmlns:dc'} = $xmlns_dc; + $page->{'xmlns:cc'} = $xmlns_cc; + $page->{'xmlns:rdf'} = $xmlns_rdf; + + $page->{'message'}->{'type'} = "error"; + $page->{'message'}->{'text'} = "error_202c"; + + #print xml http header along with session cookie + print $session->header(-type=>'text/xml'); + + #print xml + print XMLout($page, KeyAttr => {}, XMLDecl => $XMLDecl, RootName => 'page'); } diff --git a/trunk/search.pl b/trunk/search.pl index afb28ae..22421db 100644 --- a/trunk/search.pl +++ b/trunk/search.pl @@ -127,6 +127,22 @@ elsif($query->param('sort')) } else { - print $session->header(); - print "no query passed"; + %page = (); + + #if a username is associated with session id, username is nonempty + $page->{'username'} = get_username_from_sid($session->id); + $page->{'locale'} = $locale; + $page->{'stylesheet'} = $stylesheet; + $page->{'xmlns:dc'} = $xmlns_dc; + $page->{'xmlns:cc'} = $xmlns_cc; + $page->{'xmlns:rdf'} = $xmlns_rdf; + + $page->{'message'}->{'type'} = "error"; + $page->{'message'}->{'text'} = "error_202c"; + + #print xml http header along with session cookie + print $session->header(-type=>'text/xml'); + + #print xml + print XMLout($page, KeyAttr => {}, XMLDecl => $XMLDecl, RootName => 'page'); } diff --git a/trunk/upload.pl b/trunk/upload.pl index 0bc8094..0064225 100644 --- a/trunk/upload.pl +++ b/trunk/upload.pl @@ -13,9 +13,12 @@ if($username) %page = (); #if a username is associated with session id, username is nonempty - $page->{username} = get_username_from_sid($session->id); - $page->{locale} = $locale; - $page->{stylesheet} = $stylesheet; + $page->{'username'} = get_username_from_sid($session->id); + $page->{'locale'} = $locale; + $page->{'stylesheet'} = $stylesheet; + $page->{'xmlns:dc'} = $xmlns_dc; + $page->{'xmlns:cc'} = $xmlns_cc; + $page->{'xmlns:rdf'} = $xmlns_rdf; $page->{uploadform} = ['']; #print xml http header along with session cookie @@ -25,6 +28,22 @@ if($username) } else { - print $session->header(); - print "nope..."; + %page = (); + + #if a username is associated with session id, username is nonempty + $page->{'username'} = get_username_from_sid($session->id); + $page->{'locale'} = $locale; + $page->{'stylesheet'} = $stylesheet; + $page->{'xmlns:dc'} = $xmlns_dc; + $page->{'xmlns:cc'} = $xmlns_cc; + $page->{'xmlns:rdf'} = $xmlns_rdf; + + $page->{'message'}->{'type'} = "error"; + $page->{'message'}->{'text'} = "error_202c"; + + #print xml http header along with session cookie + print $session->header(-type=>'text/xml'); + + #print xml + print XMLout($page, KeyAttr => {}, XMLDecl => $XMLDecl, RootName => 'page'); } diff --git a/trunk/uploader.pl b/trunk/uploader.pl index 7388bc7..56e200f 100644 --- a/trunk/uploader.pl +++ b/trunk/uploader.pl @@ -59,6 +59,22 @@ if($userid) } else { - print $session->header(); - print "nope..."; + %page = (); + + #if a username is associated with session id, username is nonempty + $page->{'username'} = get_username_from_sid($session->id); + $page->{'locale'} = $locale; + $page->{'stylesheet'} = $stylesheet; + $page->{'xmlns:dc'} = $xmlns_dc; + $page->{'xmlns:cc'} = $xmlns_cc; + $page->{'xmlns:rdf'} = $xmlns_rdf; + + $page->{'message'}->{'type'} = "error"; + $page->{'message'}->{'text'} = "error_202c"; + + #print xml http header along with session cookie + print $session->header(-type=>'text/xml'); + + #print xml + print XMLout($page, KeyAttr => {}, XMLDecl => $XMLDecl, RootName => 'page'); } diff --git a/trunk/video.pl b/trunk/video.pl index 7f9dc1f..028cf29 100644 --- a/trunk/video.pl +++ b/trunk/video.pl @@ -52,8 +52,9 @@ if($query->param('title') or $query->param('id')) if($rowcount == 0) { #still no results - #there is nothing we can do now - this video doesn't exist... - #TODO: insert error output + #there is nothing we can do now - this video doesn't exist... + $page->{'message'}->{'type'} = "error"; + $page->{'message'}->{'text'} = "error_202c"; } elsif($rowcount == 1) { @@ -162,6 +163,22 @@ if($query->param('title') or $query->param('id')) } else { - print $session->header(); - print "no query passed"; + %page = (); + + #if a username is associated with session id, username is nonempty + $page->{'username'} = get_username_from_sid($session->id); + $page->{'locale'} = $locale; + $page->{'stylesheet'} = $stylesheet; + $page->{'xmlns:dc'} = $xmlns_dc; + $page->{'xmlns:cc'} = $xmlns_cc; + $page->{'xmlns:rdf'} = $xmlns_rdf; + + $page->{'message'}->{'type'} = "error"; + $page->{'message'}->{'text'} = "error_202c"; + + #print xml http header along with session cookie + print $session->header(-type=>'text/xml'); + + #print xml + print XMLout($page, KeyAttr => {}, XMLDecl => $XMLDecl, RootName => 'page'); }