fixed login dialogue

git-svn-id: http://yolanda.mister-muffin.de/svn@150 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
josch 2007-10-28 20:58:25 +00:00
parent 46ec3555af
commit 8575d7509f
3 changed files with 65 additions and 45 deletions

View file

@ -144,9 +144,8 @@ if($query->param('action'))
}
else
{
#someone is messing with the args
$page->{'message'}->{'type'} = "error";
$page->{'message'}->{'text'} = "error_202c";
#if not, print login form
$page->{'loginform'}->{'action'} = 'openid';
#print xml http header along with session cookie
print $session->header(-type=>'text/xml', -charset=>'UTF-8');
@ -183,7 +182,7 @@ elsif($username)
else
{
#if not, print login form
$page->{loginform} = [''];
$page->{'loginform'} = [''];
#print xml http header along with session cookie
print $session->header(-type=>'text/xml', -charset=>'UTF-8');

View file

@ -13,13 +13,13 @@
<str id=""></str>-->
<str id="page_account">/account.pl</str>
<str id="page_bookmarks"></str>
<str id="page_login">login.pl</str>
<str id="page_login-openid">login-openid.pl</str>
<str id="page_logout">login.pl?action=logout</str>
<str id="page_login">/login.pl</str>
<str id="page_login-openid">/login.pl?action=openid</str>
<str id="page_logout">/login.pl?action=logout</str>
<str id="page_gnutube-authors">INSERT LINK TO GNUTUBE AUTHORS HERE</str>
<str id="page_gnutube-license">http://gplv3.fsf.org/agplv3-dd1.html</str>
<str id="page_gnutube-source-code">http://mister-muffin.de/proj/browser</str>
<str id="page_register">register.pl</str>
<str id="page_register">/register.pl</str>
<str id="page_results">search.pl?query=</str>
<str id="page_upload">/upload.pl</str>
<str id="page_uploader">uploader.pl</str>

View file

@ -358,45 +358,66 @@
<xsl:call-template name="searchbar"/>
<div class="loginform">
<form method="post">
<xsl:attribute name="action">
<xsl:value-of select="$site_strings[@id='page_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" />
<br />
<xsl:value-of select="$locale_strings[@id='password']" />:
<br />
<input name="pass" type="password" size="30" maxlength="30" />
<br />
<input type="submit" name="login" >
<xsl:attribute name="value">
<xsl:value-of select="$locale_strings[@id='button_login']" />
<xsl:choose>
<xsl:when test="//loginform/@action='openid'">
<form method="post">
<xsl:attribute name="action">
<xsl:value-of select="$site_strings[@id='page_login']" />
</xsl:attribute>
</input>
</fieldset>
</form>
<form method="post">
<xsl:attribute name="action">
<xsl:value-of select="$site_strings[@id='page_login']" />
</xsl:attribute>
<fieldset>
<input name="action" type="hidden" value="openid" />
<xsl:value-of select="$locale_strings[@id='username']" />:
<br />
<input name="user" type="text" size="30" maxlength="30" />
<br />
<input type="submit" name="login" >
<xsl:attribute name="value">
<xsl:value-of select="$locale_strings[@id='button_login']" />
<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='page_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='page_login']" />
</xsl:attribute>
</input>
</fieldset>
</form>
<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" />
<br />
<xsl:value-of select="$locale_strings[@id='password']" />:
<br />
<input name="pass" type="password" size="30" maxlength="30" />
<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='page_login-openid']" />
</xsl:attribute>
login with openid
</a>
</fieldset>
</form>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>