From fc5300dc0990353a4769f9c75d4428d1200cf6db Mon Sep 17 00:00:00 2001 From: josch Date: Thu, 11 Oct 2007 23:47:13 +0000 Subject: [PATCH] global XMLDecl variable, sanitized register.pl, cleaned xml git-svn-id: http://yolanda.mister-muffin.de/svn@47 7eef14d0-6ed0-489d-bf55-20463b2d70db --- trunk/include.pl | 1 + trunk/index.pl | 2 +- trunk/index.xml | 3 --- trunk/register.pl | 17 +++++++++++------ trunk/register.xml | 7 +++++++ trunk/search.pl | 2 +- trunk/search.xml | 5 +---- trunk/xsl/xhtml.xsl | 2 +- 8 files changed, 23 insertions(+), 16 deletions(-) create mode 100644 trunk/register.xml diff --git a/trunk/include.pl b/trunk/include.pl index 9704ab5..e80ee3f 100644 --- a/trunk/include.pl +++ b/trunk/include.pl @@ -17,4 +17,5 @@ $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = ''; $session_name = 'sid'; +$XMLDecl = ''; 1; diff --git a/trunk/index.pl b/trunk/index.pl index b6505d1..c04e71a 100644 --- a/trunk/index.pl +++ b/trunk/index.pl @@ -18,6 +18,6 @@ fill_tagcloud; print $session->header(-type=>'text/xml'); #print xml -print XMLout($page, KeyAttr => {}, XMLDecl => '', RootName => 'page'); +print XMLout($page, KeyAttr => {}, XMLDecl => $XMLDecl, RootName => 'page'); diff --git a/trunk/index.xml b/trunk/index.xml index 17f6607..71213ae 100755 --- a/trunk/index.xml +++ b/trunk/index.xml @@ -1,6 +1,3 @@ - - - name($session_name); @@ -29,10 +30,14 @@ if($query->param('user') and $query->param('pass')) else { #if not, print register form - print $session->header(); - print ''; # josch, sanitize this - print ''; # josch, sanitize this - print ''; # josch, sanitize this - print ''; - print ''; # josch, sanitize this + + $page = XMLin("$gnutube_root/register.xml", ForceArray => 1, KeyAttr => {} ); + + #if a username is associated with session id, username is nonempty + $page->{username} = get_username_from_sid($session->id); + + #print xml http header along with session cookie + print $session->header(-type=>'text/xml'); + + print XMLout($page, KeyAttr => {}, XMLDecl => $XMLDecl, RootName => 'page'); } diff --git a/trunk/register.xml b/trunk/register.xml new file mode 100644 index 0000000..1eb28b6 --- /dev/null +++ b/trunk/register.xml @@ -0,0 +1,7 @@ + + + diff --git a/trunk/search.pl b/trunk/search.pl index 8e631ac..9095f38 100644 --- a/trunk/search.pl +++ b/trunk/search.pl @@ -60,7 +60,7 @@ if($query->param('query')) print $session->header(-type=>'text/xml'); #print xml - print XMLout($page, KeyAttr => {}, XMLDecl => '', RootName => 'page'); + print XMLout($page, KeyAttr => {}, XMLDecl => $XMLDecl, RootName => 'page'); } else { diff --git a/trunk/search.xml b/trunk/search.xml index b0ed861..376caf4 100755 --- a/trunk/search.xml +++ b/trunk/search.xml @@ -1,10 +1,7 @@ - - - -
+