I have extended the update, so you can set different permissions. Sadly I could not make the mechanism dynamic, so currenntly there are two "roles".
To be able to set permissions, first create into the /_files/config/ folder an other file, like config_admin.php
. You have to copy the original code from the original config.php` file into it. After you can set the permission.
After you had created the new config file, now we have to edit the index.php on several places.
after the //items
comment, you have to make an if statement, that checks which user is logged in, and than change the path of the config file. Here is my code:
if($_SESSION["user"] == "admin") {
...
['arr' => $storage_config, 'comment' => "// STORAGE CONFIG\n// " . rtrim($storage_path ?: '', '\/') . '/config/config_admin.php'],
...
} else {
...
}
after the //storage config
comment you have to make the same like in the previous step
if($_SESSION["user"] == "admin") {
...
self::$storage_config_realpath = $storage_realpath ? $storage_realpath . '/config/config_admin.php' : false;
...
} else {
...
}
after the //create storage_path
comment you have to make the same like in the previous step
if($_SESSION["user"] == "admin") {
...
self::$storage_config_realpath = $storage_realpath . '/config/config_admin.php';
...
} else {
...
}
After these changes the user, which has the username admin, will have other permissions than the other users.
Maybe not all of these changes are necessery, because the systen don't has to create the configfile for the admin it self, but with these changes it will work.