require_once 'class.customs.php'; // HNAuthLib if (!defined('HNAUTH_DIR')) { define('HNAUTH_DIR', './HNAuthLib/'); } require_once HNAUTH_DIR . 'HNAuth.php'; $errorMsg = ''; if (!is_user_logged_in()) { header('Location: login.php'); } else { $session = new Session(); $loggedInUser = $session->getItem('username'); $loggedInLevel = $session->getItem('userlevel'); } if (isset($_POST['submit'])) { if (change_email($_POST['username'], $_POST['current_password'], $_POST['new_email'])) { header('Location: change_email_success.php'); } else { $errorMsg = '<div class="alert alert-danger alert-dismissable">'; $errorMsg .= '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>'; $errorMsg .= $responseMsg['hnauth']; $errorMsg .= '</div>'; } } ?> <!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!-->
<?php /* * Account/My_Profile.php * LHS Math Club Website * * Allows users to view and change their stored personal information */ require_once '../.lib/functions.php'; restrict_access('RLA'); set_login_data($_SESSION['user_id']); // visiting this page will cause your cached data to reload if (isset($_POST['do_change_email'])) { change_email(); } else { if (isset($_POST['do_change_cell'])) { change_cell(); } else { if (isset($_POST['do_change_password'])) { change_password(); } else { if (isset($_GET['Email'])) { show_change_email_page('', 'email'); } else { if (isset($_GET['Cell'])) { show_change_cell_page('', 'cell'); } else { if (isset($_GET['Password'])) { show_change_password_page(''); } else { if (isset($_GET['Mailings'])) {
echo ' <script>alert("当前密码错误!")</script> '; echo " <script>window.location='profile_update.php';</script> "; } else { //更新密码 if (!empty($_POST['password'])) { if (change_pwd($uid, $pwd)) { echo ' <script>alert("修改成功!")</script> '; echo " <script>window.location='profile_update.php';</script> "; } else { echo ' <script>alert("出错了!")</script> '; echo " <script>window.location='profile_update.php';</script> "; } } //更新邮箱 if (!empty($_POST['email'])) { if (change_email($uid, $email)) { echo ' <script>alert("修改成功!")</script> '; echo " <script>window.location='profile_update.php';</script> "; } else { echo ' <script>alert("出错了!")</script> '; echo " <script>window.location='profile_update.php';</script> "; } } } } ?> <!-- Right side column. Contains the navbar and content of the page --> <aside class="right-side"> <!-- Content Header (Page header) --> <section class="content-header"> <h1>
include_once "includes/connection.php"; include_once "includes/functions.php"; session_start(); //store_visitor_data(); $error_mes = ""; if (isset($_POST["userName"]) && isset($_POST["passWord"])) { $result_from_login = user_login($_POST["userName"], $_POST["passWord"]); if ($result_from_login === 1) { $_page = "events"; } else { $error_mes = "Login error"; } } if (isset($_POST["email"]) && isset($_POST["passWord"]) && isset($_POST["reminder"])) { $result_from_login = change_email($_POST["email"], $_POST["passWord"], $_POST["reminder"]); if ($result_from_login === 1) { //echo "my_courses"; } else { header("location:http:index.php?page=my_courses"); //echo "Error"; } } if (isset($_POST["start_time"]) && isset($_POST["end_time"]) && isset($_POST["event_description"]) && isset($_POST["event_name"]) && isset($_POST["event_location"]) && isset($_POST["event_id"]) == false) { $add_new_event = add_new_event($_POST["start_time"], $_POST["end_time"], $_POST["event_description"], $_POST["event_name"], $_POST["event_location"]); if ($add_new_event === 1) { } else { $_SESSION['last_view'] = $_POST["start_time"]; header("location:http:index.php?page=events"); } }
</td> <td> <input type="submit" name='password_change' value="Update Information"/> </td> </tr> </table> </form> <br><br><br> <br><br><br> <br><br><br> <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { # If the email field is set as not blank, # change the user's email to the input if (!empty($_POST['new_email'])) { $result = change_email($dbc, $_SESSION['username'], $_POST['current_pass'], $_POST['new_email']); echo $result . '<br>'; } # If the new/confirm password fields are not blank, # change the password if (!(empty($_POST['new_pass']) || empty($_POST['confirm_pass']))) { $result = change_password($dbc, $_SESSION['username'], $_POST['current_pass'], $_POST['new_pass'], $_POST['confirm_pass']); echo $result . '<br>'; } } ?> <br><br><br> <br><br><br> <a href='/admin/home.php'>Back</a> </div> </body>