]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/default/templates/login.tmpl
userpref: fixed default
[SourceForge/phpwiki.git] / themes / default / templates / login.tmpl
1 <?php // -*-php-*- ?>
2 <!-- $Id: login.tmpl,v 1.29 2004-03-14 16:40:45 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 = asXML(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   if (substr_count($t,"%s") == 1) {
37       $s = @sprintf($t, $examplechars);
38       // FIXME: Workaround gettext or sprintf problem
39       if (empty($s)) echo $t;
40       else echo sprintf($t, $examplechars);
41   } else {
42       echo $t;
43   }
44   /* On disabled DbPrefs (PagePrefs only) note the user to create his PersonalPage. */
45   /* don't understand why I put this in --rurban
46   if (!(!empty($GLOBALS['DBAuthParams']['pref_update']) and $GLOBALS['DBParams']['dbtype'] == 'SQL')) {
47     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."))); 
48   }
49   */
50   if (empty($pass_required)) ?>
51   <p><?= _("New users may use an empty password.") ?></p>
52 <?php } ?>
53
54 <form method="post" action="<?= $request->getPostURL() ?>" accept-charset="<?=CHARSET?>" name="login">
55
56 <table cellspacing="4">
57 <tr>
58   <td align="right"><?= _("UserId:") ?></td>
59   <td><input type="text" name="auth[userid]" size="12" maxlength="256" value="<?=$userid?>" /></td>
60 </tr>
61 <tr>
62   <td align="right"><?= _("Password:") ?></td>
63   <td><input type="password" name="auth[passwd]" size="12" maxlength="256" /></td>
64 </tr>
65 <tr><td align="center" colspan="2">
66   <?=Button("submit:", _("Sign In"), 'wikiaction')?>
67   <?php if (!$require_level) { ?>
68     <?=Button("submit:auth[cancel]", _("Cancel"), 'button')?>
69   <?php } ?>
70 </td></tr>
71 </table>
72
73 <input type="hidden" name="auth[require_level]" value="<?=$require_level?>" />
74 <input type="hidden" name="auth[login]" value="1" />
75 <?= HiddenInputs($request->getArgs(), false, array('auth')) ?>
76 </form>
77
78 <script language="JavaScript" type="text/javascript">
79 <!-- // Really there's got to be a simpler way to do this....
80 function select_input (type) {
81     var elements = document.forms['login'].elements;
82     for (var i = 0; i < elements.length; i++) {
83         if (elements[i].type == type) {
84             elements[i].focus();
85             return;
86         }
87     }
88 }
89 select_input('<?= $userid ? "password" : "text" ?>');
90 //-->
91 </script>