global XMLDecl variable, sanitized register.pl, cleaned xml

git-svn-id: http://yolanda.mister-muffin.de/svn@47 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
josch 2007-10-11 23:47:13 +00:00
parent acd23bda67
commit fc5300dc09
8 changed files with 23 additions and 16 deletions

View file

@ -17,4 +17,5 @@ $dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$session_name = 'sid';
$XMLDecl = '<?xml version="1.0" encoding="UTF-8" ?><?xml-stylesheet type="text/xsl" href="./xsl/xhtml.xsl" ?>';
1;

View file

@ -18,6 +18,6 @@ fill_tagcloud;
print $session->header(-type=>'text/xml');
#print xml
print XMLout($page, KeyAttr => {}, XMLDecl => '<?xml version="1.0" encoding="ISO-8859-1" ?><?xml-stylesheet type="text/xsl" href="./xsl/xhtml.xsl" ?>', RootName => 'page');
print XMLout($page, KeyAttr => {}, XMLDecl => $XMLDecl, RootName => 'page');

View file

@ -1,6 +1,3 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet type="text/xsl" href="./xsl/xhtml.xsl" ?>
<page
locale="en-US"
stylesheet="./style/gnutube.css"

View file

@ -1,5 +1,6 @@
#!/usr/bin/perl
require "include.pl";
require "functions.pl";
#initialize session data
CGI::Session->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 '<?xml version="1.0" encoding="ISO-8859-1" ?>'; # josch, sanitize this
print '<?xml-stylesheet type="text/xsl" href="./xsl/xhtml.xsl" ?>'; # josch, sanitize this
print '<page locale="en-US" stylesheet="./style/gnutube.css" username="">'; # josch, sanitize this
print '<registerform />';
print '</page>'; # 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');
}

7
trunk/register.xml Normal file
View file

@ -0,0 +1,7 @@
<page
locale="en-US"
stylesheet="./style/gnutube.css"
username=""
>
<registerform />
</page>

View file

@ -60,7 +60,7 @@ if($query->param('query'))
print $session->header(-type=>'text/xml');
#print xml
print XMLout($page, KeyAttr => {}, XMLDecl => '<?xml version="1.0" encoding="ISO-8859-1" ?><?xml-stylesheet type="text/xsl" href="./xsl/xhtml.xsl" ?>', RootName => 'page');
print XMLout($page, KeyAttr => {}, XMLDecl => $XMLDecl, RootName => 'page');
}
else
{

View file

@ -1,10 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet type="text/xsl" href="./xsl/xhtml.xsl" ?>
<page
locale="en-US"
stylesheet="./style/gnutube.css"
username="pedobear@myopenid.net"
username=""
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

View file

@ -245,7 +245,7 @@
</fieldset>
</form>
<div>
</div>
</xsl:template>