From f5cb575df722c05fc0a6ba960bd2a79d5ed5621c Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 10 Jan 2006 10:29:03 +0100 Subject: external authentication This patch adds the functionality to override the usual auth_mechanism completely and replace it with your own. This can be used to authenticate against Apache auth mechanisms or third party software cookies. A very basic example for using PunBB's $pun_user variable is included. darcs-hash:20060110092903-6e07b-7c7750da4eb4e9116ddc28c77015488ea500c07d.gz --- inc/auth.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'inc/auth.php') diff --git a/inc/auth.php b/inc/auth.php index 26d208a1f..f9d00b9b1 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -85,8 +85,15 @@ define('AUTH_DELETE',16); define('AUTH_ADMIN',255); + // do the login either by cookie or provided credentials if($conf['useacl']){ - auth_login($_REQUEST['u'],$_REQUEST['p'],$_REQUEST['r']); + // external trust mechanism in place? + if(auth_canDo('trustExternal') && !is_null($auth)){ + $auth->trustExternal($_REQUEST['u'],$_REQUEST['p'],$_REQUEST['r']); + }else{ + auth_login($_REQUEST['u'],$_REQUEST['p'],$_REQUEST['r']); + } + //load ACL into a global array if(is_readable(DOKU_CONF.'acl.auth.php')){ $AUTH_ACL = file(DOKU_CONF.'acl.auth.php'); -- cgit v1.2.3