]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/default/templates/login.tmpl
Use CSS
[SourceForge/phpwiki.git] / themes / default / templates / login.tmpl
1 <?php if ($fail_message) { ?>
2   <p><strong><?php echo $fail_message?></strong></p>
3   <hr />
4 <?php } ?>
5 <br class="clear-floats" />
6
7 <?php 
8 $dbh = $request->getDbh();
9 if (READONLY) {
10   echo asXML(HTML::h2("System is locked as read-only for maintenance"));
11 } elseif ($dbh->readonly) {
12   echo asXML(HTML::h2("Database is locked as read-only for maintenance"));
13 }
14
15 if (DEBUG & _DEBUG_LOGIN) {
16   $t = sprintf("  DEBUG: ALLOW_ANON_EDIT = %s, ALLOW_BOGO_LOGIN = %s, ALLOW_USER_PASSWORDS = %s, ENABLE_PAGEPERM = %s, ", 
17                ALLOW_ANON_EDIT ? "true" : "false",
18                ALLOW_BOGO_LOGIN ? "true" : "false",
19                ALLOW_USER_PASSWORDS ? "true" : "false",
20                ENABLE_PAGEPERM ? "true" : "false");
21   if (ALLOW_USER_PASSWORDS) {
22     if ($fail_message) { // add for each method the exact failing reason.
23       $t .= "  USER_AUTH_ORDER: ";
24       foreach ($GLOBALS['USER_AUTH_ORDER'] as $auth) {
25           $t .= " => $auth";
26           if ($fail = @$GLOBALS['USER_AUTH_ERROR']["_".strtolower($auth)."passuser"])
27               $t .= " ($fail)";
28       }
29     } else
30         $t .= sprintf("  USER_AUTH_ORDER: %s", join(" => ", $GLOBALS['USER_AUTH_ORDER']));
31         $t .= sprintf(",  USER_AUTH_POLICY: %s", USER_AUTH_POLICY)
32             . sprintf(",  PASSWORD_LENGTH_MINIMUM: %s", PASSWORD_LENGTH_MINIMUM);
33   }
34   echo asXML(HTML::div(array('class' => 'debug'),$t));
35   echo "<br />\n";
36 }
37 if (ALLOW_BOGO_LOGIN && $require_level <= WIKIAUTH_BOGO) {
38   require_once("lib/BlockParser.php");
39   // This sample covers French, Spanish, Italian, German, and probably others
40   $examplechars = htmlentities("ÀñíçéàÖãæôßøü", ENT_QUOTES, $charset);
41   // Japanese login requires utf-8 and ALLOW_NONWIKIWORD_LOGINS
42   if (($charset == 'utf-8') && defined('ALLOW_NONWIKIWORD_LOGINS') && ALLOW_NONWIKIWORD_LOGINS) {
43     // sample Japanese login name
44     $examplechars = $examplechars . "天道あかね";
45   }
46   $t = asXML(TransformText(_("You may sign in using any [[Help:AddingPages|WikiWord]] 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."), true));
47   if (substr_count($t,"%s") == 1) {
48       $s = @sprintf($t, $examplechars);
49       // FIXME: Workaround gettext or sprintf problem
50       if (empty($s)) echo $t;
51       else echo sprintf($t, $examplechars);
52   } else {
53       echo $t;
54   }
55   /* On disabled DbPrefs (PagePrefs only) note the user to create his PersonalPage. */
56   // don't understand why I put this in --rurban
57   if (!isset($user->_prefs->_select)) {
58     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.")));
59   }
60   if (empty($pass_required)) ?>
61   <p><?php echo _("New users may use an empty password.") ?></p>
62 <?php } ?>
63 <form method="post" action="<?php echo $request->getPostURL() ?>" accept-charset="UTF-8" name="login">
64 <table>
65 <tr>
66 <td>
67 <fieldset>
68 <legend><?php echo _("Sign In") ?></legend>
69 <table>
70 <tr>
71   <td class="align-right"><?php echo _("UserId:") ?></td>
72   <td><input type="text" name="auth[userid]" size="12" maxlength="256" value="<?php echo $userid?>" tabindex="1" />
73     <?php if (ENABLE_AUTH_OPENID) { ?>
74     &nbsp;&nbsp;<?php echo _("or")?> <a href="http://openid.net/"><?php echo _("OpenID") ?></a>:&nbsp;<input type="text" id="inp-openid" name="openid_url" size="32" maxlength="256" value="" tabindex="3" />
75     <?php } ?>
76 </td>
77 </tr>
78 <tr>
79   <td class="align-right"><?php echo _("Password:") ?></td>
80   <td><input type="password" name="auth[passwd]" size="12" maxlength="256" tabindex="2" /></td>
81 </tr>
82 <tr><td></td><td class="align-left">
83   <?php echo Button("submit:", _("Sign In"), 'wikiaction')?>
84   <?php if (!$require_level) { ?>
85     <?php echo Button("submit:auth[cancel]", _("Cancel"), 'button')?>
86   <?php } ?>
87 </td></tr>
88 </table>
89
90 <input type="hidden" name="auth[require_level]" value="<?php echo $require_level?>" />
91 <input type="hidden" name="auth[login]" value="1" />
92 <?php echo HiddenInputs($request->getArgs(), false, array('auth')) ?>
93 </fieldset>
94 </td>
95 </tr>
96 </table>
97 </form>
98
99 <script type="text/javascript">
100 <!-- // Really there's got to be a simpler way to do this....
101 function select_input (type) {
102     var elements = document.forms['login'].elements;
103     for (var i = 0; i < elements.length; i++) {
104         if (elements[i].type == type) {
105             elements[i].focus();
106             return;
107         }
108     }
109 }
110 select_input('<?php echo $userid ? "password" : "text" ?>');
111 //-->
112 </script>