本文整理汇总了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>
示例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">