Update of /cvsroot/phpwiki/phpwiki/lib
In directory usw-pr-cvs1:/tmp/cvs-serv1029/lib
Modified Files:
userauth.php
Log Message:
Added support for bogo-logins.
One can now "login" using any WikiWord as a user ID.
(Unless logging in as the admin user, any password will work.)
Currently, the sole effect of logging in is that the
the logged-in user ID is recorded as the author of any
page edits. Thus, "logging in" allows one to control
the author which appears in RecentChanges and the page
info display.
Index: userauth.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/userauth.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** userauth.php 2001/05/31 17:43:05 1.6
--- userauth.php 2001/07/20 17:40:12 1.7
***************
*** 137,146 ****
function _get_http_authenticated_userid () {
global $PHP_AUTH_USER, $PHP_AUTH_PW;
!
! if (empty($PHP_AUTH_USER) || empty($PHP_AUTH_PW))
return false;
! if (($PHP_AUTH_USER != ADMIN_USER) || ($PHP_AUTH_PW != ADMIN_PASSWD))
return false;
return $PHP_AUTH_USER;
--- 137,155 ----
function _get_http_authenticated_userid () {
global $PHP_AUTH_USER, $PHP_AUTH_PW;
! global $WikiNameRegexp;
!
! if (empty($PHP_AUTH_USER))
return false;
! if ($PHP_AUTH_USER == ADMIN_USER) {
! if (empty($PHP_AUTH_PW) || $PHP_AUTH_PW != ADMIN_PASSWD)
! return false;
! }
! else if (! ALLOW_BOGO_LOGIN) {
! return false;
! }
! else if (! preg_match('/\A' . $WikiNameRegexp . '\z/', $PHP_AUTH_USER)) {
return false;
+ }
return $PHP_AUTH_USER;
***************
*** 164,168 ****
if (ACCESS_LOG)
$LogEntry->status = 401;
! echo gettext ("You entered an invalid login or password.");
ExitWiki();
}
--- 173,183 ----
if (ACCESS_LOG)
$LogEntry->status = 401;
! echo "<p>" . gettext ("You entered an invalid login or password.") . "\n";
! if (ALLOW_BOGO_LOGIN) {
! echo "<p>";
! echo gettext ("You can log in using any valid WikiWord as a user ID.") . "\n";
! echo gettext ("(Any password will work, except, of course for the admin user.)") . "\n";
! }
!
ExitWiki();
}
|