309 lines
17 KiB
HTML
309 lines
17 KiB
HTML
<!-- (c) 2005-2017 by Martin Willisegger -->
|
|
<!-- -->
|
|
<!-- Project : NagiosQL -->
|
|
<!-- Component : domain administration template -->
|
|
<!-- Website : http://www.nagiosql.org -->
|
|
<!-- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -->
|
|
<!-- Author : $LastChangedBy: martin $ -->
|
|
<!-- Version : 3.3.0 -->
|
|
<!-- Revision : $LastChangedRevision: 2 $ -->
|
|
<!-- BEGIN header -->
|
|
<div id="content_main">
|
|
<div id="content_title">{TITLE}</div>
|
|
<div class="dbmessage">{ERRMESSAGE}</div>
|
|
<!-- END header -->
|
|
<!-- BEGIN datainsert -->
|
|
<script language="JavaScript" type="text/JavaScript">
|
|
<!--
|
|
// Interrupt input
|
|
function abort() {
|
|
this.location.href = "{ACTION_INSERT}";
|
|
}
|
|
// Send form
|
|
function LockButton() {
|
|
if (checkForm() == false) {
|
|
return false;
|
|
} else {
|
|
document.frmDomainInsert.submit();
|
|
document.frmDomainInsert.subForm.disabled = true;
|
|
}
|
|
}
|
|
// Check form entries
|
|
function checkForm() {
|
|
// Are all required fields filled in?
|
|
if (document.frmDomainInsert.hidId.value == '0') {
|
|
var fields1 = "tfDomain,tfAlias";
|
|
var fields2 = "";
|
|
var fields3 = "";
|
|
} else {
|
|
var fields1 = "tfDomain,tfAlias,tfServername,tfBasedir,tfHostconfigdir,tfServiceconfigdir,tfBackupdir,tfHostbackupdir,tfServicebackupdir,tfNagiosBaseDir";
|
|
var fields2 = "tfUsername,tfPassword";
|
|
var fields3 = "tfUsername,tfSSHKey";
|
|
}
|
|
var msg1 = "{FILL_ALLFIELDS}";
|
|
var msg2 = "{FILL_ILLEGALCHARS}";
|
|
var header = "{LANG_FORMCHECK}";
|
|
var form = document.frmDomainInsert;
|
|
var check = false;
|
|
check = checkfields(fields1,form,myFocusObject);
|
|
if (check == false) {
|
|
msginit(msg1,header,1);
|
|
return false;
|
|
}
|
|
if (form.selMethod.value == 2) {
|
|
var check2 = false;
|
|
check2 = checkfields(fields2,form,myFocusObject);
|
|
if (check2 == false) {
|
|
msginit(msg1,header,1);
|
|
return false;
|
|
}
|
|
}
|
|
if (form.selMethod.value == 3) {
|
|
var check2a = false;
|
|
var check2b = false;
|
|
check2a = checkfields(fields2,form,myFocusObject);
|
|
check2b = checkfields(fields3,form,myFocusObject);
|
|
if ((check2a == false) && (check2b == false)) {
|
|
msginit(msg1,header,1);
|
|
return false;
|
|
}
|
|
}
|
|
// Check for illegal chars
|
|
if (form.tfDomain.value.match(/[^a-zA-Z0-9.@_-]/)) {
|
|
msginit(msg2+" {LANG_DOMAIN}",header,1);
|
|
form.tfDomain.focus();
|
|
return false;
|
|
}
|
|
}
|
|
// Check required fields
|
|
function checkMust() {
|
|
if (document.frmDomainInsert.hidId.value != '0') {
|
|
if ((document.frmDomainInsert.tfUsername.value == "") &&
|
|
(document.frmDomainInsert.tfPassword.value == "") &&
|
|
(document.frmDomainInsert.tfSSHKey.value == "")) {
|
|
document.frmDomainInsert.tfUsername.className = "inpmust";
|
|
document.frmDomainInsert.tfPassword.className = "inpmust";
|
|
document.frmDomainInsert.tfSSHKey.className = "inpmust";
|
|
} else if (((document.frmDomainInsert.tfUsername.value != "") ||
|
|
(document.frmDomainInsert.tfPassword.value != "")) &&
|
|
(document.frmDomainInsert.tfSSHKey.value == "")) {
|
|
document.frmDomainInsert.tfSSHKey.className = "inp";
|
|
document.frmDomainInsert.tfUsername.className = "inpmust";
|
|
document.frmDomainInsert.tfPassword.className = "inpmust";
|
|
} else if (document.frmDomainInsert.tfSSHKey.value != "") {
|
|
document.frmDomainInsert.tfSSHKey.className = "inpmust";
|
|
document.frmDomainInsert.tfUsername.className = "inpmust";
|
|
document.frmDomainInsert.tfPassword.className = "inp";
|
|
}
|
|
}
|
|
}
|
|
// Enable hidden fields
|
|
function showFields(key) {
|
|
if (key == 1) {
|
|
document.getElementById('user').className = "elementHide";
|
|
document.getElementById('passwd').className = "elementHide";
|
|
document.getElementById('keypath').className = "elementHide";
|
|
} else if (key == 2) {
|
|
document.getElementById('user').className = "elementShow";
|
|
document.getElementById('passwd').className = "elementShow";
|
|
document.getElementById('keypath').className = "elementHide";
|
|
} else {
|
|
document.getElementById('user').className = "elementShow";
|
|
document.getElementById('passwd').className = "elementShow";
|
|
document.getElementById('keypath').className = "elementShow";
|
|
}
|
|
}
|
|
//-->
|
|
</script>
|
|
<form name="frmDomainInsert" method="post" action="{ACTION_INSERT}">
|
|
<table border="0" cellpadding="0" class="content_formtable">
|
|
<tr>
|
|
<td class="content_tbl_row1">{LANG_DOMAIN} *</td>
|
|
<td class="content_tbl_row2"><input name="tfDomain" type="text" id="tfDomain" tabindex="1" value="{DAT_DOMAIN}" style="width:350px;" {DOMAIN_DISABLE} class="{LOCKCLASS}">
|
|
<td class="content_tbl_row2"><img src="{IMAGE_PATH}tip.gif" alt="{LANG_HELP}" title="{LANG_HELP}" width="18" height="18" onclick="dialoginit('domain','domain','all','Info')" class="infobutton_1"><input name="hidDomain" type="hidden" id="hidDomain" value="{DAT_DOMAIN}"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>{LANG_DESCRIPTION} *</td>
|
|
<td colspan="2"><input name="tfAlias" type="text" id="tfAlias" tabindex="2" value="{DAT_ALIAS}" style="width:350px;" class="inpmust"></td>
|
|
</tr>
|
|
<tr {COMMON_INVISIBLE}>
|
|
<td>{LANG_SERVER_NAME} *</td>
|
|
<td colspan="2"><input name="tfServername" type="text" id="tfServername" tabindex="3" value="{DAT_SERVER}" {SERVER_DISABLE} style="width:350px;" class="inpmust"></td>
|
|
</tr>
|
|
<tr {COMMON_INVISIBLE}>
|
|
<td>{LANG_METHOD}</td>
|
|
<td colspan="2">
|
|
<select name="selMethod" id="selMethod" tabindex="4" {METHOD_DISABLE} onchange="showFields(this.value)" class="selectborder">
|
|
<option value="1" {FILE_SELECTED}>Fileaccess</option>
|
|
<option value="2" {FTP_SELECTED}>FTP</option>
|
|
<option value="3" {SFTP_SELECTED}>SSH/SFTP</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr id="user" class="{CLASS_NAME_1}">
|
|
<td>{LANG_USERNAME} *</td>
|
|
<td colspan="2"><input name="tfUsername" type="text" id="tfUsername" tabindex="5" value="{DAT_USER}" style="width:350px;" class="inpmust" onchange="checkMust()"></td>
|
|
</tr>
|
|
<tr id="passwd" class="{CLASS_NAME_1}">
|
|
<td>{LANG_PASSWORD} *</td>
|
|
<td colspan="2"><input name="tfPassword" type="password" id="tfPassword" tabindex="6" value="{DAT_PASSWORD}" style="width:350px;" class="inpmust" onchange="checkMust()"></td>
|
|
</tr>
|
|
<tr id="keypath" class="{CLASS_NAME_2}">
|
|
<td>{LANG_SSH_KEY} *</td>
|
|
<td><input name="tfSSHKey" type="text" id="tfSSHKey" tabindex="7" value="{DAT_SSH_KEY_PATH}" style="width:350px;" class="inpmust" onchange="checkMust()"></td>
|
|
<td><img src="{IMAGE_PATH}tip.gif" alt="{LANG_HELP}" title="{LANG_HELP}" width="18" height="18" onclick="dialoginit('domain','ssh_host_key','all','Info')" class="infobutton_1"></td>
|
|
</tr>
|
|
<tr {COMMON_INVISIBLE}>
|
|
<td colspan="3"> </td>
|
|
</tr>
|
|
<tr {COMMON_INVISIBLE}>
|
|
<td colspan="3"><strong>{LANG_CONFIGURATION_DIRECTORIES}</strong></td>
|
|
</tr>
|
|
<tr {COMMON_INVISIBLE}>
|
|
<td>{LANG_BASE_DIRECTORY} *</td>
|
|
<td><input name="tfBasedir" type="text" id="tfBasedir" tabindex="8" value="{DAT_BASEDIR}" style="width:350px;" class="inpmust"></td>
|
|
<td><img src="{IMAGE_PATH}tip.gif" alt="{LANG_HELP}" title="{LANG_HELP}" width="18" height="18" onclick="dialoginit('domain','basedir','all','Info')" class="infobutton_1"></td>
|
|
</tr>
|
|
<tr {COMMON_INVISIBLE}>
|
|
<td>{LANG_HOST_DIRECTORY} *</td>
|
|
<td><input name="tfHostconfigdir" type="text" id="tfHostconfigdir" tabindex="9" value="{DAT_HOSTCONFIG}" style="width:350px;" class="inpmust"></td>
|
|
<td><img src="{IMAGE_PATH}tip.gif" alt="{LANG_HELP}" title="{LANG_HELP}" width="18" height="18" onclick="dialoginit('domain','hostdir','all','Info')" class="infobutton_1"></td>
|
|
</tr>
|
|
<tr {COMMON_INVISIBLE}>
|
|
<td>{LANG_SERVICE_DIRECTORY} *</td>
|
|
<td><input name="tfServiceconfigdir" type="text" id="tfServiceconfigdir" tabindex="10" value="{DAT_SERVICECONFIG}" style="width:350px;" class="inpmust"></td>
|
|
<td><img src="{IMAGE_PATH}tip.gif" alt="{LANG_HELP}" title="{LANG_HELP}" width="18" height="18" onclick="dialoginit('domain','servicedir','all','Info')" class="infobutton_1"></td>
|
|
</tr>
|
|
<tr {COMMON_INVISIBLE}>
|
|
<td>{LANG_BACKUP_DIRECTORY} *</td>
|
|
<td><input name="tfBackupdir" type="text" id="tfBackupdir" tabindex="11" value="{DAT_BACKUPDIR}" style="width:350px;" class="inpmust"></td>
|
|
<td><img src="{IMAGE_PATH}tip.gif" alt="{LANG_HELP}" title="{LANG_HELP}" width="18" height="18" onclick="dialoginit('domain','backupdir','all','Info')" class="infobutton_1"></td>
|
|
</tr>
|
|
<tr {COMMON_INVISIBLE}>
|
|
<td>{LANG_HOST_BACKUP_DIRECTORY} *</td>
|
|
<td><input name="tfHostbackupdir" type="text" id="tfHostbackupdir" tabindex="12" value="{DAT_HOSTBACKUP}" style="width:350px;" class="inpmust"></td>
|
|
<td><img src="{IMAGE_PATH}tip.gif" alt="{LANG_HELP}" title="{LANG_HELP}" width="18" height="18" onclick="dialoginit('domain','backuphostdir','all','Info')" class="infobutton_1"></td>
|
|
</tr>
|
|
<tr {COMMON_INVISIBLE}>
|
|
<td>{LANG_SERVICE_BACKUP_DIRECTORY} *</td>
|
|
<td><input name="tfServicebackupdir" type="text" id="tfServicebackupdir" tabindex="13" value="{DAT_SERVICEBACKUP}" style="width:350px;" class="inpmust"></td>
|
|
<td><img src="{IMAGE_PATH}tip.gif" alt="{LANG_HELP}" title="{LANG_HELP}" width="18" height="18" onclick="dialoginit('domain','backupservicedir','all','Info')" class="infobutton_1"></td>
|
|
</tr>
|
|
<tr {COMMON_INVISIBLE}>
|
|
<td>{LANG_NAGIOS_BASEDIR} *</td>
|
|
<td><input name="tfNagiosBaseDir" type="text" id="tfNagiosBaseDir" tabindex="14" value="{DAT_NAGIOSBASEDIR}" style="width:350px;" class="inpmust"></td>
|
|
<td><img src="{IMAGE_PATH}tip.gif" alt="{LANG_HELP}" title="{LANG_HELP}" width="18" height="18" onclick="dialoginit('domain','nagiosbasedir','all','Info')" class="infobutton_1"></td>
|
|
</tr>
|
|
<tr {COMMON_INVISIBLE}>
|
|
<td>{LANG_IMPORT_DIRECTORY}</td>
|
|
<td><input name="tfImportdir" type="text" id="tfImportdir" tabindex="15" value="{DAT_IMPORTDIR}" style="width:350px;"></td>
|
|
<td><img src="{IMAGE_PATH}tip.gif" alt="{LANG_HELP}" title="{LANG_HELP}" width="18" height="18" onclick="dialoginit('domain','importdir','all','Info')" class="infobutton_1"></td>
|
|
</tr>
|
|
<tr {COMMON_INVISIBLE}>
|
|
<td>{LANG_PICTURE_DIRECTORY}</td>
|
|
<td><input name="tfPicturedir" type="text" id="tfPicturedir" tabindex="16" value="{DAT_PICTUREDIR}" style="width:350px;"></td>
|
|
<td><img src="{IMAGE_PATH}tip.gif" alt="{LANG_HELP}" title="{LANG_HELP}" width="18" height="18" onclick="dialoginit('domain','picturedir','all','Info')" class="infobutton_1"></td>
|
|
</tr>
|
|
<tr {COMMON_INVISIBLE}>
|
|
<td colspan="3"> </td>
|
|
</tr>
|
|
<tr {COMMON_INVISIBLE}>
|
|
<td>{LANG_NAGIOS_COMMAND_FILE}</td>
|
|
<td><input name="tfCommandfile" type="text" id="tfCommandfile" tabindex="17" value="{DAT_COMMANDFILE}" style="width:350px;"></td>
|
|
<td><img src="{IMAGE_PATH}tip.gif" alt="{LANG_HELP}" title="{LANG_HELP}" width="18" height="18" onclick="dialoginit('domain','commandfile','all','Info')" class="infobutton_1"></td>
|
|
</tr>
|
|
<tr {COMMON_INVISIBLE}>
|
|
<td>{LANG_NAGIOS_BINARY_FILE}</td>
|
|
<td><input name="tfBinary" type="text" id="tfBinary" tabindex="18" value="{DAT_BINARYFILE}" style="width:350px;"></td>
|
|
<td><img src="{IMAGE_PATH}tip.gif" alt="{LANG_HELP}" title="{LANG_HELP}" width="18" height="18" onclick="dialoginit('domain','binary','all','Info')" class="infobutton_1"></td>
|
|
</tr>
|
|
<tr {COMMON_INVISIBLE}>
|
|
<td>{LANG_NAGIOS_PROCESS_FILE}</td>
|
|
<td><input name="tfPidfile" type="text" id="tfPidfile" tabindex="19" value="{DAT_PIDFILE}" style="width:350px;"></td>
|
|
<td><img src="{IMAGE_PATH}tip.gif" alt="{LANG_HELP}" title="{LANG_HELP}" width="18" height="18" onclick="dialoginit('domain','pidfile','all','Info')" class="infobutton_1"></td>
|
|
</tr>
|
|
<tr {COMMON_INVISIBLE}>
|
|
<td>{LANG_NAGIOS_CONFIG_FILE}</td>
|
|
<td><input name="tfConffile" type="text" id="tfConffile" tabindex="20" value="{DAT_CONFFILE}" style="width:350px;"></td>
|
|
<td><img src="{IMAGE_PATH}tip.gif" alt="{LANG_HELP}" title="{LANG_HELP}" width="18" height="18" onclick="dialoginit('domain','conffile','all','Info')" class="infobutton_1"></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3"> </td>
|
|
</tr>
|
|
<tr>
|
|
<td>{LANG_NAGIOS_VERSION}</td>
|
|
<td>
|
|
<select name="selVersion" id="selVersion" tabindex="21" class="selectborder">
|
|
<option value="1" {VER_SELECTED_1}>2.x</option>
|
|
<option value="2" {VER_SELECTED_2}>2.9</option>
|
|
<option value="3" {VER_SELECTED_3}>3.0 +</option>
|
|
</select>
|
|
</td>
|
|
<td><img src="{IMAGE_PATH}tip.gif" alt="{LANG_HELP}" title="{LANG_HELP}" width="18" height="18" onclick="dialoginit('domain','version','all','Info')" class="infobutton_1"></td>
|
|
</tr>
|
|
<tr {COMMON_INVISIBLE}>
|
|
<td>{LANG_ENABLE_COMMON_DOMAIN}</td>
|
|
<td>
|
|
<select name="selEnableCommon" id="selEnableCommon" tabindex="22" class="selectborder">
|
|
<option value="0" {ENA_COMMON_SELECTED_0}>{DISABLE}</option>
|
|
<option value="1" {ENA_COMMON_SELECTED_1}>{ENABLE}</option>
|
|
</select>
|
|
</td>
|
|
<td><img src="{IMAGE_PATH}tip.gif" alt="{LANG_HELP}" title="{LANG_HELP}" width="18" height="18" onclick="dialoginit('domain','enable_common','all','Info')" class="infobutton_1"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>{LANG_ENABLE_UTF8_DECODE}</td>
|
|
<td>
|
|
<select name="selUTF8decode" id="selUTF8decode" tabindex="22" class="selectborder">
|
|
<option value="0" {UTF8_DECODE_SELECTED_0}>{DISABLE}</option>
|
|
<option value="1" {UTF8_DECODE_SELECTED_1}>{ENABLE}</option>
|
|
</select>
|
|
</td>
|
|
<td><img src="{IMAGE_PATH}tip.gif" alt="{LANG_HELP}" title="{LANG_HELP}" width="18" height="18" onclick="dialoginit('domain','utf8_decode','all','Info')" class="infobutton_1"></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3"> </td>
|
|
</tr>
|
|
<tr {RESTRICT_GROUP_ADMIN}>
|
|
<td>{LANG_ACCESS_GROUP}</td>
|
|
<td>
|
|
<select name="selAccessGroup" tabindex="23" class="selectborder">
|
|
<!-- BEGIN acc_group -->
|
|
<option value="{DAT_ACC_GROUP_ID}" {DAT_ACC_GROUP_SEL}>{DAT_ACC_GROUP}</option>
|
|
<!-- END acc_group -->
|
|
</select>
|
|
</td>
|
|
<td><img src="{IMAGE_PATH}tip.gif" alt="{LANG_HELP}" title="{LANG_HELP}" width="18" height="18" onclick="dialoginit('common','accessgroup','all','Info')" class="infobutton_1"></td>
|
|
</tr>
|
|
<tr>
|
|
<td>{LANG_ACTIVE}</td>
|
|
<td colspan="2" ><input name="chbActive" type="checkbox" class="checkbox" id="chbActive" value="1" {ACT_CHECKED} {ACT_DISABLE}>
|
|
<input name="modus" type="hidden" id="modus" value="{MODUS}">
|
|
<input name="hidId" type="hidden" id="hidId" value="{DAT_ID}">
|
|
<input name="hidLimit" type="hidden" id="hidLimit" value="{LIMIT}"></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3"> </td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3">{LANG_ACCESSDESCRIPTION}</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3"> </td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3"><input name="subForm" type="button" id="subForm" value="{LANG_SAVE}" onClick="LockButton()" {DISABLE_SAVE}> <input name="subAbort" type="button" id="subAbort" onClick="abort()" value="{LANG_ABORT}"><span class="required_info">* {LANG_REQUIRED}</span></td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
</div>
|
|
<div id="msgcontainer"></div>
|
|
<div id="infodialog">
|
|
<div id="dialogcontent" class="bd"></div>
|
|
</div>
|
|
<script language="javascript" type="text/javascript">
|
|
<!--
|
|
checkMust();
|
|
//-->
|
|
</script>
|
|
<!-- END datainsert --> |