#100 - create change user roles script
This commit is contained in:
parent
dbecda87bd
commit
e19d57648c
3 changed files with 28 additions and 32 deletions
28
public/assets/php/change-user-roles.php
Normal file
28
public/assets/php/change-user-roles.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
$directory = __DIR__ . '/../../site/accounts';
|
||||
|
||||
foreach (glob($directory . '/*/index.php') as $filePath) {
|
||||
$data = include $filePath;
|
||||
|
||||
if (is_array($data) && array_key_exists('role', $data)) {
|
||||
switch ($data["role"]) {
|
||||
case "client":
|
||||
$newRoleValue = "0_client";
|
||||
break;
|
||||
|
||||
case "pochet":
|
||||
$newRoleValue = "1_pochet";
|
||||
break;
|
||||
}
|
||||
|
||||
$exportedData = "<?php\n\nreturn " . var_export($data, true) . ";\n";
|
||||
|
||||
file_put_contents($filePath, $exportedData);
|
||||
echo "Fichier modifié : $filePath\n";
|
||||
} else {
|
||||
echo "Fichier ignoré ou format inattendu : $filePath\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo "Modification terminée.\n";
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
title: Client
|
||||
description: Ne peut pas accéder au Panel, peut accéder aux Projets auxquels il est assigné côté front.
|
||||
permissions:
|
||||
access:
|
||||
panel: false
|
||||
|
||||
fields:
|
||||
projects:
|
||||
label: Projets
|
||||
type: pages
|
||||
query: page('projects').children
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
title: Interne Pochet
|
||||
description: Peux accéder au Panel mais pas aux Utilisateurs, peut accéder aux Projets auxquels il est assigné par un Admin.
|
||||
home: /panel/pages/projects
|
||||
permissions:
|
||||
access:
|
||||
users: false
|
||||
|
||||
fields:
|
||||
job:
|
||||
label: Métier
|
||||
type: select
|
||||
options:
|
||||
- Project Manager
|
||||
- Sales Manager
|
||||
default: Project Panager
|
||||
width: 1/4
|
||||
projects:
|
||||
label: Projets
|
||||
type: pages
|
||||
query: page('projects').children
|
||||
width: 3/4
|
||||
Loading…
Add table
Add a link
Reference in a new issue