コード例 #1
0
ファイル: index.php プロジェクト: hughnguy/php
        header('Location:views/login.php?status=fail');
        die;
    }
} else {
    if ($_GET['page'] === 'validate_or_reset') {
        if (isset($_GET['lang']) && \Ventus\Utilities\I18n\Translate::isAllowedLanguage($_GET['lang'])) {
            $l10n->setLanguage($_GET['lang']);
            $SESSION->lang = $l10n->getLanguage();
        }
        $id = $pro->verifyConfirmationLink($_GET['cid']);
        $loggers['audit']->info("Attempted verification of user account (confirmation ID: {$_GET['cid']})");
        $l10n->addResource(__DIR__ . '/l10n/confirm-request.json');
        require_once 'views/confirm-request.php';
    } else {
        if ($_GET['page'] === 'activate-user') {
            $success = $pro->activateUserAccount($_POST);
            if ($success === 1) {
                $loggers['audit']->info("User activated (username: {$_POST['user_name']})");
                echo 'success';
            } else {
                $loggers['audit']->notice("Failed to activate user (username: {$_POST['user_name']})");
                echo 'failure';
            }
        } else {
            if ($_GET['page'] === 'reset_pass') {
                if (isset($_POST['new'])) {
                    header('Content-Type: text/plain');
                    echo $pro->updatePassword($_POST['username'], $_POST['new']);
                    $loggers['audit']->info("Password reset completed for user {$_POST['username']}");
                    exit;
                }