added xsl login form, fixed register action
git-svn-id: http://yolanda.mister-muffin.de/svn@49 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
parent
6933085e94
commit
1437a10178
3 changed files with 37 additions and 9 deletions
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/perl
|
||||
require "include.pl";
|
||||
require "functions.pl";
|
||||
|
||||
#initialize session data
|
||||
CGI::Session->name($session_name);
|
||||
|
@ -65,12 +66,15 @@ if($query->param('action'))
|
|||
}
|
||||
else
|
||||
{
|
||||
#print login form
|
||||
print $session->header();
|
||||
print '<form action="" method="POST"><p>
|
||||
<input name="action" type="hidden" value="login">
|
||||
<input name="user" type="text" size="30" maxlength="30">
|
||||
<input name="pass" type="password" size="30" maxlength="30">
|
||||
<input type="submit" name="login" value=" login ">
|
||||
</p></form>';
|
||||
#if not, print login form
|
||||
|
||||
$page = XMLin("$gnutube_root/login.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/login.xml
Normal file
7
trunk/login.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<page
|
||||
locale="en-US"
|
||||
stylesheet="./style/gnutube.css"
|
||||
username=""
|
||||
>
|
||||
<loginform />
|
||||
</page>
|
|
@ -237,7 +237,7 @@
|
|||
|
||||
<div class="registerform">
|
||||
|
||||
<form action="" method="post">
|
||||
<form action="register.pl" method="post">
|
||||
<fieldset>
|
||||
<input name="user" type="text" size="30" maxlength="30" />
|
||||
<input name="pass" type="password" size="30" maxlength="30" />
|
||||
|
@ -249,4 +249,21 @@
|
|||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="loginform">
|
||||
|
||||
<div class="loginform">
|
||||
|
||||
<form action="login.pl" method="POST">
|
||||
<fieldset>
|
||||
<input name="action" type="hidden" value="login" />
|
||||
<input name="user" type="text" size="30" maxlength="30" />
|
||||
<input name="pass" type="password" size="30" maxlength="30" />
|
||||
<input type="submit" name="login" value=" login " />
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
|
Loading…
Reference in a new issue