Fix up the resource password prompt code to be more robust.
The user-experience flow still sucks somewhat, but one has to think carefully about the use cases before making further changes.
This commit is contained in:
parent
75376e129a
commit
3f48a02784
1
CHANGES
1
CHANGES
|
@ -53,6 +53,7 @@ For further information about Photo Organizer, see its web site at:
|
|||
we hold transactions open, and allows imports to be parallelized
|
||||
to a much greater extent.
|
||||
[fix] When using pretty URLs, login redirections broke.
|
||||
[fix] The resource password prompting code has been made more robust.
|
||||
|
||||
2.36.1 (September 27, 2008)
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
<?php
|
||||
|
||||
// Copyright (C) 2002-2006 Balint Kis (balint@k-i-s.net)
|
||||
|
@ -122,10 +123,22 @@ function display_login_form($username, $password, $orig, $reason, $lang, $status
|
|||
print "<center><table class=\"search\"><tr>\n";
|
||||
print "<td align=\"center\" valign=\"top\" >\n";
|
||||
|
||||
if ($po_user['type'] == PO_USER_TYPE_DISABLED) {
|
||||
if ($orig != "" && $reason == 'protected') {
|
||||
print "<form action=\"login.php\" method=\"post\" accept-charset=\"".$strings['formats_encoding']."\">\n";
|
||||
print "<input type=\"hidden\" name=\"operation\" value=\"password\" />\n";
|
||||
print "<input type=\"hidden\" name=\"orig\" value=\"$orig\" />\n";
|
||||
print "<input type=\"hidden\" name=\"reason\" value=\"$reason\" />\n";
|
||||
print "<table class=\"login\">\n";
|
||||
print "<tr><td>".$strings['generic_resource_password']."</td><td><input type=\"text\" name=\"password\" value=\"\" /></td></tr>\n";
|
||||
print "</table>\n";
|
||||
print $thm_elem['button.submit'];
|
||||
print "</form>\n";
|
||||
print " <br/>\n";
|
||||
} elseif ($po_user['type'] == PO_USER_TYPE_DISABLED) {
|
||||
print "<form action=\"login.php\" method=\"post\" accept-charset=\"".$strings['formats_encoding']."\">\n";
|
||||
print "<input type=\"hidden\" name=\"operation\" value=\"login\" />\n";
|
||||
print "<input type=\"hidden\" name=\"orig\" value=\"$orig\" />\n";
|
||||
print "<input type=\"hidden\" name=\"reason\" value=\"$reason\" />\n";
|
||||
print "<table class=\"login\">\n";
|
||||
print "<tr>". emit_td($strings['generic_username']). "<td><input type=\"text\" name=\"username\" value=\"$username\" tabindex=\"1\"/></td></tr>\n";
|
||||
print "<tr>" . emit_td($strings['generic_password'])."<td><input type=\"password\" name=\"password\" tabindex=\"2\"/></td></tr>\n";
|
||||
|
@ -147,18 +160,6 @@ function display_login_form($username, $password, $orig, $reason, $lang, $status
|
|||
print "</form>\n";
|
||||
}
|
||||
|
||||
if ($orig != "" && $reason == 'protected') {
|
||||
print " <br/>\n";
|
||||
print "<form action=\"login.php\" method=\"post\" accept-charset=\"".$strings['formats_encoding']."\">\n";
|
||||
print "<input type=\"hidden\" name=\"operation\" value=\"password\" />\n";
|
||||
print "<input type=\"hidden\" name=\"orig\" value=\"$orig\" />\n";
|
||||
print "<table class=\"login\">\n";
|
||||
print "<tr><td>".$strings['generic_resource_password']."</td><td><input type=\"text\" name=\"password\" value=\"\" /></td></tr>\n";
|
||||
print "</table>\n";
|
||||
print $thm_elem['button.submit'];
|
||||
print "</form>\n";
|
||||
}
|
||||
|
||||
if ($po_user['type'] == PO_USER_TYPE_DISABLED && ($auth_handle->local_register === TRUE)) {
|
||||
if ($po_options_default['new_user_type'] != PO_USER_TYPE_DISABLED) {
|
||||
print " <br/>\n";
|
||||
|
|
Loading…
Reference in New Issue