]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/default/templates/login.tmpl
removed empty lines
[SourceForge/phpwiki.git] / themes / default / templates / login.tmpl
1 <?php // -*-php-*- ?>
2 <!-- $Id: login.tmpl,v 1.32 2004-05-15 19:50:09 rurban Exp $ -->
3 <!-- The login form -->
4 <?php if ($fail_message) { ?>
5   <p><strong><?=$fail_message?></strong></p>
6   <hr noshade="noshade" />
7 <?php } ?>
8 <?php /* br past the logo */ ?>
9 <br class="clear-floats" />
10
11 <?php 
12 if (DEBUG) {
13   $t = sprintf("  DEBUG: ALLOW_ANON_EDIT = %s, ALLOW_BOGO_LOGIN = %s, ALLOW_USER_PASSWORDS = %s", 
14                ALLOW_ANON_EDIT ? "true" : "false",
15                ALLOW_BOGO_LOGIN ? "true" : "false",
16                ALLOW_USER_PASSWORDS ? "true" : "false");
17   if (ALLOW_USER_PASSWORDS) {
18     $t .= sprintf("  USER_AUTH_ORDER: %s",join(" => ",$GLOBALS['USER_AUTH_ORDER'])) .
19          sprintf(",  USER_AUTH_POLICY: %s",USER_AUTH_POLICY) .
20          sprintf(",  PASSWORD_LENGTH_MINIMUM: %s",PASSWORD_LENGTH_MINIMUM);
21   }
22   echo asXML(HTML::div(array('class' => 'debug'),$t));
23   echo "<br />\n";
24 }
25 if (ALLOW_BOGO_LOGIN && $require_level <= WIKIAUTH_BOGO) {
26   require_once("lib/BlockParser.php");
27   // This iso-8859-1 sample covers French, Spanish, Italian, German, and probably others
28   if (check_php_version(4,3))
29     $examplechars = htmlentities("ÀñíçéàÖãæôßøü", ENT_QUOTES, $charset);
30   elseif (check_php_version(4,0,3))
31     $examplechars = htmlentities("ÀñíçéàÖãæôßøü", ENT_QUOTES);
32   else
33     $examplechars = htmlentities("ÀñíçéàÖãæôßøü");
34   // Japanese login requires utf-8 and ALLOW_NONWIKIWORD_LOGINS
35   if (($charset == 'utf-8') && defined('ALLOW_NONWIKIWORD_LOGINS') && ALLOW_NONWIKIWORD_LOGINS) {
36     //sample Japanese login name in unicode
37     $examplechars = $examplechars . "&#22825;&#36947;&#12354;&#12363;&#12397;";
38   }
39   $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));
40   if (substr_count($t,"%s") == 1) {
41       $s = @sprintf($t, $examplechars);
42       // FIXME: Workaround gettext or sprintf problem
43       if (empty($s)) echo $t;
44       else echo sprintf($t, $examplechars);
45   } else {
46       echo $t;
47   }
48   /* On disabled DbPrefs (PagePrefs only) note the user to create his PersonalPage. */
49   // don't understand why I put this in --rurban
50   if (!isset($user->_prefs->_select)) {
51     echo asXML(TransformText(_("Note: Only if you create your personal HomePage with same the pagename as your user id, you will be able to store your UserPreferences. Otherwise not.")));
52   }
53   if (empty($pass_required)) ?>
54   <p><?= _("New users may use an empty password.") ?></p>
55 <?php } ?>
56 <form method="post" action="<?= $request->getPostURL() ?>" accept-charset="<?=CHARSET?>" name="login">
57 <table cellspacing="4">
58 <tr>
59   <td align="right"><?= _("UserId:") ?></td>
60   <td><input type="text" name="auth[userid]" size="12" maxlength="256" value="<?=$userid?>" /></td>
61 </tr>
62 <tr>
63   <td align="right"><?= _("Password:") ?></td>
64   <td><input type="password" name="auth[passwd]" size="12" maxlength="256" /></td>
65 </tr>
66 <tr><td align="center" colspan="2">
67   <?=Button("submit:", _("Sign In"), 'wikiaction')?>
68   <?php if (!$require_level) { ?>
69     <?=Button("submit:auth[cancel]", _("Cancel"), 'button')?>
70   <?php } ?>
71 </td></tr>
72 </table>
73
74 <input type="hidden" name="auth[require_level]" value="<?=$require_level?>" />
75 <input type="hidden" name="auth[login]" value="1" />
76 <?= HiddenInputs($request->getArgs(), false, array('auth')) ?>
77 </form>
78
79 <script language="JavaScript" type="text/javascript">
80 <!-- // Really there's got to be a simpler way to do this....
81 function select_input (type) {
82     var elements = document.forms['login'].elements;
83     for (var i = 0; i < elements.length; i++) {
84         if (elements[i].type == type) {
85             elements[i].focus();
86             return;
87         }
88     }
89 }
90 select_input('<?= $userid ? "password" : "text" ?>');
91 //-->
92 </script>