From de4d479af254512700b8aedce9c1a597880322b0 Mon Sep 17 00:00:00 2001 From: Adrian Lang Date: Mon, 17 May 2010 11:05:23 +0200 Subject: Let actionOK detect auth backend capabilities --- inc/confutils.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'inc/confutils.php') diff --git a/inc/confutils.php b/inc/confutils.php index 7850682ba..0c1c0c64a 100644 --- a/inc/confutils.php +++ b/inc/confutils.php @@ -241,6 +241,7 @@ function actionOK($action){ static $disabled = null; if(is_null($disabled)){ global $conf; + global $auth; // prepare disabled actions array and handle legacy options $disabled = explode(',',$conf['disableactions']); @@ -250,6 +251,12 @@ function actionOK($action){ if(isset($conf['subscribers']) && !$conf['subscribers']) { $disabled[] = 'subscribe'; } + if (is_null($auth) || !$auth->canDo('addUser')) { + $disabled[] = 'register'; + } + if (is_null($auth) || !$auth->canDo('modPass')) { + $disabled[] = 'resendpwd'; + } $disabled = array_unique($disabled); } -- cgit v1.2.3