From 11799630b5d82fc768ac59ccd056bdcf9c3e54dd Mon Sep 17 00:00:00 2001 From: andi Date: Mon, 20 Jun 2005 22:34:00 +0200 Subject: handle missing users.auth and acl.auth gracefully darcs-hash:20050620203400-9977f-515a59d1131ae5dafc6c722f893bf6c308121832.gz --- inc/auth.php | 6 +++++- inc/auth/plain.php | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/inc/auth.php b/inc/auth.php index 863bb3c49..fdf5d17f3 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -29,7 +29,11 @@ if($conf['useacl']){ auth_login($_REQUEST['u'],$_REQUEST['p'],$_REQUEST['r']); //load ACL into a global array - $AUTH_ACL = file(DOKU_INC.'conf/acl.auth.php'); + if(is_readable(DOKU_INC.'conf/acl.auth.php')){ + $AUTH_ACL = file(DOKU_INC.'conf/acl.auth.php'); + }else{ + $AUTH_ACL = array(); + } } /** diff --git a/inc/auth/plain.php b/inc/auth/plain.php index eaa01b79d..039fb422d 100644 --- a/inc/auth/plain.php +++ b/inc/auth/plain.php @@ -93,6 +93,9 @@ function auth_createUser($user,$pass,$name,$mail){ */ function auth_plain_loadUserData(){ $data = array(); + if(!@file_exists(DOKU_INC.'conf/users.auth.php')){ + return $data; + } $lines = file(DOKU_INC.'conf/users.auth.php'); foreach($lines as $line){ $line = preg_replace('/#.*$/','',$line); //ignore comments -- cgit v1.2.3