diff --git a/trunk/include.pl b/trunk/include.pl index 548bdbe..906cc7b 100644 --- a/trunk/include.pl +++ b/trunk/include.pl @@ -4,13 +4,12 @@ use CGI qw(:standard); use CGI::Session; use DBI; use XML::Simple qw(:strict); -use Digest::SHA; -use Encode; +use Digest::SHA qw(sha256_hex); +use Encode qw(decode_utf8); $gnutube_root = '/var/www/gnutube'; use lib qw(/var/www/gnutube); -#use Digest::SHA qw(sha256_hex); #set global variables $database = 'gnutube'; @@ -19,4 +18,7 @@ $dbuser = 'root'; $dbpass = ''; $session_name = 'sid'; $XMLDecl = ''; +$locale = "en-US"; +$stylesheet = "./style/gnutube.css"; + 1; diff --git a/trunk/index.pl b/trunk/index.pl index b3e4964..570e465 100644 --- a/trunk/index.pl +++ b/trunk/index.pl @@ -10,8 +10,8 @@ my $session = new CGI::Session; #if a username is associated with session id, username is nonempty $page->{username} = get_username_from_sid($session->id); -$page->{locale} = "en-US"; -$page->{stylesheet} = "./style/gnutube.css"; +$page->{locale} = $locale; +$page->{stylesheet} = $stylesheet; $page->{frontpage} = ['']; fill_tagcloud; diff --git a/trunk/login.pl b/trunk/login.pl index 1614d8c..52e8745 100644 --- a/trunk/login.pl +++ b/trunk/login.pl @@ -68,10 +68,13 @@ else { #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 $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 $session->header(-type=>'text/xml'); diff --git a/trunk/login.xml b/trunk/login.xml deleted file mode 100644 index 341c88e..0000000 --- a/trunk/login.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - diff --git a/trunk/register.pl b/trunk/register.pl index 66d0f7a..d13656b 100644 --- a/trunk/register.pl +++ b/trunk/register.pl @@ -33,10 +33,13 @@ else { #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 $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 $session->header(-type=>'text/xml'); diff --git a/trunk/register.xml b/trunk/register.xml deleted file mode 100644 index 1eb28b6..0000000 --- a/trunk/register.xml +++ /dev/null @@ -1,7 +0,0 @@ - - -