summaryrefslogtreecommitdiff
path: root/inc/template.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2006-12-03 14:41:04 +0100
committerAndreas Gohr <andi@splitbrain.org>2006-12-03 14:41:04 +0100
commitf8cc712e2ad522d0bd56b9ba3983cd42abf664ad (patch)
treef05652b1c134709880c8bde9b136f25055fffeb6 /inc/template.php
parent4765d61c46935bc95f8f28459004374dfa77797f (diff)
downloadrpg-f8cc712e2ad522d0bd56b9ba3983cd42abf664ad.tar.gz
rpg-f8cc712e2ad522d0bd56b9ba3983cd42abf664ad.tar.bz2
manager user/group
This patch adds support for a manager option as suggested in http://www.freelists.org/archives/dokuwiki/11-2006/msg00314.html darcs-hash:20061203134104-7ad00-72ff6422bbb4f79be325c7e77255e1eee32d0f6b.gz
Diffstat (limited to 'inc/template.php')
-rw-r--r--inc/template.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/inc/template.php b/inc/template.php
index 9d3efb339..27923f404 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -137,6 +137,7 @@ function tpl_content_core(){
* @author Andreas Gohr <andi@splitbrain.org>
*/
function tpl_admin(){
+ global $INFO;
$plugin = NULL;
if (!empty($_REQUEST['page'])) {
@@ -149,10 +150,16 @@ function tpl_admin(){
}
}
- if ($plugin !== NULL)
- $plugin->html();
- else
+ if ($plugin !== NULL){
+ if($plugin->forAdminOnly() && !$INFO['isadmin']){
+ msg('For admins only',-1);
+ html_admin();
+ }else{
+ $plugin->html();
+ }
+ }else{
html_admin();
+ }
}
/**
@@ -422,7 +429,7 @@ function tpl_button($type){
}
break;
case 'admin':
- if($INFO['perm'] == AUTH_ADMIN)
+ if($INFO['ismanager'])
print html_btn('admin',$ID,'',array('do' => 'admin'));
break;
case 'backtomedia':
@@ -549,7 +556,7 @@ function tpl_actionlink($type,$pre='',$suf=''){
}
return false;
case 'admin':
- if($INFO['perm'] == AUTH_ADMIN){
+ if($INFO['ismanager']){
tpl_link(wl($ID,'do=admin'),$pre.$lang['btn_admin'].$suf,'class="action admin"');
return true;
}