summaryrefslogtreecommitdiff
path: root/inc/confutils.php
diff options
context:
space:
mode:
authorAnika Henke <anika@selfthinker.org>2011-02-22 23:04:53 +0000
committerAnika Henke <anika@selfthinker.org>2011-02-22 23:04:53 +0000
commit3a48618a538412994ec244d5a9fde5c4a6161d10 (patch)
tree0ec52d772713d4e5839a2f90b8e5ecf0fa6a37e9 /inc/confutils.php
parentd012ef7d2a1019a89c7fbd8c2479d7c1ed10b526 (diff)
downloadrpg-3a48618a538412994ec244d5a9fde5c4a6161d10.tar.gz
rpg-3a48618a538412994ec244d5a9fde5c4a6161d10.tar.bz2
improved actionOK and its use
Diffstat (limited to 'inc/confutils.php')
-rw-r--r--inc/confutils.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/inc/confutils.php b/inc/confutils.php
index 26ed4f087..b2d25fb65 100644
--- a/inc/confutils.php
+++ b/inc/confutils.php
@@ -241,17 +241,24 @@ function actionOK($action){
// prepare disabled actions array and handle legacy options
$disabled = explode(',',$conf['disableactions']);
$disabled = array_map('trim',$disabled);
- if(isset($conf['openregister']) && !$conf['openregister']) $disabled[] = 'register';
- if(isset($conf['resendpasswd']) && !$conf['resendpasswd']) $disabled[] = 'resendpwd';
- if(isset($conf['subscribers']) && !$conf['subscribers']) {
- $disabled[] = 'subscribe';
- }
- if (is_null($auth) || !$auth->canDo('addUser')) {
+ if(!empty($conf['openregister']) || is_null($auth) || !$auth->canDo('addUser')) {
$disabled[] = 'register';
}
- if (is_null($auth) || !$auth->canDo('modPass')) {
+ if(!empty($conf['resendpasswd']) || is_null($auth) || !$auth->canDo('modPass')) {
$disabled[] = 'resendpwd';
}
+ if(!empty($conf['subscribers']) || is_null($auth)) {
+ $disabled[] = 'subscribe';
+ }
+ if (is_null($auth) || !$auth->canDo('Profile')) {
+ $disabled[] = 'profile';
+ }
+ if (is_null($auth)) {
+ $disabled[] = 'login';
+ }
+ if (is_null($auth) || !$auth->canDo('logout')) {
+ $disabled[] = 'logout';
+ }
$disabled = array_unique($disabled);
}