<?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>
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">