From 5efdec617cd1d15662bb8e8de4ae57d262603b4d Mon Sep 17 00:00:00 2001 From: Marcin Haba Date: Mon, 28 Apr 2014 04:18:23 +0200 Subject: [PATCH] Clear bvfs cache and set debug options available only for admin --- gui/baculum/protected/Pages/Home.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gui/baculum/protected/Pages/Home.php b/gui/baculum/protected/Pages/Home.php index 854fd7b357..c8fd3a0fdc 100644 --- a/gui/baculum/protected/Pages/Home.php +++ b/gui/baculum/protected/Pages/Home.php @@ -35,6 +35,8 @@ class Home extends BaculumPage $this->SettingsWizardBtn->Visible = $this->User->getIsAdmin(); $this->MediaBtn->Visible = $this->User->getIsAdmin(); + $this->ClearBvfsCache->Visible = $this->User->getIsAdmin(); + $this->Logging->Visible = $this->User->getIsAdmin(); if(!$this->IsPostBack && !$this->IsCallBack) { $this->Logging->Checked = $this->getModule('logging')->isDebugOn(); @@ -65,11 +67,15 @@ class Home extends BaculumPage } public function setDebug($sender, $param) { - $this->getModule('logging')->enableDebug($this->Logging->Checked); + if($this->User->getIsAdmin() === true) { + $this->getModule('logging')->enableDebug($this->Logging->Checked); + } } public function clearBvfsCache($sender, $param) { - $this->getModule('api')->set(array('bvfs', 'clear'), array()); + if($this->User->getIsAdmin() === true) { + $this->getModule('api')->set(array('bvfs', 'clear'), array()); + } } } ?> \ No newline at end of file -- 2.39.5