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