mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-04-19 20:09:14 +03:00
Uncommitted changes - mostly permissions dor admin user.
This commit is contained in:
parent
880908ff70
commit
dcae922075
3 changed files with 72 additions and 4 deletions
|
@ -19,7 +19,7 @@ Features
|
|||
User support
|
||||
============
|
||||
Multiple users are supported. A user can be an admin or a normal user. You can
|
||||
configure wheter or not a normal user is allowed to add new zones.
|
||||
configure whether or not a normal user is allowed to add new zones.
|
||||
|
||||
WeFact Login support
|
||||
====================
|
||||
|
|
|
@ -85,7 +85,7 @@ function set_permissions($userid,$groupid,$zone,$permissions) {
|
|||
writelog("Added '$permissionmap[$permissions]' permissions for $who from zone $zone.");
|
||||
return $db->lastInsertRowID();
|
||||
} else {
|
||||
writelog("Failed to add permissions to zone $zone ($zoneid) for $who.");
|
||||
writelog("Failed to add permissions to zone $zone for $who.");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -209,7 +209,6 @@ function permissions($zone,$userid) {
|
|||
}
|
||||
|
||||
$perm=user_permissions($zone,$userid);
|
||||
|
||||
if(!is_null($perm)) {
|
||||
return $perm;
|
||||
} else {
|
||||
|
|
71
index.php
71
index.php
|
@ -469,6 +469,75 @@ $(document).ready(function () {
|
|||
return $img;
|
||||
}
|
||||
},
|
||||
<?php if (is_adminuser()) { ?>
|
||||
permissions: {
|
||||
title: 'Permissions',
|
||||
width: '10%',
|
||||
create: false,
|
||||
edit: false,
|
||||
display: function(data) {
|
||||
var $img = $('<img class="list" src="img/list.png" title="Permissions" />');
|
||||
$img.click(function () {
|
||||
$('#SlaveZones').jtable('openChildTable',
|
||||
$img.closest('tr'), {
|
||||
title: 'Permissions for ' + data.record.name,
|
||||
openChildAsAccordion: true,
|
||||
actions: {
|
||||
listAction: 'permissions.php?action=list&zoneid=' + data.record.id,
|
||||
createAction: 'permissions.php?action=add&zoneid=' + data.record.id,
|
||||
updateAction: 'permissions.php?action=update&zoneid=' + data.record.id,
|
||||
deleteAction: 'permissions.php?action=remove&zoneid=' + data.record.id
|
||||
},
|
||||
fields: {
|
||||
id: {
|
||||
key: true,
|
||||
type: 'hidden'
|
||||
},
|
||||
type: {
|
||||
title: 'Type',
|
||||
inputClass: "permissionstype",
|
||||
options: {
|
||||
'user': 'User',
|
||||
'group': 'Group'
|
||||
},
|
||||
create: true,
|
||||
edit: false
|
||||
},
|
||||
value: {
|
||||
title: 'Name',
|
||||
inputClass: "usergrouplist",
|
||||
display: displayContent('value'),
|
||||
create: true,
|
||||
edit: false
|
||||
},
|
||||
permissions: {
|
||||
title: 'Permissions',
|
||||
options: {
|
||||
'0' : 'No permissions',
|
||||
'1' : 'View Only',
|
||||
'15' : 'Admin'
|
||||
}
|
||||
}
|
||||
},
|
||||
formCreated: function(event, dat) {
|
||||
$( ".usergrouplist" ).autocomplete({
|
||||
source: "permissions.php?action=autocomplete&type=" + $( ".permissionstype" ).val()
|
||||
});
|
||||
$( ".permissionstype" ).change(function() {
|
||||
$( ".usergrouplist" ).val("");
|
||||
$( ".usergrouplist" ).autocomplete({
|
||||
source: "permissions.php?action=autocomplete&type=" + $( ".permissionstype" ).val()
|
||||
});
|
||||
});
|
||||
}
|
||||
}, function (data) {
|
||||
data.childTable.jtable('load');
|
||||
})
|
||||
});
|
||||
return $img;
|
||||
}
|
||||
},
|
||||
<?php } ?>
|
||||
exportzone: {
|
||||
title: '',
|
||||
width: '1%',
|
||||
|
@ -817,7 +886,7 @@ $(document).ready(function () {
|
|||
display: function(data) {
|
||||
var $img = $('<img class="list" src="img/list.png" title="Permissions" />');
|
||||
$img.click(function () {
|
||||
$('#SlaveZones').jtable('openChildTable',
|
||||
$('#MasterZones').jtable('openChildTable',
|
||||
$img.closest('tr'), {
|
||||
title: 'Permissions for ' + data.record.name,
|
||||
openChildAsAccordion: true,
|
||||
|
|
Loading…
Add table
Reference in a new issue