removed action=login

git-svn-id: http://yolanda.mister-muffin.de/svn@267 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
josch 2008-04-03 13:47:12 +00:00
parent 45d1cf5d7a
commit 861e15f468
4 changed files with 131 additions and 202 deletions

View file

@ -10,7 +10,6 @@
<string id="register">register</string>
<string id="login">login</string>
<string id="login_openid">login with OpenID</string>
<string id="header_upload-video">upload video</string>
<string id="settings_details">settings details</string>

View file

@ -9,9 +9,6 @@ $session = new CGI::Session;
@page = get_page_array(@userinfo);
#check if action is set
if($query->param('action'))
{
if($query->param('action') eq "logout")
{
#if logout is requested
@ -28,11 +25,8 @@ if($query->param('action'))
print output_page();
}
#if login is requested
elsif($query->param('action') eq "login")
{
#if password is empty and username begins with http:// or ret is specified, then it's an openid login
if($query->param('pass') eq '' and ($query->param('user')=~m/^http:\/\// or $query->param('ret')))
elsif($query->param('pass') eq '' and ($query->param('user')=~m/^http:\/\// or $query->param('ret')))
{
#create our openid consumer object
$con = Net::OpenID::Consumer->new(
@ -104,13 +98,13 @@ if($query->param('action'))
else
{
#if not, print login form
$page->{'loginform'}->{'action'} = 'openid';
$page->{'loginform'} = [''];
print output_page();
}
}
#else it's a normal login
else
elsif($query->param('pass') ne '' and $query->param('user')!~m/^http:\/\// and $query->param('user') ne '')
{
#prepare query - empty password are openid users so omit those entries
my $sth = $dbh->prepare(qq{select id from users
@ -135,24 +129,6 @@ if($query->param('action'))
print output_page();
}
}
}
else
{
#something ugly was passed
$page->{'message'}->{'type'} = "error";
$page->{'message'}->{'text'} = "error_202c";
print output_page();
}
}
#check if user is logged in
elsif($userinfo->{'username'})
{
$page->{'message'}->{'type'} = "error";
$page->{'message'}->{'text'} = "error_already_logged_in";
print output_page();
}
else
{
#if not, print login form

View file

@ -30,10 +30,10 @@
<li>
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='path_login-openid']" />
<xsl:value-of select="$site_strings[@id='path_login']" />
</xsl:attribute>
<xsl:value-of select="$locale_strings[@id='login_openid']" />
<xsl:value-of select="$locale_strings[@id='login']" />
</a>
</li>

View file

@ -18,12 +18,6 @@
<xsl:value-of select="$site_strings[@id='path_login']" />
</xsl:attribute>
<fieldset>
<!--
why do we need this hidden input ?
-->
<input name="action" type="hidden" value="login" />
<label for="user">
<xsl:value-of select="$locale_strings[@id='username']" />:
</label>
@ -104,42 +98,11 @@
the loginform template is deprecated
-->
<div class="loginform">
<xsl:choose>
<xsl:when test="//loginform/@action='openid'">
<form method="post">
<xsl:attribute name="action">
<xsl:value-of select="$site_strings[@id='path_login']" />
</xsl:attribute>
<fieldset>
<input name="action" type="hidden" value="openid" />
OpenID:
<br />
<input name="user" type="text" style="background: url(http://stat.livejournal.com/img/openid-inputicon.gif) no-repeat; background-color: #fff; background-position: 0 50%; padding-left: 18px;" />
<br />
e.g. http://username.myopenid.com
<br />
<input type="submit" name="login" >
<xsl:attribute name="value">
<xsl:value-of select="$locale_strings[@id='button_login']" />
</xsl:attribute>
</input>
<br />
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='path_login']" />
</xsl:attribute>
login with normal account
</a>
</fieldset>
</form>
</xsl:when>
<xsl:otherwise>
<form method="post">
<xsl:attribute name="action">
<xsl:value-of select="$site_strings[@id='path_login']" />
</xsl:attribute>
<fieldset>
<input name="action" type="hidden" value="login" />
<xsl:value-of select="$locale_strings[@id='username']" />:
<br />
<input name="user" type="text" size="30" maxlength="30" />
@ -153,17 +116,8 @@
<xsl:value-of select="$locale_strings[@id='button_login']" />
</xsl:attribute>
</input>
<br />
<a>
<xsl:attribute name="href">
<xsl:value-of select="$site_strings[@id='path_login-openid']" />
</xsl:attribute>
login with openid
</a>
</fieldset>
</form>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>