]> git.sur5r.net Git - bacula/bacula/commitdiff
Clear bvfs cache and set debug options available only for admin
authorMarcin Haba <marcin.haba@bacula.pl>
Mon, 28 Apr 2014 02:18:23 +0000 (04:18 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Mon, 28 Apr 2014 02:18:23 +0000 (04:18 +0200)
gui/baculum/protected/Pages/Home.php

index 854fd7b357afbf547729eb9e3733daf695c71260..c8fd3a0fdc790293db6fd4338fcfdb0757d2f6d8 100644 (file)
@@ -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