diff options
-rw-r--r-- | inc/html.php | 4 | ||||
-rw-r--r-- | inc/infoutils.php | 2 | ||||
-rw-r--r-- | inc/template.php | 12 |
3 files changed, 9 insertions, 9 deletions
diff --git a/inc/html.php b/inc/html.php index 42457670b..7c7d78ee7 100644 --- a/inc/html.php +++ b/inc/html.php @@ -82,14 +82,14 @@ function html_login(){ </fieldset> </form> <?php - if($auth->canDo('addUser') && actionOK('register')){ + if($auth && $auth->canDo('addUser') && actionOK('register')){ print '<p>'; print $lang['reghere']; print ': <a href="'.wl($ID,'do=register').'" rel="nofollow" class="wikilink1">'.$lang['register'].'</a>'; print '</p>'; } - if ($auth->canDo('modPass') && actionOK('resendpwd')) { + if ($auth && $auth->canDo('modPass') && actionOK('resendpwd')) { print '<p>'; print $lang['pwdforget']; print ': <a href="'.wl($ID,'do=resendpwd').'" rel="nofollow" class="wikilink1">'.$lang['btn_resendpwd'].'</a>'; diff --git a/inc/infoutils.php b/inc/infoutils.php index 255b49ed4..6da344d81 100644 --- a/inc/infoutils.php +++ b/inc/infoutils.php @@ -168,7 +168,7 @@ function check(){ global $auth; msg('You are currently logged in as '.$_SESSION[DOKU_COOKIE]['auth']['user'].' ('.$INFO['userinfo']['name'].')',0); - $info = $auth->getUserData($_SESSION[DOKU_COOKIE]['auth']['user']); + if($auth) $info = $auth->getUserData($_SESSION[DOKU_COOKIE]['auth']['user']); msg('You are part of the groups '.implode($info['grps'],', '),0); }else{ msg('You are currently not logged in',0); diff --git a/inc/template.php b/inc/template.php index 3bf9be114..c941a64f4 100644 --- a/inc/template.php +++ b/inc/template.php @@ -435,7 +435,7 @@ function tpl_button($type){ print html_topbtn(); return true; case 'login': - if($conf['useacl']){ + if($conf['useacl'] && $auth){ if($_SERVER['REMOTE_USER']){ print html_btn('logout',$ID,'',array('do' => 'logout',)); }else{ @@ -451,7 +451,7 @@ function tpl_button($type){ } return false; case 'subscription': - if($conf['useacl'] && $ACT == 'show' && $conf['subscribers'] == 1){ + if($conf['useacl'] && $auth && $ACT == 'show' && $conf['subscribers'] == 1){ if($_SERVER['REMOTE_USER']){ if($INFO['subscribed']){ print html_btn('unsubscribe',$ID,'',array('do' => 'unsubscribe',)); @@ -466,7 +466,7 @@ function tpl_button($type){ print html_btn('backlink',$ID,'',array('do' => 'backlink')); return true; case 'profile': - if($conf['useacl'] && $_SERVER['REMOTE_USER'] && + if($conf['useacl'] && $_SERVER['REMOTE_USER'] && $auth && $auth->canDo('Profile') && ($ACT!='profile')){ print html_btn('profile',$ID,'',array('do' => 'profile')); return true; @@ -564,7 +564,7 @@ function tpl_actionlink($type,$pre='',$suf=''){ } return false; case 'login': - if($conf['useacl']){ + if($conf['useacl'] && $auth){ if($_SERVER['REMOTE_USER']){ tpl_link(wl($ID,'do=logout'),$pre.$lang['btn_logout'].$suf,'class="action logout" rel="nofollow"'); }else{ @@ -581,7 +581,7 @@ function tpl_actionlink($type,$pre='',$suf=''){ return false; case 'subscribe': case 'subscription': - if($conf['useacl'] && $ACT == 'show' && $conf['subscribers'] == 1){ + if($conf['useacl'] && $auth && $ACT == 'show' && $conf['subscribers'] == 1){ if($_SERVER['REMOTE_USER']){ if($INFO['subscribed']) { tpl_link(wl($ID,'do=unsubscribe'),$pre.$lang['btn_unsubscribe'].$suf,'class="action unsubscribe" rel="nofollow"'); @@ -596,7 +596,7 @@ function tpl_actionlink($type,$pre='',$suf=''){ tpl_link(wl($ID,'do=backlink'),$pre.$lang['btn_backlink'].$suf, 'class="action backlink" rel="nofollow"'); return true; case 'profile': - if($conf['useacl'] && $_SERVER['REMOTE_USER'] && + if($conf['useacl'] && $auth && $_SERVER['REMOTE_USER'] && $auth->canDo('Profile') && ($ACT!='profile')){ tpl_link(wl($ID,'do=profile'),$pre.$lang['btn_profile'].$suf, 'class="action profile" rel="nofollow"'); return true; |