1 <?php if ($fail_message) { ?>
2 <p><strong><?php echo $fail_message?></strong></p>
5 <br class="clear-floats" />
8 $dbh = $request->getDbh();
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"));
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) {
26 if ($fail = @$GLOBALS['USER_AUTH_ERROR']["_".strtolower($auth)."passuser"])
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);
34 echo asXML(HTML::div(array('class' => 'debug'),$t));
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 . "天道あかね";
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);
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.")));
60 if (empty($pass_required)) ?>
61 <p><?php echo _("New users may use an empty password.") ?></p>
63 <form method="post" action="<?php echo $request->getPostURL() ?>" accept-charset="UTF-8" name="login">
68 <legend><?php echo _("Sign In") ?></legend>
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 <?php echo _("or")?> <a href="http://openid.net/"><?php echo _("OpenID") ?></a>: <input type="text" id="inp-openid" name="openid_url" size="32" maxlength="256" value="" tabindex="3" />
79 <td class="align-right"><?php echo _("Password:") ?></td>
80 <td><input type="password" name="auth[passwd]" size="12" maxlength="256" tabindex="2" /></td>
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')?>
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')) ?>
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) {
110 select_input('<?php echo $userid ? "password" : "text" ?>');