mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-04-19 20:09:14 +03:00
Small improvements
This commit is contained in:
parent
9c5b1c260e
commit
75614ef673
1 changed files with 374 additions and 357 deletions
157
index.php
157
index.php
|
@ -19,27 +19,33 @@ if (!is_logged_in() and isset($_POST['formname']) && $_POST['formname'] == "logi
|
|||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<link href="jquery-ui/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css" />
|
||||
<link href="jtable/themes/metro/lightgray/jtable.css" rel="stylesheet" type="text/css" />
|
||||
<link href="css/base.css" rel="stylesheet" type="text/css" />
|
||||
<head>
|
||||
<link href="jquery-ui/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="jtable/lib/themes/lightcolor/gray/jtable.min.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="css/base.css" rel="stylesheet" type="text/css"/>
|
||||
<script src="jquery-ui/jquery-1.10.2.js" type="text/javascript"></script>
|
||||
<script src="jquery-ui/ui/jquery.ui.core.js" type="text/javascript"></script>
|
||||
<script src="jquery-ui/ui/jquery.ui.widget.js" type="text/javascript"></script>
|
||||
<script src="jquery-ui/ui/jquery.ui.mouse.js" type="text/javascript"></script>
|
||||
<script src="jquery-ui/ui/jquery.ui.draggable.js" type="text/javascript"></script>
|
||||
<script src="jquery-ui/ui/jquery.ui.position.js" type="text/javascript"></script>
|
||||
<script src="jquery-ui/ui/jquery.ui.button.js" type="text/javascript"></script>
|
||||
<script src="jquery-ui/ui/jquery.ui.resizable.js" type="text/javascript"></script>
|
||||
<script src="jquery-ui/ui/jquery.ui.dialog.js" type="text/javascript"></script>
|
||||
<script src="jtable/jquery.jtable.min.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<script src="jtable/lib/jquery.jtable.min.js" type="text/javascript"></script>
|
||||
</head>
|
||||
|
||||
<?
|
||||
if (!is_logged_in()) {
|
||||
?>
|
||||
?>
|
||||
<body onload="document.getElementById('username').focus()">
|
||||
<div class="loginblock">
|
||||
<div class="logo">
|
||||
<img src="https://www.tuxis.nl/uploads/images/nsedit.png" alt="Logo" />
|
||||
<img src="https://www.tuxis.nl/uploads/images/nsedit.png" alt="Logo"/>
|
||||
</div>
|
||||
<div class="login">
|
||||
<? if (isset($errormsg)) {
|
||||
echo '<span style="color: red">'.$errormsg.'</span><br />';
|
||||
echo '<span style="color: red">' . $errormsg . '</span><br />';
|
||||
}
|
||||
?>
|
||||
<form action="index.php" method="post">
|
||||
|
@ -60,17 +66,17 @@ if (!is_logged_in()) {
|
|||
<input type="hidden" name="formname" value="loginform"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?
|
||||
exit(0);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (is_adminuser()) {
|
||||
foreach (get_all_users() as $user) {
|
||||
$userlist[] = "'".$user['emailaddress']."':'".$user['emailaddress']."'";
|
||||
$userlist[] = "'" . $user['emailaddress'] . "':'" . $user['emailaddress'] . "'";
|
||||
}
|
||||
|
||||
$ulist = ',';
|
||||
|
@ -79,18 +85,20 @@ if (is_adminuser()) {
|
|||
|
||||
foreach ($templates as $template) {
|
||||
if (is_adminuser() or (isset($template['owner']) && $template['owner'] == get_sess_user()) or ($template['owner'] == 'public')) {
|
||||
$templatelist[] = "'".$template['name']."':'".$template['name']."'";
|
||||
$templatelist[] = "'" . $template['name'] . "':'" . $template['name'] . "'";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($templatelist)) {
|
||||
$tmpllist = ',';
|
||||
$tmpllist .= join(',', $templatelist);
|
||||
} else {
|
||||
$tmpllist = '';
|
||||
}
|
||||
|
||||
?>
|
||||
<body>
|
||||
<div id="wrap">
|
||||
<body>
|
||||
<div id="wrap">
|
||||
<div id="menu" class="jtable-main-container">
|
||||
<div class="jtable-title">
|
||||
<div class="jtable-title-text">
|
||||
|
@ -114,9 +122,9 @@ if (isset($templatelist)) {
|
|||
<div class="tables" id="Users"></div>
|
||||
</div>
|
||||
<? } ?>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
<? if (is_adminuser()) { ?>
|
||||
$('#Users').hide();
|
||||
$('#useradmin').click(function () {
|
||||
|
@ -141,7 +149,7 @@ if (isset($templatelist)) {
|
|||
updateAction: 'users.php?action=update'
|
||||
},
|
||||
messages: {
|
||||
addNewRecord: 'Add new user',
|
||||
addNewRecord: 'Add new user'
|
||||
},
|
||||
fields: {
|
||||
id: {
|
||||
|
@ -149,17 +157,17 @@ if (isset($templatelist)) {
|
|||
type: 'hidden'
|
||||
},
|
||||
emailaddress: {
|
||||
title: 'User',
|
||||
title: 'User'
|
||||
},
|
||||
password: {
|
||||
title: 'Password',
|
||||
type: 'password',
|
||||
list: false,
|
||||
list: false
|
||||
},
|
||||
isadmin: {
|
||||
title: 'Admin',
|
||||
type: 'checkbox',
|
||||
values: { '0' : 'No', '1' : 'Yes' }
|
||||
values: {'0': 'No', '1': 'Yes'}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -172,7 +180,7 @@ if (isset($templatelist)) {
|
|||
sorting: false,
|
||||
messages: {
|
||||
addNewRecord: 'Add new slave zone',
|
||||
noDataAvailable: 'No slave zones configured',
|
||||
noDataAvailable: 'No slave zones configured'
|
||||
},
|
||||
openChildAsAccordion: true,
|
||||
actions: {
|
||||
|
@ -186,13 +194,13 @@ if (isset($templatelist)) {
|
|||
type: 'hidden'
|
||||
},
|
||||
name: {
|
||||
title: 'Domain',
|
||||
title: 'Domain'
|
||||
},
|
||||
<? if (is_adminuser()) { ?>
|
||||
owner: {
|
||||
title: 'Owner',
|
||||
options: {'admin':'admin'<? echo $ulist; ?>},
|
||||
defaultValue: 'admin',
|
||||
options: {'admin': 'admin'<? echo $ulist; ?>},
|
||||
defaultValue: 'admin'
|
||||
},
|
||||
<? } ?>
|
||||
kind: {
|
||||
|
@ -203,7 +211,7 @@ if (isset($templatelist)) {
|
|||
},
|
||||
serial: {
|
||||
title: 'Serial',
|
||||
create: false,
|
||||
create: false
|
||||
},
|
||||
records: {
|
||||
width: '5%',
|
||||
|
@ -212,19 +220,19 @@ if (isset($templatelist)) {
|
|||
pageSize: 20,
|
||||
edit: false,
|
||||
create: false,
|
||||
display: function(zone) {
|
||||
display: function (zone) {
|
||||
var $img = $('<img class="list" src="jtable/themes/metro/list.png" title="Records" />');
|
||||
$img.click(function() {
|
||||
$img.click(function () {
|
||||
$('#MasterZones').jtable('openChildTable',
|
||||
$img.closest('tr'), {
|
||||
title: 'Records in '+zone.record.name,
|
||||
title: 'Records in ' + zone.record.name,
|
||||
openChildAsAccordion: true,
|
||||
actions: {
|
||||
listAction: 'zones.php?action=listrecords&zoneurl='+zone.record.url,
|
||||
listAction: 'zones.php?action=listrecords&zoneurl=' + zone.record.url
|
||||
},
|
||||
fields: {
|
||||
name: {
|
||||
title: 'Label',
|
||||
title: 'Label'
|
||||
},
|
||||
type: {
|
||||
title: 'Type'
|
||||
|
@ -233,11 +241,11 @@ if (isset($templatelist)) {
|
|||
title: 'Prio'
|
||||
},
|
||||
content: {
|
||||
title: 'Content',
|
||||
title: 'Content'
|
||||
},
|
||||
ttl: {
|
||||
title: 'TTL',
|
||||
},
|
||||
title: 'TTL'
|
||||
}
|
||||
}
|
||||
}, function (data) {
|
||||
data.childTable.jtable('load');
|
||||
|
@ -245,7 +253,7 @@ if (isset($templatelist)) {
|
|||
});
|
||||
return $img;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#SlaveZones').jtable('load');
|
||||
|
@ -255,7 +263,7 @@ if (isset($templatelist)) {
|
|||
pageSize: 20,
|
||||
messages: {
|
||||
addNewRecord: 'Add new zone',
|
||||
noDataAvailable: 'No zones configured',
|
||||
noDataAvailable: 'No zones configured'
|
||||
},
|
||||
sorting: false,
|
||||
openChildAsAccordion: true,
|
||||
|
@ -273,110 +281,119 @@ if (isset($templatelist)) {
|
|||
type: 'hidden'
|
||||
},
|
||||
name: {
|
||||
title: 'Domain',
|
||||
title: 'Domain'
|
||||
},
|
||||
<? if (is_adminuser()) { ?>
|
||||
owner: {
|
||||
title: 'Owner',
|
||||
options: {'admin':'admin'<? echo $ulist; ?>},
|
||||
defaultValue: 'admin',
|
||||
options: {'admin': 'admin'<? echo $ulist; ?>},
|
||||
defaultValue: 'admin'
|
||||
},
|
||||
<? } ?>
|
||||
kind: {
|
||||
title: 'Type',
|
||||
options: { 'Native':'Native', 'Master':'Master'},
|
||||
options: {'Native': 'Native', 'Master': 'Master'},
|
||||
defaultValue: '<? echo $defaults['defaulttype']; ?>',
|
||||
edit: false,
|
||||
edit: false
|
||||
},
|
||||
template: {
|
||||
title: 'Template',
|
||||
options: {'None':'None'<? echo $tmpllist; ?>},
|
||||
options: {'None': 'None'<? echo $tmpllist; ?>},
|
||||
list: false,
|
||||
create: true,
|
||||
edit: false,
|
||||
edit: false
|
||||
},
|
||||
nameserver1: {
|
||||
title: 'Pri. Nameserver',
|
||||
create: true,
|
||||
list: false,
|
||||
edit: false,
|
||||
defaultValue: '<? echo $defaults['primaryns']; ?>',
|
||||
defaultValue: '<? echo $defaults['primaryns']; ?>'
|
||||
},
|
||||
nameserver2: {
|
||||
title: 'Sec. Nameserver',
|
||||
create: true,
|
||||
list: false,
|
||||
edit: false,
|
||||
defaultValue: '<? echo $defaults['secondaryns']; ?>',
|
||||
defaultValue: '<? echo $defaults['secondaryns']; ?>'
|
||||
},
|
||||
serial: {
|
||||
title: 'Serial',
|
||||
create: false,
|
||||
edit: false,
|
||||
edit: false
|
||||
},
|
||||
records: {
|
||||
width: '5%',
|
||||
title: 'Records',
|
||||
edit: false,
|
||||
create: false,
|
||||
display: function(zone) {
|
||||
display: function (zone) {
|
||||
var $img = $('<img class="list" src="jtable/themes/metro/list.png" title="Records" />');
|
||||
$img.click(function() {
|
||||
$img.click(function () {
|
||||
$('#MasterZones').jtable('openChildTable',
|
||||
$img.closest('tr'), {
|
||||
title: 'Records in '+zone.record.name,
|
||||
title: 'Records in ' + zone.record.name,
|
||||
messages: {
|
||||
addNewRecord: 'Add to '+zone.record.name,
|
||||
noDataAvailable: 'No records for '+zone.record.name,
|
||||
addNewRecord: 'Add to ' + zone.record.name,
|
||||
noDataAvailable: 'No records for ' + zone.record.name
|
||||
},
|
||||
paging: true,
|
||||
pageSize: 20,
|
||||
openChildAsAccordion: true,
|
||||
actions: {
|
||||
listAction: 'zones.php?action=listrecords&zoneurl='+zone.record.url,
|
||||
createAction: 'zones.php?action=createrecord&zoneurl='+zone.record.url,
|
||||
deleteAction: 'zones.php?action=deleterecord&zoneurl='+zone.record.url,
|
||||
updateAction: 'zones.php?action=editrecord&zoneurl='+zone.record.url,
|
||||
listAction: 'zones.php?action=listrecords&zoneurl=' + zone.record.url,
|
||||
createAction: 'zones.php?action=createrecord&zoneurl=' + zone.record.url,
|
||||
deleteAction: 'zones.php?action=deleterecord&zoneurl=' + zone.record.url,
|
||||
updateAction: 'zones.php?action=editrecord&zoneurl=' + zone.record.url
|
||||
},
|
||||
fields: {
|
||||
domid: {
|
||||
create: true,
|
||||
type: 'hidden',
|
||||
defaultValue: zone.record.id,
|
||||
defaultValue: zone.record.id
|
||||
},
|
||||
id: {
|
||||
key: true,
|
||||
create: false,
|
||||
edit: false,
|
||||
list: false,
|
||||
list: false
|
||||
},
|
||||
domain: {
|
||||
create: true,
|
||||
type: 'hidden',
|
||||
defaultValue: zone.record.name,
|
||||
defaultValue: zone.record.name
|
||||
},
|
||||
name: {
|
||||
title: 'Label',
|
||||
create: true,
|
||||
create: true
|
||||
},
|
||||
type: {
|
||||
options: {'AAAA':'AAAA','A':'A','CNAME':'CNAME','MX':'MX','SRV':'SRV','TXT':'TXT','NS':'NS','SOA':'SOA'},
|
||||
create: true,
|
||||
options: {
|
||||
'AAAA': 'AAAA',
|
||||
'A': 'A',
|
||||
'CNAME': 'CNAME',
|
||||
'MX': 'MX',
|
||||
'SRV': 'SRV',
|
||||
'TXT': 'TXT',
|
||||
'NS': 'NS',
|
||||
'SOA': 'SOA'
|
||||
},
|
||||
create: true
|
||||
},
|
||||
priority: {
|
||||
title: 'Prio',
|
||||
create: true,
|
||||
defaultValue: '<? echo $defaults['priority']; ?>',
|
||||
defaultValue: '<? echo $defaults['priority']; ?>'
|
||||
},
|
||||
content: {
|
||||
title: 'Content',
|
||||
create: true,
|
||||
create: true
|
||||
},
|
||||
ttl: {
|
||||
title: 'TTL',
|
||||
create: true,
|
||||
defaultValue: '<? echo $defaults['ttl']; ?>',
|
||||
},
|
||||
defaultValue: '<? echo $defaults['ttl']; ?>'
|
||||
}
|
||||
}
|
||||
}, function (data) {
|
||||
data.childTable.jtable('load');
|
||||
|
@ -384,12 +401,12 @@ if (isset($templatelist)) {
|
|||
});
|
||||
return $img;
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#MasterZones').jtable('load');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue