当前位置: 首页>>代码示例>>PHP>>正文


PHP account::changeEmail方法代码示例

本文整理汇总了PHP中account::changeEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP account::changeEmail方法的具体用法?PHP account::changeEmail怎么用?PHP account::changeEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在account的用法示例。


在下文中一共展示了account::changeEmail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Copyright

<?php

/*
            _____           ____
           |   __|_____ _ _|    \ ___ _ _ ___
           |   __|     | | |  |  | -_| | |_ -|
           |_____|_|_|_|___|____/|___|\_/|___|
    Copyright (C) 2013 EmuDevs <http://www.emudevs.com/>
*/
account::isNotLoggedIn();
if (isset($_POST['save'])) {
    account::changeEmail($_POST['email'], $_POST['current_pass']);
}
?>
<div class='box_two_title'>Change Email</div>
<form action="?p=settings" method="post">
<table width="70%">
       <tr>
           <td>Email adress:</td> 
           <td><input type="text" name="email" value="<?php 
echo account::getEmail($_SESSION['cw_user']);
?>
"></td>
       </tr>
       <tr>
           <td></td> 
           <td><hr/></td>
       </tr>
       <tr>
           <td>Enter your current password:</td> 
           <td><input type="password" name="current_pass"></td>
开发者ID:Kheros,项目名称:CraftedWeb,代码行数:31,代码来源:settings.php

示例2:

        if ($_POST['password1'] == $_POST['password2']) {
            $notMatching = FALSE;
        }
        // Check that the supplied current password matches that which is stored.
        $authenticated = $account->authenticate($_SESSION['login'], $_POST['password'], FALSE, FALSE);
        // If everything associated with passwords is validated change the password.
        if (!$tooShort && !$notMatching && $authenticated) {
            // Change the password stored in administrators.xml related to this users login.
            $account->changePassword($_SESSION['login'], password_hash($_POST['password1'], PASSWORD_DEFAULT));
            $passwordChanged = TRUE;
        }
    }
    // If validation passed make the requested changes to the administrator account data.
    if ($nameSupplied && $validEmail) {
        $account->changeName($_SESSION['login'], $_POST['name']);
        $account->changeEmail($_SESSION['login'], $_POST['email']);
        $updated = TRUE;
    }
    // Since the password has changed we will log the user out to clear older session variables.
    if ($passwordChanged) {
        $account->logout();
    }
}
require_once 'includes/header.inc.php';
/////////////////////
// BEGIN HTML BODY //
// Display the updated message if settings were updated.
if ($updated) {
    ?>
        <div id="settings-saved" class="alert alert-success fade in" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
开发者ID:pinkfroot,项目名称:adsb-feeder,代码行数:31,代码来源:account.php


注:本文中的account::changeEmail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。