revert user role change

This commit is contained in:
isUnknown 2025-01-20 15:07:44 +01:00
parent 3f8c185ee0
commit 8a2b90c8c0
4 changed files with 33 additions and 39 deletions

View file

@ -1,38 +0,0 @@
<?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;
case NULL:
$newRoleValue = "admin";
break;
}
if (isset($newRoleValue)) {
$data['role'] = $newRoleValue;
$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";
}
} else {
echo "Fichier ignoré ou format inattendu : $filePath\n";
}
}
echo "Modification terminée.\n";