Update of /cvsroot/mrbs/mrbs/web
In directory sc8-pr-cvs1:/tmp/cvs-serv30475/web
Modified Files:
auth_ext.inc auth_imap.inc auth_ldap.inc auth_nis.inc
auth_nw.inc auth_pop3.inc
Log Message:
Set $auth['session']='http' if it is not specified. This allows to get the same behaviour as before without changing config.inc.php.
Moved routines authGet(), getUserName() and getUserPassword() to the new session_http.inc module.
Function authValidateUser() must not call authGet() anymore. In case of failure it just returns 0 as specified in its header comment.
Index: auth_ext.inc
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/auth_ext.inc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** auth_ext.inc 23 Sep 2003 05:55:18 -0000 1.5
--- auth_ext.inc 14 Nov 2003 22:20:24 -0000 1.6
***************
*** 27,43 ****
*/
! /* getAuth($realm)
! *
! * Request that the username/password be given for the specified realm
! *
! * $realm - Which username/password do we want.
! *
! * Nothing
! */
! function authGet($realm)
! {
! Header("WWW-Authenticate: Basic realm=\"$realm\"");
! Header("HTTP/1.0 401 Unauthorized");
! }
function version_check($vercheck)
--- 27,32 ----
*/
! /* ~~JFL 2003/11/12 By default, use the http session mechanism */
! if (!isset($auth['session'])) $auth['session']='http';
function version_check($vercheck)
***************
*** 76,80 ****
if(!isset($user) || !isset($pass))
{
- authGet($auth["realm"]);
return 0;
}
--- 65,68 ----
***************
*** 92,99 ****
return 1;
- // If we failed prompt for username/password
- if($user || $pass)
- authGet($auth["realm"]);
-
// return failure
return 0;
--- 80,83 ----
***************
*** 124,139 ****
// Everybody else is access level '1'
return 1;
- }
-
- function getUserName()
- {
- global $PHP_AUTH_USER;
- return $PHP_AUTH_USER;
- }
-
- function getUserPassword()
- {
- global $PHP_AUTH_PW;
- return $PHP_AUTH_PW;
}
--- 108,111 ----
Index: auth_imap.inc
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/auth_imap.inc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** auth_imap.inc 23 Sep 2003 05:55:18 -0000 1.4
--- auth_imap.inc 14 Nov 2003 22:20:24 -0000 1.5
***************
*** 18,21 ****
--- 18,24 ----
*/
+ /* ~~JFL 2003/11/12 By default, use the http session mechanism */
+ if (!isset($auth['session'])) $auth['session']='http';
+
/* quoteIMAP($str)
*
***************
*** 32,49 ****
}
- /* getAuth($realm)
- *
- * Request that the username/password be given for the specified realm
- *
- * $realm - Which username/password do we want.
- *
- * Nothing
- */
- function authGet($realm)
- {
- Header("WWW-Authenticate: Basic realm=\"$realm\"");
- Header("HTTP/1.0 401 Unauthorized");
- }
-
/* authValidateUser($user, $pass)
*
--- 35,38 ----
***************
*** 66,70 ****
if(!isset($user) || !isset($pass) || strlen($pass)==0)
{
- authGet($auth["realm"]);
return 0;
}
--- 55,58 ----
***************
*** 88,94 ****
}
- // If we failed prompt for username/password
- authGet($realm);
-
// return failure
return 0;
--- 76,79 ----
***************
*** 119,133 ****
// Everybody else is access level '1'
return 1;
- }
-
-
- function getUserName()
- {
- return getAuthUserName();
- }
-
- function getUserPassword()
- {
- return getAuthUserPassword();
}
--- 104,107 ----
Index: auth_ldap.inc
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/auth_ldap.inc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** auth_ldap.inc 28 Mar 2003 15:40:50 -0000 1.4
--- auth_ldap.inc 14 Nov 2003 22:20:24 -0000 1.5
***************
*** 3,19 ****
// $Id$
! /* getAuth($realm)
! *
! * Request that the username/password be given for the specified realm
! *
! * $realm - Which username/password do we want.
! *
! * Nothing
! */
! function authGet($realm)
! {
! Header("WWW-Authenticate: Basic realm=\"$realm\"");
! Header("HTTP/1.0 401 Unauthorized");
! }
/* authValidateUser($user, $pass)
--- 3,8 ----
// $Id$
! /* ~~JFL 2003/11/12 By default, use the http session mechanism */
! if (!isset($auth['session'])) $auth['session']='http';
/* authValidateUser($user, $pass)
***************
*** 40,44 ****
if(!isset($user) || !isset($pass) || strlen($pass)==0)
{
- authGet($auth["realm"]);
return 0;
}
--- 29,32 ----
***************
*** 77,83 ****
}
- // If we failed prompt for username/password
- authGet($realm);
-
// return failure
return 0;
--- 65,68 ----
***************
*** 108,122 ****
// Everybody else is access level '1'
return 1;
- }
-
-
- function getUserName()
- {
- return getAuthUserName();
- }
-
- function getUserPassword()
- {
- return getAuthUserPassword();
}
--- 93,96 ----
Index: auth_nis.inc
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/auth_nis.inc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** auth_nis.inc 23 Sep 2003 05:55:18 -0000 1.4
--- auth_nis.inc 14 Nov 2003 22:20:24 -0000 1.5
***************
*** 19,35 ****
*/
! /* getAuth($realm)
! *
! * Request that the username/password be given for the specified realm
! *
! * $realm - Which username/password do we want.
! *
! * Nothing
! */
! function authGet($realm)
! {
! Header("WWW-Authenticate: Basic realm=\"$realm\"");
! Header("HTTP/1.0 401 Unauthorized");
! }
/* authValidateUser($user, $pass)
--- 19,24 ----
*/
! /* ~~JFL 2003/11/12 By default, use the http session mechanism */
! if (!isset($auth['session'])) $auth['session']='http';
/* authValidateUser($user, $pass)
***************
*** 51,55 ****
if(!isset($user) || !isset($pass))
{
- authGet($auth["realm"]);
return 0;
}
--- 40,43 ----
***************
*** 69,76 ****
}
- // If we failed prompt for username/password
- if($user || $pass)
- authGet($auth["realm"]);
-
// return failure
return 0;
--- 57,60 ----
***************
*** 101,114 ****
// Everybody else is access level '1'
return 1;
- }
-
- function getUserName()
- {
- return getAuthUserName();
- }
-
- function getUserPassword()
- {
- return getAuthUserPassword();
}
--- 85,88 ----
Index: auth_nw.inc
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/auth_nw.inc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** auth_nw.inc 28 Mar 2003 15:40:50 -0000 1.3
--- auth_nw.inc 14 Nov 2003 22:20:24 -0000 1.4
***************
*** 3,19 ****
// $Id$
! /* getAuth($realm)
! *
! * Request that the username/password be given for the specified realm
! *
! * $realm - Which username/password do we want.
! *
! * Nothing
! */
! function authGet($realm)
! {
! Header("WWW-Authenticate: Basic realm=\"$realm\"");
! Header("HTTP/1.0 401 Unauthorized");
! }
/* authValidateUser($user, $pass)
--- 3,8 ----
// $Id$
! /* ~~JFL 2003/11/12 By default, use the http session mechanism */
! if (!isset($auth['session'])) $auth['session']='http';
/* authValidateUser($user, $pass)
***************
*** 35,39 ****
if(empty($user) || empty($pass))
{
- authGet($auth["realm"]);
return 0;
}
--- 24,27 ----
***************
*** 50,57 ****
return 1;
- // If we failed prompt for username/password - WHY?
- if($user || $pass)
- authGet($auth["realm"]);
-
// return failure
return 0;
--- 38,41 ----
***************
*** 82,95 ****
// Everybody else is access level '1'
return 1;
- }
-
- function getUserName()
- {
- return getAuthUserName();
- }
-
- function getUserPassword()
- {
- return getAuthUserPassword();
}
--- 66,69 ----
Index: auth_pop3.inc
===================================================================
RCS file: /cvsroot/mrbs/mrbs/web/auth_pop3.inc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** auth_pop3.inc 31 Oct 2003 01:17:57 -0000 1.4
--- auth_pop3.inc 14 Nov 2003 22:20:24 -0000 1.5
***************
*** 18,34 ****
*/
! /* getAuth($realm)
! *
! * Request that the username/password be given for the specified realm
! *
! * $realm - Which username/password do we want.
! *
! * Nothing
! */
! function authGet($realm)
! {
! Header("WWW-Authenticate: Basic realm=\"$realm\"");
! Header("HTTP/1.0 401 Unauthorized");
! }
/* authValidateUser($user, $pass)
--- 18,23 ----
*/
! /* ~~JFL 2003/11/12 By default, use the http session mechanism */
! if (!isset($auth['session'])) $auth['session']='http';
/* authValidateUser($user, $pass)
***************
*** 54,58 ****
if(!isset($user) || !isset($pass) || strlen($pass)==0)
{
- authGet($auth["realm"]);
return 0;
}
--- 43,46 ----
***************
*** 111,118 ****
}
-
- // If we failed prompt for username/password
- authGet($realm);
-
// return failure
return 0;
--- 99,102 ----
***************
*** 143,159 ****
// Everybody else is access level '1'
return 1;
- }
-
-
- function getUserName()
- {
- global $PHP_AUTH_USER;
- return $PHP_AUTH_USER;
- }
-
- function getUserPassword()
- {
- global $PHP_AUTH_PW;
- return $PHP_AUTH_PW;
}
--- 127,130 ----
|