mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-04-20 20:13:40 +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
|
User support
|
||||||
============
|
============
|
||||||
Multiple users are supported. A user can be an admin or a normal user. You can
|
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
|
WeFact Login support
|
||||||
====================
|
====================
|
||||||
|
|
|
@ -85,7 +85,7 @@ function set_permissions($userid,$groupid,$zone,$permissions) {
|
||||||
writelog("Added '$permissionmap[$permissions]' permissions for $who from zone $zone.");
|
writelog("Added '$permissionmap[$permissions]' permissions for $who from zone $zone.");
|
||||||
return $db->lastInsertRowID();
|
return $db->lastInsertRowID();
|
||||||
} else {
|
} else {
|
||||||
writelog("Failed to add permissions to zone $zone ($zoneid) for $who.");
|
writelog("Failed to add permissions to zone $zone for $who.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -209,7 +209,6 @@ function permissions($zone,$userid) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$perm=user_permissions($zone,$userid);
|
$perm=user_permissions($zone,$userid);
|
||||||
|
|
||||||
if(!is_null($perm)) {
|
if(!is_null($perm)) {
|
||||||
return $perm;
|
return $perm;
|
||||||
} else {
|
} else {
|
||||||
|
|
71
index.php
71
index.php
|
@ -469,6 +469,75 @@ $(document).ready(function () {
|
||||||
return $img;
|
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: {
|
exportzone: {
|
||||||
title: '',
|
title: '',
|
||||||
width: '1%',
|
width: '1%',
|
||||||
|
@ -817,7 +886,7 @@ $(document).ready(function () {
|
||||||
display: function(data) {
|
display: function(data) {
|
||||||
var $img = $('<img class="list" src="img/list.png" title="Permissions" />');
|
var $img = $('<img class="list" src="img/list.png" title="Permissions" />');
|
||||||
$img.click(function () {
|
$img.click(function () {
|
||||||
$('#SlaveZones').jtable('openChildTable',
|
$('#MasterZones').jtable('openChildTable',
|
||||||
$img.closest('tr'), {
|
$img.closest('tr'), {
|
||||||
title: 'Permissions for ' + data.record.name,
|
title: 'Permissions for ' + data.record.name,
|
||||||
openChildAsAccordion: true,
|
openChildAsAccordion: true,
|
||||||
|
|
Loading…
Add table
Reference in a new issue