<p><span><%[ Most often used: ]%></span><span id="jobs_most"></span></p>
<p><span><%[ Execution count most used: ]%></span><span id="jobs_most_count"></span> <%[ times ]%></p>
</fieldset>
- <fieldset class="dashboard_field">
+ <fieldset class="dashboard_field"<%=$this->User->getIsAdmin() === false ? ' style="display: none;"' : ''%>>
<legend><%[ Database ]%></legend>
<img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/database.png" alt="" />
<p><span><%[ Database type: ]%></span><span><%=$this->dbtype%></span></p>
<legend><%[ Restore Wizard ]%></legend>
<a class="big" href="<%=$this->Service->constructUrl('RestoreWizard')%>" style="line-height: 73px; margin: 0 45px"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/restore.png" alt="" /><%[ Perform Restore ]%></a>
</fieldset>
- <fieldset class="dashboard_field">
+ <fieldset class="dashboard_field"<%=$this->User->getIsAdmin() === false ? ' style="display: none;"' : ''%>>
<legend><%[ Configuration Wizard ]%></legend>
<a class="big" href="<%=$this->Service->constructUrl('ConfigurationWizard')%>" style="line-height: 73px; margin: 0 45px"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/setting.png" alt="" /><%[ Baculum Settings ]%></a>
</fieldset>
<div id="console">
<a id="clear_bvfs_cache" href="javascript: void(0)"><com:TActiveImageButton ID="ClearBvfsCache" OnCallback="clearBvfsCache" Attributes.onclick="return (confirm('<%=Prado::localize('This action will clear bvfs cache that was created during preparing restore files. There is not recommended use this action during restore job working. Are you sure?')%>'));" ImageUrl="<%=$this->getPage()->getTheme()->getBaseUrl()%>/trash_icon.png" AlternateText="<%[ clear bvfs cache ]%>" /><com:TLabel ForControl="ClearBvfsCache"><%[ clear bvfs cache ]%></com:TLabel></a>
<a id="logging" href="javascript:void(0)"><com:TActiveCheckBox ID="Logging" OnCallback="setDebug" Attributes.onclick="return (this.checked === false || confirm('<%=Prado::localize('Debug files enable possibility to save most of actions executed on Baculum WebGUI. Debug functionality should be enabled if is happening shomething wrong with Baculum or something that looks like a bug. Logs can be useful for detecting a problems in Baculum working. After confirmation this message Baculum debug files will be continuously saving in /protected/Data/ directory. Are you sure?')%>'));" /><com:TLabel ForControl="Logging"><%[ Enable debug ]%></com:TLabel></a>
- <a id="volumes_tools_launcher" href="javascript:void(0)"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/tape_tools_icon.png" alt="<%[ volumes tools ]%>" /><span><%[ volumes tools ]%></span></a>
+ <a id="volumes_tools_launcher" href="javascript:void(0)" <%=$this->User->getIsAdmin() === false ? ' style="display: none;"' : ''%>><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/tape_tools_icon.png" alt="<%[ volumes tools ]%>" /><span><%[ volumes tools ]%></span></a>
<a id="console_launcher" href="javascript:void(0)"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/console_icon.png" alt="<%[ Bacula console ]%>" /><span><%[ show console ]%></span></a>
<com:Application.Portlets.VolumesTools ID="VolumesTools" />
<com:Application.Portlets.Console ID="Console" />
public $jobs_states = null;
- public $dbtype = null;
+ public $dbtype = '';
public $windowIds = array('Storage', 'Client', 'Volume', 'Pool', 'Job', 'JobRun');
$this->Director->dataSource = array_combine($directors, $directors);
$this->Director->SelectedValue = $_SESSION['director'];
$this->Director->dataBind();
- $this->dbtype = $this->getModule('configuration')->getDbNameByType($appConfig['db']['type']);
+ if ($this->User->getIsAdmin() === true) {
+ $this->dbtype = $this->getModule('configuration')->getDbNameByType($appConfig['db']['type']);
+ }
$this->setJobsStates();
$this->setJobs();
$this->setClients();
$_SESSION['monitor_data']['clients'] = $this->getModule('api')->get(array('clients'))->output;
$_SESSION['monitor_data']['pools'] = $this->getModule('api')->get(array('pools'))->output;
$_SESSION['monitor_data']['jobtotals'] = $this->getModule('api')->get(array('jobs', 'totals'))->output;
- $_SESSION['monitor_data']['dbsize'] = $this->getModule('api')->get(array('dbsize'))->output;
+ if ($this->User->getIsAdmin() === true) {
+ $_SESSION['monitor_data']['dbsize'] = $this->getModule('api')->get(array('dbsize'))->output;
+ }
$runningJobStates = $this->Application->getModule('misc')->getRunningJobStates();
const BVFS_PATH_PREFIX = 'b2';
+ public function onPreInit($param) {
+ parent::onPreInit($param);
+ $this->Application->getModule('users')->loginUser();
+ }
+
public function onInit($param) {
parent::onInit($param);
- $this->Application->getModule('users')->loginUser();
if(!$this->IsPostBack && !$this->IsCallBack) {
$this->setBrowserFiles(array());
$this->setFileVersions(array());