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 @@ - - - -
+