} // Validate the email. is_valid_email($_POST['email'], $err); // Validate the session length. is_valid_slength($_POST['slength'], $err); } if (sizeof($err)) { $title = 'Error'; $messages = $err; draw_page('details_error.php'); } else { if (!$FORUM) { if ($_POST['pwd1'] && $_POST['pwd2']) { update_password(addslashes($_POST['pwd1']), $sid); } update_email(addslashes($_POST['email']), $sid); update_slength(addslashes($_POST['slength']), $sid); } update_dm($_POST['dm'], $sid); $title = 'Profile Updated'; draw_page('details.php'); } //////////////////////////////////////////////////////////////////////// // Supporting functions. // Updates the db with the user's new password. function update_password($pwd, &$sid) { global $TABLE_USERS, $rpgDB; $_r = $rpgDB->query(sprintf("UPDATE %s SET pwd = PASSWORD('%s') WHERE pname = '%s' LIMIT 1", $TABLE_USERS, addslashes($pwd), addslashes($sid->GetUserName()))); if (!$_r) { __printFatalErr("Failed to update database.", __LINE__, __FILE__);
$savemsg = sprintf(gettext("Email sent to %s"), $config['system']['smartmonemail']); smartmonctl("stop"); smartmonctl("start"); } else { $config['system']['smartmonemail'] = $_POST['smartmonemail']; write_config(); // Don't know what all this means, but it addes the config changed header when config is saved $retval = 0; if (stristr($retval, "error") != true) { $savemsg = get_std_save_message(); } else { $savemsg = $retval; } if ($_POST['email']) { // Write the changes to the smartd.conf file update_email($_POST['smartmonemail']); } // Send sig HUP to smartd, rereads the config file shell_exec("/usr/bin/killall -HUP smartd"); } } // Was the config changed? if so , print the message if (isset($savemsg)) { print_info_box($savemsg); } // Get users email from the xml file $pconfig['smartmonemail'] = $config['system']['smartmonemail']; ?> <!-- Print the tabs across the top --> <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="tabs"> <tr>
<?php include "../model/userdb.php"; if ($_POST['method'] == "insert") { insert_user(); } if ($_POST['method'] == "login") { get_user_by_username_password(); } if ($_POST['method'] == "reset") { update_name(); changePass(); update_add(); update_phone(); update_email(); }
<?php if (isset($_POST['cpasswordce'])) { $current_password = $_POST['cpasswordce']; } if (isset($_POST['newemail'])) { $new_email = $_POST['newemail']; } if ($current_password === getuserfield_settings('password', $user_id)) { if (update_email($user_id, $new_email)) { $msg = "Your email changed successfully."; header("Location: student_homepage.php?pid=6st16yz9&settings_msg={$msg}"); } else { $msg = "Sorry, Your email could not be changed."; header("Location: student_homepage.php?pid=6st16yz9&settings_msg={$msg}"); } } else { $msg = "Your current password is invalid."; header("Location: student_homepage.php?pid=6st16yz9&settings_msg={$settings_msg}"); }
$newEmail = $emailPswd = ""; $newEmail = test_input($_POST["newEmail"]); $emailPswd = test_input($_POST["emailPswd"]); $emailPswd = md5($emailPswd); if (empty($newEmail) || empty($emailPswd)) { $action['result'] = 'error'; array_push($updateErr, "Aizpildiet visus epasta maiņas laukus"); } else { if (!filter_var($newEmail, FILTER_VALIDATE_EMAIL)) { $action['result'] = 'error'; array_push($updateErr, "Nederīgs epasts"); } if (email_exists($newEmail, $conn)) { $action['result'] = 'error'; array_push($updateErr, "Epasts ir aizņemts"); } if ($emailPswd != fetch_value('password', 'users', 'username', $_SESSION['user_username'], $conn)) { $action['result'] = 'error'; array_push($updateErr, "Nepareiza parole"); } } if ($action['result'] != 'error') { $update_email = update_email($newEmail, $_SESSION['user_id'], $conn); if ($update_email) { $_SESSION['user_email'] = $newEmail; exit; } else { array_push($updateErr, "Neizdevās atjaunināt epastu"); } } output_errors($updateErr);
<?php require_once "../../class/user.class.php"; require_once "../../class/database.class.php"; session_start(); $db = new database(); $link = $db->connect(); require_once "functionsAdmin.php"; if ($_POST) { $newMail = trim(strip_tags($_POST['nEmail'])); $previousMail = trim(strip_tags($_POST['pEmail'])); if (filter_var($newMail, FILTER_VALIDATE_EMAIL)) { echo "1"; return update_email($newMail, $previousMail, $link); } else { return 0; } } else { header('Location : login.php'); }
<br><br> Indtast den nye email adresse, hvis du ønsker at ændre den:<br> <form class="pure-form pure-form-stacked" method="POST" action="<?php echo $_SERVER["PHP_SELF"]; ?> "> <div> <label for="newemail"></label> <input id ="newemail" type="string" name="newemail"/><br> <input class="btn left" name="email" type="submit" value="Godkend"> </div> </form> <?php if (isset($_REQUEST['newemail'])) { update_email($mysqli, $_REQUEST['newemail']); echo '<META HTTP-EQUIV="Refresh" Content="0; URL=administrator.php">'; } ?> <br><br><br> <?php user_table($mysqli); ?> <br><br> Vælg et id på den du ønsker, at lave til super admin.<br> Dette medføre, at du ikke kan tilgå administrator siden mere.<br> (Der kan kun være en super administrator på en gang)<br> <form>