summaryrefslogtreecommitdiff
path: root/inc/auth.php
diff options
context:
space:
mode:
authorAndreas Gohr <gohr@cosmocode.de>2006-01-10 10:29:03 +0100
committerAndreas Gohr <gohr@cosmocode.de>2006-01-10 10:29:03 +0100
commitf5cb575df722c05fc0a6ba960bd2a79d5ed5621c (patch)
tree3638e9a835a860e94a86c52e745880fcc4c6810f /inc/auth.php
parent96331712eb165972845b097644336ca87a81dfcd (diff)
downloadrpg-f5cb575df722c05fc0a6ba960bd2a79d5ed5621c.tar.gz
rpg-f5cb575df722c05fc0a6ba960bd2a79d5ed5621c.tar.bz2
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
Diffstat (limited to 'inc/auth.php')
-rw-r--r--inc/auth.php9
1 files changed, 8 insertions, 1 deletions
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');