all xml are created on the fly
git-svn-id: http://yolanda.mister-muffin.de/svn@52 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
parent
bd398c9423
commit
9e26059341
6 changed files with 15 additions and 21 deletions
|
@ -4,13 +4,12 @@ use CGI qw(:standard);
|
||||||
use CGI::Session;
|
use CGI::Session;
|
||||||
use DBI;
|
use DBI;
|
||||||
use XML::Simple qw(:strict);
|
use XML::Simple qw(:strict);
|
||||||
use Digest::SHA;
|
use Digest::SHA qw(sha256_hex);
|
||||||
use Encode;
|
use Encode qw(decode_utf8);
|
||||||
|
|
||||||
$gnutube_root = '/var/www/gnutube';
|
$gnutube_root = '/var/www/gnutube';
|
||||||
|
|
||||||
use lib qw(/var/www/gnutube);
|
use lib qw(/var/www/gnutube);
|
||||||
#use Digest::SHA qw(sha256_hex);
|
|
||||||
|
|
||||||
#set global variables
|
#set global variables
|
||||||
$database = 'gnutube';
|
$database = 'gnutube';
|
||||||
|
@ -19,4 +18,7 @@ $dbuser = 'root';
|
||||||
$dbpass = '';
|
$dbpass = '';
|
||||||
$session_name = 'sid';
|
$session_name = 'sid';
|
||||||
$XMLDecl = '<?xml version="1.0" encoding="UTF-8" ?><?xml-stylesheet type="text/xsl" href="./xsl/xhtml.xsl" ?>';
|
$XMLDecl = '<?xml version="1.0" encoding="UTF-8" ?><?xml-stylesheet type="text/xsl" href="./xsl/xhtml.xsl" ?>';
|
||||||
|
$locale = "en-US";
|
||||||
|
$stylesheet = "./style/gnutube.css";
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
@ -10,8 +10,8 @@ my $session = new CGI::Session;
|
||||||
|
|
||||||
#if a username is associated with session id, username is nonempty
|
#if a username is associated with session id, username is nonempty
|
||||||
$page->{username} = get_username_from_sid($session->id);
|
$page->{username} = get_username_from_sid($session->id);
|
||||||
$page->{locale} = "en-US";
|
$page->{locale} = $locale;
|
||||||
$page->{stylesheet} = "./style/gnutube.css";
|
$page->{stylesheet} = $stylesheet;
|
||||||
$page->{frontpage} = [''];
|
$page->{frontpage} = [''];
|
||||||
|
|
||||||
fill_tagcloud;
|
fill_tagcloud;
|
||||||
|
|
|
@ -68,10 +68,13 @@ else
|
||||||
{
|
{
|
||||||
#if not, print login form
|
#if not, print login form
|
||||||
|
|
||||||
$page = XMLin("$gnutube_root/login.xml", ForceArray => 1, KeyAttr => {} );
|
%page = ();
|
||||||
|
|
||||||
#if a username is associated with session id, username is nonempty
|
#if a username is associated with session id, username is nonempty
|
||||||
$page->{username} = get_username_from_sid($session->id);
|
$page->{username} = get_username_from_sid($session->id);
|
||||||
|
$page->{locale} = $locale;
|
||||||
|
$page->{stylesheet} = $stylesheet;
|
||||||
|
$page->{loginform} = [''];
|
||||||
|
|
||||||
#print xml http header along with session cookie
|
#print xml http header along with session cookie
|
||||||
print $session->header(-type=>'text/xml');
|
print $session->header(-type=>'text/xml');
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
<page
|
|
||||||
locale="en-US"
|
|
||||||
stylesheet="./style/gnutube.css"
|
|
||||||
username=""
|
|
||||||
>
|
|
||||||
<loginform />
|
|
||||||
</page>
|
|
|
@ -33,10 +33,13 @@ else
|
||||||
{
|
{
|
||||||
#if not, print register form
|
#if not, print register form
|
||||||
|
|
||||||
$page = XMLin("$gnutube_root/register.xml", ForceArray => 1, KeyAttr => {} );
|
%page = ();
|
||||||
|
|
||||||
#if a username is associated with session id, username is nonempty
|
#if a username is associated with session id, username is nonempty
|
||||||
$page->{username} = get_username_from_sid($session->id);
|
$page->{username} = get_username_from_sid($session->id);
|
||||||
|
$page->{locale} = $locale;
|
||||||
|
$page->{stylesheet} = $stylesheet;
|
||||||
|
$page->{registerform} = [''];
|
||||||
|
|
||||||
#print xml http header along with session cookie
|
#print xml http header along with session cookie
|
||||||
print $session->header(-type=>'text/xml');
|
print $session->header(-type=>'text/xml');
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
<page
|
|
||||||
locale="en-US"
|
|
||||||
stylesheet="./style/gnutube.css"
|
|
||||||
username=""
|
|
||||||
>
|
|
||||||
<registerform />
|
|
||||||
</page>
|
|
Loading…
Reference in a new issue