当前位置: 首页>>代码示例>>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;未经允许,请勿转载。