mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-07-25 19:54:09 +03:00
Allow copying of permissions when cloning a zone.
This commit is contained in:
parent
19a8e2c223
commit
e1df632852
3 changed files with 28 additions and 0 deletions
|
@ -90,6 +90,22 @@ function set_permissions($userid,$groupid,$zone,$permissions) {
|
|||
}
|
||||
}
|
||||
|
||||
// Interface function - Copy permissions from one zone to another - used for cloning, so assumes no existing permissions on the domain
|
||||
|
||||
function copy_permissions($srczone,$dstzone) {
|
||||
$db = get_db();
|
||||
|
||||
$q = $db->prepare('SELECT p.user,p."group",p.permissions FROM permissions p, zones z WHERE p.zone=z.id AND z.zone=?');
|
||||
$q->bindValue(1, $srczone, SQLITE3_TEXT);
|
||||
$result = $q->execute();
|
||||
|
||||
while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
|
||||
set_permissions($row['user'],$row['group'],$dstzone,$row['permissions']);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// Interface function - Update permissions for a zone
|
||||
function update_permissions($id,$permissions) {
|
||||
global $permissionmap;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue