Fixed saving permissions

This commit is contained in:
kolaente 2017-05-07 23:13:07 +02:00 committed by konrad
parent 7d2fdcfebc
commit 5cceb2eb97
1 changed files with 6 additions and 2 deletions

View File

@ -15,13 +15,17 @@ if (hasPerm('edit_permissions'))
{
$perm_full = $perm;
$perm = explode('_', $perm);
$permArr[$perm[0]][$perm[1]][] = str_replace($perm[0].'_'.$perm[1].'_', '', $perm_full);
//echo '<pre>'.print_r($perm, true).'</pre>';
if(isset($perm[1], $perm[0]))
{
$permArr[$perm[0]][$perm[1]][] = str_replace($perm[0] . '_' . $perm[1] . '_', '', $perm_full);
}
}
}
//print_r($permArr);
foreach ($permArr as $lvl => $perms)
{
$db->setCol('system_roles');
$db->data['permissions'] = json_encode($perms);
if ($db->update(['id' => $lvl]))
{