Exemple #1
0
    if (!empty($SESSION->department)) {
        $appointment_types = \Ventus\Utilities\Functions::listAppointmentTypes($SESSION->department);
    }
    $l10n->addResource(__DIR__ . '/l10n/profile.json');
    $l10n->localizeArray($appointment_types, 'label');
    $l10n->localizeArray($all_modules, 'name');
    $l10n->localizeArray($all_modules, 'description');
    $l10n->localizeArray($all_modules, 'service_name');
    $l10n->localizeArray($modules, 'name');
    $l10n->localizeArray($distinctModules, 'name');
    $l10n->localizeArray($all_emps, 'service_name');
    $l10n->localizeArray($all_depts, 'service_name');
    $l10n->localizeArray($emp[0], 'service_name');
    $viewFile = 'views/profile.php';
} elseif ($_GET['page'] === 'update-signature') {
    $pro->updateSignature($SESSION->user_id, $_POST['signature']);
    $loggers['audit']->info("Signature updated");
} elseif ($_GET['page'] === 'update-permissions') {
    if ($_POST['update_type'] === 'add') {
        $pro->addUserModule($_POST['user_name'], $_POST['module_id']);
        $loggers['audit']->info("Permission granted to user {$_POST['user_name']} for module {$_POST['module_id']}");
    } elseif ($_POST['update_type'] === 'revoke') {
        $pro->revokeUserModule($_POST['user_name'], $_POST['module_id']);
        $loggers['audit']->info("Permission revoked for user {$_POST['user_name']} for module {$_POST['module_id']}");
    }
} elseif ($_GET['page'] === 'edit-user') {
    $pro->editUser($_POST);
    $loggers['audit']->info("Edited user {$_POST['user_id']}");
} elseif ($_GET['page'] === 'add-user') {
    $user_added = $pro->addUser($_POST);
    if ($user_added === 0) {