コード例 #1
0
ファイル: dashboard.php プロジェクト: hughnguy/php
    $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) {
        echo $user_added;
        exit;
    }
    $loggers['audit']->info("Created user {$_POST['user_name']}");
    if (isset($_POST['modules'])) {
        foreach ($_POST['modules'] as $m) {
            $pro->addUserModule($_POST['user_name'], $m);
            $loggers['audit']->info("Permission granted to user {$_POST['user_name']} for module {$m}");
        }
    }
    $pro->generatePasswordResetLink($_POST['user_name']);