"Required": true,
"ValueType": "password",
"DefaultValue": 0,
- "FieldType": "TextBox"
+ "FieldType": "Password"
},
"FdConnectTimeout": {
"Required": false,
"Required": false,
"ValueType": "password",
"DefaultValue": 0,
- "FieldType": "TextBox"
+ "FieldType": "Password"
},
"Password": {
"Required": true,
"ValueType": "password",
"DefaultValue": 0,
- "FieldType": "TextBox"
+ "FieldType": "Password"
},
"FdStorageAddress": {
"Required": false,
"Required": false,
"ValueType": "password",
"DefaultValue": 0,
- "FieldType": "TextBox"
+ "FieldType": "Password"
},
"Password": {
"Required": true,
"ValueType": "password",
"DefaultValue": 0,
- "FieldType": "TextBox"
+ "FieldType": "Password"
},
"Device": {
"Required": true,
"Required": false,
"ValueType": "str",
"DefaultValue": 0,
- "FieldType": "TextBox"
+ "FieldType": "Password"
},
"Password": {
"Required": false,
"ValueType": "str",
"DefaultValue": 0,
- "FieldType": "TextBox"
+ "FieldType": "Password"
},
"dbuser": {
"Required": false,
"Required": true,
"ValueType": "password",
"DefaultValue": 0,
- "FieldType": "TextBox"
+ "FieldType": "Password"
},
"JobAcl": {
"Required": false,
"Required": true,
"ValueType": "password",
"DefaultValue": 0,
- "FieldType": "TextBox"
+ "FieldType": "Password"
},
"Monitor": {
"Required": false,
"Required": true,
"ValueType": "password",
"DefaultValue": 0,
- "FieldType": "TextBox"
+ "FieldType": "Password"
},
"Address": {
"Required": false,
"Required": true,
"ValueType": "password",
"DefaultValue": 0,
- "FieldType": "TextBox"
+ "FieldType": "Password"
},
"Address": {
"Required": false,
"Required": true,
"ValueType": "password",
"DefaultValue": 0,
- "FieldType": "TextBox"
+ "FieldType": "Password"
},
"TlsAuthenticate": {
"Required": false,
"Required": true,
"ValueType": "password",
"DefaultValue": 0,
- "FieldType": "TextBox"
+ "FieldType": "Password"
},
"TlsAuthenticate": {
"Required": false,
Prado::using('Application.Web.Portlets.DirectiveComboBox');
Prado::using('Application.Web.Portlets.DirectiveInteger');
Prado::using('Application.Web.Portlets.DirectiveListBox');
+Prado::using('Application.Web.Portlets.DirectivePassword');
Prado::using('Application.Web.Portlets.DirectiveSize');
Prado::using('Application.Web.Portlets.DirectiveTextBox');
Prado::using('Application.Web.Portlets.DirectiveMultiTextBox');
'DirectiveComboBox',
'DirectiveInteger',
'DirectiveListBox',
+ 'DirectivePassword',
'DirectiveTextBox',
'DirectiveSize',
'DirectiveTimePeriod'
--- /dev/null
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum - Bacula web interface
+ *
+ * Copyright (C) 2013-2019 Kern Sibbald
+ *
+ * The main author of Baculum is Marcin Haba.
+ * The original author of Bacula is Kern Sibbald, with contributions
+ * from many others, a complete list can be found in the file AUTHORS.
+ *
+ * You may use this file and others of this release according to the
+ * license defined in the LICENSE file, which includes the Affero General
+ * Public License, v3.0 ("AGPLv3") and some additional permissions and
+ * terms pursuant to its AGPLv3 Section 7.
+ *
+ * This notice must be preserved when any source code is
+ * conveyed and/or propagated.
+ *
+ * Bacula(R) is a registered trademark of Kern Sibbald.
+ */
+
+Prado::using('System.Web.UI.ActiveControls.TActiveLabel');
+Prado::using('System.Web.UI.ActiveControls.TActiveTextBox');
+Prado::using('Application.Web.Portlets.DirectiveTemplate');
+
+class DirectivePassword extends DirectiveTemplate {
+
+ public function getValue() {
+ $value = $this->Directive->getText();
+ if (empty($value)) {
+ $value = null;
+ }
+ return $value;
+ }
+
+ public function createDirective() {
+ $this->Label->Text = $this->getLabel();
+ $directive_value = $this->getDirectiveValue();
+ $default_value = $this->getDefaultValue();
+ if ($this->getInConfig() === false && empty($directive_value)) {
+ if ($default_value !== 0) {
+ $directive_value = $default_value;
+ } else {
+ $directive_value = '';
+ }
+ }
+ $this->Directive->setText($directive_value);
+ $validate = $this->getRequired();
+ $this->DirectiveValidator->setVisible($validate);
+ }
+}
+?>
--- /dev/null
+<div class="w3-row w3-margin-bottom<%=!$this->display_directive ? ' hide' : '';%>">
+ <div class="w3-col w3-quarter"><com:TActiveLabel ID="Label" ActiveControl.EnableUpdate="false" Visible="<%=$this->display_directive%>" />:</div>
+ <div class="w3-col w3-threequarter directive_value">
+ <com:TActiveTextBox ID="Directive"
+ TextMode="Password"
+ PersistPassword="true"
+ OnTextChanged="saveValue"
+ CssClass="w3-input w3-border w3-twothird"
+ Visible="<%=$this->display_directive%>"
+ ActiveControl.EnableUpdate="false"
+ AutoTrim="true"
+ />
+ <%=$this->getRequired() ? ' <i class="fa fa-asterisk w3-text-red" style="line-height: 40px"></i>' : ''%>
+ <a href="javascript:void(0)" onclick="var el = document.getElementById('<%=$this->Directive->ClientID%>'); el.type = el.type == 'text' ? 'password' : 'text'"><i class="fa fa-eye"></i></a>
+ <i class="fa fa-undo reset_btn" onclick="document.getElementById('<%=$this->Directive->ClientID%>').value = '<%=$this->getDefaultValue() === 0 ? '' : $this->getDefaultValue()%>';" alt="<%[ Reset to default value ]%>" title="<%[ Reset to default value ]%>"></i>
+ <i class="fa fa-trash-alt remove_btn" onclick="document.getElementById('<%=$this->Directive->ClientID%>').value = '';" alt="<%[ Remove directive ]%>" title="<%[ Remove directive ]%>"></i>
+ <com:TRequiredFieldValidator
+ ID="DirectiveValidator"
+ ValidationGroup="<%=$this->getValidationGroup()%>"
+ Display="Dynamic"
+ ControlToValidate="Directive"
+ FocusOnError="true"
+ Enabled="<%=$this->getRequired() && $this->getShow()%>"
+ ><%[ Field required. ]%></com:TRequiredFieldValidator>
+ </div>
+</div>
Prado::using('Application.Web.Portlets.DirectiveComboBox');
Prado::using('Application.Web.Portlets.DirectiveInteger');
Prado::using('Application.Web.Portlets.DirectiveListBox');
+Prado::using('Application.Web.Portlets.DirectivePassword');
Prado::using('Application.Web.Portlets.DirectiveSize');
Prado::using('Application.Web.Portlets.DirectiveTextBox');
Prado::using('Application.Web.Portlets.DirectiveMultiTextBox');
'DirectiveComboBox',
'DirectiveInteger',
'DirectiveListBox',
+ 'DirectivePassword',
'DirectiveTextBox',
'DirectiveSize',
'DirectiveTimePeriod'