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