From 7afff4dd37ab13714e10814138d9a09b515298f2 Mon Sep 17 00:00:00 2001 From: skeeter Date: Sat, 28 Jul 2001 17:54:59 +0000 Subject: [PATCH] This limits holiday management functions to only admins. --- calendar/inc/class.boholiday.inc.php | 16 ++++++++++++++++ calendar/inc/class.uiholiday.inc.php | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/calendar/inc/class.boholiday.inc.php b/calendar/inc/class.boholiday.inc.php index d9c2ad90ef..cbc55d5a16 100755 --- a/calendar/inc/class.boholiday.inc.php +++ b/calendar/inc/class.boholiday.inc.php @@ -434,5 +434,21 @@ return $this->cached_holidays; } /* End Calendar functions */ + + function check_admin() + { + global $phpgw, $phpgw_info; + + $admin = False; + if(@$phpgw_info['user']['apps']['admin']) + { + $admin = True; + } + + if(!$admin) + { + Header('Location: ' . $phpgw->link('/index.php')); + } + } } ?> diff --git a/calendar/inc/class.uiholiday.inc.php b/calendar/inc/class.uiholiday.inc.php index ff1c974efb..c296a7ac28 100755 --- a/calendar/inc/class.uiholiday.inc.php +++ b/calendar/inc/class.uiholiday.inc.php @@ -39,6 +39,7 @@ $phpgw->nextmatchs = CreateObject('phpgwapi.nextmatchs'); $this->bo = CreateObject('calendar.boholiday'); + $this->bo->check_admin(); $this->base_url = $this->bo->base_url; $this->template_dir = $phpgw->common->get_tpl_dir('calendar'); } @@ -46,7 +47,7 @@ function admin() { global $phpgw, $phpgw_info; - + unset($phpgw_info['flags']['noheader']); unset($phpgw_info['flags']['nonavbar']); $phpgw_info['flags']['noappfooter'] = True;