mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-06-07 00:47:00 +03:00
Rewrite/Refactoring
- add a lot of permission checks: zone edits were completely unchecked (after login); only list and creation were protected. - reduce regular expression usage - don't use user provided names/ids/urls for requests; instead use them to search for the zone in the list of all zones. - rename 'label' to 'name' in template records ('name' is used in all other places) - make 'localhost' default $apisid - add 'soa_edit' default - remove gen_pw/pwgen caller; use openssl instead for random password - fix a lot of bugs (editrecord, TXT quoting, name checking, ...) - improve record sorting
This commit is contained in:
parent
169983da70
commit
54fb62b471
5 changed files with 625 additions and 312 deletions
20
index.php
20
index.php
|
@ -76,19 +76,6 @@ if (!is_logged_in()) {
|
|||
exit(0);
|
||||
}
|
||||
|
||||
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'] . "'";
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($templatelist)) {
|
||||
$tmpllist = ',';
|
||||
$tmpllist .= join(',', $templatelist);
|
||||
} else {
|
||||
$tmpllist = '';
|
||||
}
|
||||
|
||||
?>
|
||||
<body>
|
||||
<div id="wrap">
|
||||
|
@ -157,7 +144,10 @@ $(document).ready(function () {
|
|||
listAction: 'zones.php?action=listslaves',
|
||||
<? if (is_adminuser() or $allowzoneadd === TRUE) { ?>
|
||||
createAction: 'zones.php?action=create',
|
||||
deleteAction: 'zones.php?action=delete'
|
||||
deleteAction: 'zones.php?action=delete',
|
||||
<? } ?>
|
||||
<? if (is_adminuser()) { ?>
|
||||
updateAction: 'zones.php?action=update'
|
||||
<? } ?>
|
||||
},
|
||||
fields: {
|
||||
|
@ -323,7 +313,7 @@ $(document).ready(function () {
|
|||
},
|
||||
template: {
|
||||
title: 'Template',
|
||||
options: {'None': 'None'<? echo $tmpllist; ?>},
|
||||
options: <? echo json_encode(user_template_names()); ?>,
|
||||
list: false,
|
||||
create: true,
|
||||
edit: false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue