4 <?php if ($fail_message) { ?>
5 <p><strong><?php echo $fail_message?></strong></p>
8 <br class="clear-floats" />
11 $dbh = $request->getDbh();
13 echo asXML(HTML::h2("System is locked as read-only for maintenance"));
14 } elseif ($dbh->readonly) {
15 echo asXML(HTML::h2("Database is locked as read-only for maintenance"));
18 if (DEBUG & _DEBUG_LOGIN) {
19 $t = sprintf(" DEBUG: ALLOW_ANON_EDIT = %s, ALLOW_BOGO_LOGIN = %s, ALLOW_USER_PASSWORDS = %s, ENABLE_PAGEPERM = %s, ",
20 ALLOW_ANON_EDIT ? "true" : "false",
21 ALLOW_BOGO_LOGIN ? "true" : "false",
22 ALLOW_USER_PASSWORDS ? "true" : "false",
23 ENABLE_PAGEPERM ? "true" : "false");
24 if (ALLOW_USER_PASSWORDS) {
25 if ($fail_message) { // add for each method the exact failing reason.
26 $t .= " USER_AUTH_ORDER: ";
27 foreach ($GLOBALS['USER_AUTH_ORDER'] as $auth) {
29 if ($fail = @$GLOBALS['USER_AUTH_ERROR']["_".strtolower($auth)."passuser"])
33 $t .= sprintf(" USER_AUTH_ORDER: %s", join(" => ", $GLOBALS['USER_AUTH_ORDER']));
34 $t .= sprintf(", USER_AUTH_POLICY: %s", USER_AUTH_POLICY)
35 . sprintf(", PASSWORD_LENGTH_MINIMUM: %s", PASSWORD_LENGTH_MINIMUM);
37 echo asXML(HTML::div(array('class' => 'debug'),$t));
40 if (ALLOW_BOGO_LOGIN && $require_level <= WIKIAUTH_BOGO) {
41 require_once("lib/BlockParser.php");
42 // This iso-8859-1 sample covers French, Spanish, Italian, German, and probably others
43 $examplechars = htmlentities("ÀñíçéàÖãæôßøü", ENT_QUOTES, $charset);
44 // Japanese login requires utf-8 and ALLOW_NONWIKIWORD_LOGINS
45 if (($charset == 'utf-8') && defined('ALLOW_NONWIKIWORD_LOGINS') && ALLOW_NONWIKIWORD_LOGINS) {
46 //sample Japanese login name in unicode
47 $examplechars = $examplechars . "天道あかね";
49 $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));
50 if (substr_count($t,"%s") == 1) {
51 $s = @sprintf($t, $examplechars);
52 // FIXME: Workaround gettext or sprintf problem
53 if (empty($s)) echo $t;
54 else echo sprintf($t, $examplechars);
58 /* On disabled DbPrefs (PagePrefs only) note the user to create his PersonalPage. */
59 // don't understand why I put this in --rurban
60 if (!isset($user->_prefs->_select)) {
61 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.")));
63 if (empty($pass_required)) ?>
64 <p><?php echo _("New users may use an empty password.") ?></p>
66 <form method="post" action="<?php echo $request->getPostURL() ?>" accept-charset="<?php echo CHARSET?>" name="login">
71 <legend>Sign In</legend>
72 <table cellspacing="4">
74 <td align="right"><?php echo _("UserId:") ?></td>
75 <td><input type="text" name="auth[userid]" size="12" maxlength="256" value="<?php echo $userid?>" tabindex="1" />
76 <?php if (ENABLE_AUTH_OPENID) { ?>
77 <?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" />
82 <td align="right"><?php echo _("Password:") ?></td>
83 <td><input type="password" name="auth[passwd]" size="12" maxlength="256" tabindex="2" /></td>
85 <tr><td></td><td align="left">
86 <?php echo Button("submit:", _("Sign In"), 'wikiaction')?>
87 <?php if (!$require_level) { ?>
88 <?php echo Button("submit:auth[cancel]", _("Cancel"), 'button')?>
93 <input type="hidden" name="auth[require_level]" value="<?php echo $require_level?>" />
94 <input type="hidden" name="auth[login]" value="1" />
95 <?php echo HiddenInputs($request->getArgs(), false, array('auth')) ?>
102 <script type="text/javascript">
103 <!-- // Really there's got to be a simpler way to do this....
104 function select_input (type) {
105 var elements = document.forms['login'].elements;
106 for (var i = 0; i < elements.length; i++) {
107 if (elements[i].type == type) {
113 select_input('<?php echo $userid ? "password" : "text" ?>');