]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/default/templates/login.tmpl
fixed auth from session (still double code but works)
[SourceForge/phpwiki.git] / themes / default / templates / login.tmpl
1 <?php // -*-php-*- ?>
2 <!-- $Id: login.tmpl,v 1.28 2004-02-07 10:41:25 rurban Exp $ -->
3 <!-- The login form -->
4
5 <?php if ($fail_message) { ?>
6   <p><strong><?=$fail_message?></strong></p>
7   <hr noshade="noshade" />
8 <?php } ?>
9 <?php /* br past the logo */ ?>
10 <br class="clear-floats" />
11
12 <?php 
13 if (DEBUG) {
14   $t = sprintf("  DEBUG: ALLOW_ANON_EDIT = %s, ALLOW_BOGO_LOGIN = %s, ALLOW_USER_PASSWORDS = %s", 
15                ALLOW_ANON_EDIT ? "true" : "false",
16                ALLOW_BOGO_LOGIN ? "true" : "false",
17                ALLOW_USER_PASSWORDS ? "true" : "false");
18   if (ALLOW_USER_PASSWORDS) {
19     $t .= sprintf("  USER_AUTH_ORDER: %s",join(" => ",$GLOBALS['USER_AUTH_ORDER'])) .
20       sprintf(",  USER_AUTH_POLICY: %s",USER_AUTH_POLICY) .
21       sprintf(",  PASSWORD_LENGTH_MINIMUM: %s",PASSWORD_LENGTH_MINIMUM);
22   }
23   echo asXML(HTML::div(array('class' => 'debug'),$t));
24   echo "<br />\n";
25 }
26 if (ALLOW_BOGO_LOGIN && $require_level <= WIKIAUTH_BOGO) {
27   require_once("lib/BlockParser.php");
28   // This iso-8859-1 sample covers French, Spanish, Italian, German, and probably others
29   $examplechars = htmlentities("ÀñíçéàÖãæôßøü", ENT_QUOTES, 'iso-8859-1');
30   // Japanese login requires utf-8 and ALLOW_NONWIKIWORD_LOGINS
31   /*if ((CHARSET == 'utf-8') && defined('ALLOW_NONWIKIWORD_LOGINS') && ALLOW_NONWIKIWORD_LOGINS) {
32     //sample Japanese login name in unicode
33     $examplechars = $examplechars . "&#22825;&#36947;&#12354;&#12363;&#12397;";
34   }*/
35   $t = TransformText(_("You may sign in using any [WikiWord|AddingPages] as a user id. (Any characters in %s etc. may be used too). The user id will be used as a link in RecentChanges to your home page."), 2.0, true);
36   printf(asXML($t), $examplechars);
37   /* On disabled DbPrefs (PagePrefs only) note the user to create his PersonalPage. */
38   if (!(!empty($GLOBALS['DBAuthParams']['pref_update']) and $GLOBALS['DBParams']['dbtype'] == 'SQL')) {
39     echo asXML(TransformText(_("Note: If you create your personal HomePage with same the pagename as your user id, you will be able to store your UserPreferences also. Otherwise not."))); 
40   }
41   if (empty($pass_required)) ?>
42   <p><?= _("New users may use an empty password.") ?></p>
43 <?php } ?>
44
45 <form method="post" action="<?= $request->getPostURL() ?>" accept-charset="<?=CHARSET?>" name="login">
46
47 <table cellspacing="4">
48 <tr>
49   <td align="right"><?= _("UserId:") ?></td>
50   <td><input type="text" name="auth[userid]" size="12" maxlength="256" value="<?=$userid?>" /></td>
51 </tr>
52 <tr>
53   <td align="right"><?= _("Password:") ?></td>
54   <td><input type="password" name="auth[passwd]" size="12" maxlength="256" /></td>
55 </tr>
56 <?php
57 /* Related code for this doesn't seem to work yet.
58    Commented out for now until it is fixed or removed.
59    (I personally don't see the need for this feature. --CarstenKlapp)
60   $dbi = $request->getDbh();
61   $checked = (!empty($userid) and $dbi->isWikiPage($userid)) ? '' : 'checked="checked"';
62 <tr>
63   <td align="right"><?= _("Create Homepage:") ?></td>
64   <td><input type="checkbox" name="auth[homepage]"<?php if ($checked) {
65   ?> checked="checked"<?php }?> /></td>
66 </tr>
67 */
68 ?>
69 <tr><td align="center" colspan="2">
70   <?=Button("submit:", _("Sign In"), 'wikiaction')?>
71   <?php if (!$require_level) { ?>
72     <?=Button("submit:auth[cancel]", _("Cancel"), 'button')?>
73   <?php } ?>
74 </td></tr>
75 </table>
76
77 <input type="hidden" name="auth[require_level]" value="<?=$require_level?>" />
78 <input type="hidden" name="auth[login]" value="1" />
79 <?= HiddenInputs($request->getArgs(), false, array('auth')) ?>
80 </form>
81
82 <script language="JavaScript" type="text/javascript">
83 <!-- // Really there's got to be a simpler way to do this....
84 function select_input (type) {
85     var elements = document.forms['login'].elements;
86     for (var i = 0; i < elements.length; i++) {
87         if (elements[i].type == type) {
88             elements[i].focus();
89             return;
90         }
91     }
92 }
93 select_input('<?= $userid ? "password" : "text" ?>');
94 //-->
95 </script>