當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserProfile::resetUserPassword方法代碼示例

本文整理匯總了PHP中UserProfile::resetUserPassword方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserProfile::resetUserPassword方法的具體用法?PHP UserProfile::resetUserPassword怎麽用?PHP UserProfile::resetUserPassword使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UserProfile的用法示例。


在下文中一共展示了UserProfile::resetUserPassword方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: attempt

        $loggers['audit']->notice("Failed login attempt (username: {$_POST['email']})");
        header('location:index.php?status=fail');
        exit;
    }
} elseif ($_GET['page'] === "forgot-password") {
    //The user has chosen to reset their password- show them the form
    $l10n->addResource(__DIR__ . '/l10n/forgot-password.json');
    require_once FS_PHP . '/header-external.php';
    require_once 'views/forgot-password.php';
    require_once FS_PHP . '/footer-external.php';
} else {
    if ($_GET['page'] === "reset-user-password") {
        //Handle the logic for checking if the user is eligible to reset their password
        if ($faculty_profile->checkIfUserExists($_POST['email'])) {
            if ($_POST['password'] === $_POST['password_confirm']) {
                $faculty_profile->resetUserPassword($_POST);
                $loggers['audit']->info("Password reset initiated for user {$_POST['email']}");
                $activation_status = "waiting";
                $l10n->addResource(__DIR__ . '/l10n/forgot-password-result.json');
                require_once FS_PHP . '/header-external.php';
                require_once 'views/forgot-password-result.php';
                require_once FS_PHP . '/footer-external.php';
            } else {
                $loggers['audit']->notice("Failed password reset attempt - password mismatch");
                if (filter_var($_POST['email'] . EMAIL_ORG_STAFF_DOMAIN, FILTER_VALIDATE_EMAIL)) {
                    header('Location: index.php?page=forgot-password&mode=password_mismatch&email=' . $_POST['email']);
                    exit;
                }
                header('Location: index.php');
                exit;
            }
開發者ID:hughnguy,項目名稱:php,代碼行數:31,代碼來源:index.php


注:本文中的UserProfile::resetUserPassword方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。