fix for openid authentication
[scpubgit/stemmatology.git] / stemmaweb / root / src / auth / login.tt
index 6af2f51..7779789 100644 (file)
 
        <form method="post" action="[% c.uri_for_action('/users/login').hostless | html %]" autocomplete="off">
 
-    <select name="realm">
-     <option value="default">Local</option>
-     <option value="openid">OpenID</option>
-    </select>
-
-<div id="field-openid-identifier">
-<label for="openid_identifier">OpenID login/url</label>
-<input type="text" name="openid_identifier" id="openid_identifier"/><br>
-</div>
-
-<!--
-<div style="display:none">
+    <input type="hidden" name="realm" value="openid"/>
+    <input type="hidden" name="openid_identifier" value="https://www.google.com/accounts/o8/id"/>
+    <input type="submit" value="Sign in with Google"/>
+
+       </form>
+
+[% UNLESS c.req.param('realm') == 'openid' %]
+       <form method="post" action="[% c.uri_for_action('/users/login').hostless | html %]" autocomplete="off">
+
+    <input type="hidden" name="realm" value="default"/>
+
        [% form.field('username').render %]
        [% form.field('password').render %]
-</div>
--->
-    [% form.field('remember').render %]
+       [% form.field('remember').render %]
+
        [% form.field('submit').render %]
 
-       </form>
\ No newline at end of file
+       </form>
+[% END %]
\ No newline at end of file