本文整理汇总了PHP中change_password函数的典型用法代码示例。如果您正苦于以下问题:PHP change_password函数的具体用法?PHP change_password怎么用?PHP change_password使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了change_password函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: recover
function recover($mode, $email)
{
$mode = sanitize($mode);
$email = sanitize($email);
$user_data = user_data(user_id_from_email($email), 'first_name', 'username');
if ($mode == 'username') {
email($email, 'Your username recvory', "Hello" . $user_data['first_name'] . ",\n\nYour username is:" . $user_data['username'] . "\n\n-stumbleupon");
} else {
if ($mode == 'password') {
$generated_password = substr(md5(rand(999, 999999)), 0, 8);
change_password($user_data['user_id'], $generated_password);
update_user($user_data['user_data'], array('password_recover' => '1'));
email($email, 'Your password recvory', "Hello" . $user_data['first_name'] . ",\n\nYour New Password is:" . $generated_password . "\n\n-StumbleUpon");
}
}
}
示例2: recover
function recover($mode, $email)
{
$mode = sanitize($mode);
$email = sanitize($email);
$user_data = user_data(user_id_from_email($email), 'user_id', 'first_name', 'username');
if ($mode == 'username') {
email($email, 'Your username', "Hello " . $user_data['first_name'] . ", \n \n Your username is: " . $user_data['username'] . ",\n\n -dwcl");
} else {
if ($mode == 'password') {
//password
$generated_password = substr(md5(rand(999, 999999)), 0, 8);
change_password($user_data['user_id'], $generated_password);
email($email, 'Your Password', "Hello " . $user_data['first_name'] . ", \n \n Your new is: " . $generated_password . ",\n\n -dwcl");
}
}
}
示例3: recover
function recover($mode, $email)
{
$user_data = user_data(user_id_from_email($email), 'user_id', 'first_name', 'username');
if ($mode == 'username') {
// recover username
email($email, 'Your username', "Hello " . $user_data['first_name'] . ",\n\nYour username is: " . $user_data['username'] . "\n\n-sparklet");
} else {
if ($mode == 'password') {
// recover password
$generated_password = substr(md5(rand(999, 999999)), 0, 8);
// die($generated_password);
change_password($user_data['user_id'], $generated_password);
update_user($user_data['user_id'], array('password_recover' => '1'));
email($email, 'Your password recovery', "Hello " . $user_data['first_name'] . ",\n\nYour new password is: " . $generated_password . "\n\n-sparklet");
}
}
}
示例4: recover
function recover($mode, $email)
{
$mode = sanitize($mode);
$email = sanitize($email);
$user_data = user_data(user_id_from_email($email), 'user_id', 'first_name');
if ($mode == 'username') {
email($email, 'Your username', " Hello " . $userdata['first_name'] . ",\n\nYour username is : " . $user_data['username'] . "\n\n-Utkal Placement");
} else {
if ($mode == 'password') {
$temp_password = substr(md5(rand(9999, 999999)), 0, 8);
change_password($user_data['user_id'], $temp_password);
update_user($user_data['user_id'], array('password_recover' => '1'));
email($email, 'Your password Recovery', " Hello " . $userdata['first_name'] . ",\n\nYour new password is : " . $temp_password . "\n\nPlease log in to change this.\n\n-Utkal Placement");
}
}
//$temp_pass= md5($temp_pass);
//mysql_query("UPDATE `users` SET `pass_temp` = '$temp_pass' WHERE `email` = '$email'");
}
示例5: recover
function recover($mode, $email)
{
// recupereaza numele de utilizator sau parola - $mode poate lua valoarea de 'username' sau 'password'
include 'core/db/db_connection.php';
$mode = sanitize($mode);
$email = sanitize($email);
$user_data = user_data(get_user_id_from_email($email), 'user_id', 'first_name', 'username');
if ($mode == 'username') {
email($email, 'Your username', "\n\t\t\t\tHello " . $user_data['first_name'] . ", <br><br>\n\t\t\t\tYour username is " . $user_data['username'] . " <br><br>\n\t\t\t\t-worldtour team\n\t\t\t");
} else {
if ($mode == 'password') {
$generated_password = substr(md5(rand(777, 7777)), 0, 7);
// generam o parola random de 7 caractere pe care o criptam cu md5
change_password($user_data['user_id'], $generated_password);
update_user($user_data['user_id'], array('pwd_recovery' => '1'));
// folosim un 'flag' asupra contului pentru a forta utilizatorul sa-si schimbe parola generata de noi prima oara cand se logheaza
email($email, 'Password recovery', "\n\t\t\t\tHello " . $user_data['first_name'] . ", <br><br>\n\t\t\t\tYour new password is " . $generated_password . "<br><br>\n\t\t\t\tKindly note that this is a temporary password and you are required to change it on your first log in. <br><br>\n\t\t\t\t-worldtour team\n\t\t\t");
}
}
}
示例6: recover
function recover($mode, $email)
{
$mode = sanitize($mode);
$email = sanitize($email);
$user_id = user_id_from_email($email);
$user_data = user_data($user_id, 'user_id', 'first_name', 'username');
if ($mode === 'username') {
//recover username
sendMail("{$email}", "MCA-website username recovery mail", "Hello " . $user_data['first_name'] . ", \n\n Your username for mca page is " . $user_data['username'] . "\n\n~MCA, IIT Bombay");
} else {
if ($mode === 'password') {
//recover password
$generated_password = substr(md5(rand(999, 999999)), 0, 8);
change_password($user_data['user_id'], $generated_password);
//changing password with new genrated password
//this is to force user to change password after resetting password
mysql_query("UPDATE `users` SET `password_recover` = 1 WHERE `user_id` = {$user_id}");
sendMail("{$email}", "MCA-website password reset mail", "Hello " . $user_data['first_name'] . ", \n\n Your password for mca page is reset and the new password is " . $generated_password . ". Please change your password after logging in.\n\n~MCA, IIT Bombay");
}
}
}
示例7: CPanelPages
function CPanelPages($page)
{
//clean page
$page = htmlspecialchars($page);
//do different things on different pages
switch ($page) {
case "email":
//updates Email
return panel_email();
break;
case "profile":
//Updates Profile
return panel_profile();
break;
case "password":
//Changes Password
return change_password();
break;
default:
return cpanel_home();
break;
}
}
示例8: do_change_security
function do_change_security($currentuser)
{
global $HTTP_POST_VARS;
if ($HTTP_POST_VARS['field_password2'] != $HTTP_POST_VARS['field_password']) {
return false;
}
if ($HTTP_POST_VARS['field_password2'] == "") {
return true;
}
change_password($currentuser, $HTTP_POST_VARS['field_password']);
return true;
}
示例9: mysqli_real_escape_string
// Check for a new password and match against the confirmed password:
if ($_POST['pass1'] == $_POST['pass2']) {
require MYSQL;
$p = mysqli_real_escape_string($dbc, $_POST['pass1']);
//mysqli real escape string requires a db connection
require CLSMYSQL;
} else {
$pass_msg .= '<p class="error">Your password did not match the confirmed password!</p>';
}
} else {
$pass_msg .= '<p class="error">Please enter a valid password!</p>';
}
if ($p) {
// If everything's OK
$user_id = $_SESSION['user_id'];
$success =& change_password($p, $user_id);
if ($success == 1) {
$pass_msg .= '<h3>Your password has been changed.</h3>';
$pass_msg .= '<a href="logout.php" class="change_password_btn" ><button type="button" class="btn btn-primary">Re-Login</button></a>';
} else {
// If it did not run OK
$pass_msg .= '<p class="error">Your password was not changed. Make sure your new password is different than the current password. Contact the system administrator if you think an error occurred.</p>';
}
} else {
// Failed the validation test
$pass_msg .= '<p class="error">Please try again.</p>';
}
}
// End of the main Submit conditional
require 'include/sm_form_header.html';
include 'view/form_change_password.html';
示例10: sec_session_start
<?php
include_once 'db_connect_PDO.php';
include_once 'functions2.php';
sec_session_start();
$db = db_connect();
//print_r($_POST);
//print_r($_SESSION);
//If user is changing their password while logged in, execute this
$shopper_id = $_SESSION['user_id'];
if ($_POST['pType'] == "change") {
if (isset($_POST['oPass'], $_POST['nPass'], $_POST['conf'], $_SESSION['user_id'])) {
change_password($shopper_id);
}
}
//if user is changing their password from reset link, execute this
if ($_POST['pType'] == "forgot") {
if (isset($_POST['nPass'], $_POST['conf'], $_POST['user_id'])) {
forgot_password();
//ask user to log in with new password
echo "Password changed. You can now <a href='../index.php'>log in</a>";
}
}
示例11: header
<?php
include "modules.php";
if (!isset($_COOKIE['uid'])) {
header('Location: index');
}
$uid = $_COOKIE['uid'];
if (isset($_POST['passwordSettingButton'])) {
session_start();
if (change_password($_COOKIE["uid"], $_POST['opwd'], $_POST['npwd'])) {
# code...
header('Location: home');
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Password Setting</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet"
href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script
src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="js/product.js"></script>
<link rel="stylesheet" href="css/home.css" type="text/css">
示例12: exit
include "../include/db.php";
include "../include/authenticate.php";
if (checkperm("p")) {
exit("Not allowed.");
}
include "../include/general.php";
hook("preuserpreferencesform");
if (getval("save", "") != "") {
if (md5("RS" . $username . getvalescaped("currentpassword", "")) != $userpassword) {
$error3 = $lang["wrongpassword"];
} else {
if (getval("password", "") != getval("password2", "")) {
$error2 = true;
} else {
$message = change_password(getvalescaped("password", ""));
if ($message === true) {
redirect($baseurl_short . "pages/" . ($use_theme_as_home ? 'themes.php' : $default_home_page));
} else {
$error = true;
}
}
}
}
include "../include/header.php";
?>
<div class="BasicsBox">
<?php
if ($userpassword == "b58d18f375f68d13587ce8a520a87919") {
?>
<div class="FormError" style="margin:0;"><?php
示例13: log_in
log_in();
break;
case "logout":
log_out();
break;
case "create_account":
create_account();
break;
case "confirm_subscribe":
validate_account();
break;
case "change_pass":
change_password(false);
break;
case "lost_ids":
change_password(true);
break;
case "delete_account":
if (isset($_SESSION["delete_account_state"]) && $_SESSION["delete_account_state"] == "display") {
$_SESSION["delete_account_state"] = "execute";
// Une fois réaffiché, on repasse en mode "exécution"
if (isset($_SESSION["delete_account_display"])) {
echo $_SESSION["delete_account_display"];
// Affichage;
unset($_SESSION["delete_account_display"]);
// On supprime le texte qui a été affiché
}
}
break;
case "display_useterms":
display_userterms();
示例14: elseif
} elseif ($use_mysqli == true) {
$rsCheckPass = @$dbase_conn->query($query_rsCheckPass) or die;
$row_rsCheckPass = mysqli_fetch_assoc($rsCheckPass);
$totalRows_rsCheckPass = mysqli_num_rows($rsCheckPass);
}
// does posted password match current password
if ($currentpass != $row_rsCheckPass[PASS_FLD]) {
$error = "Your current password was entered incorrectly.";
}
// if there are no users, or more than one, then return an error
if ($totalRows_rsCheckPass != 1) {
$error = "Your current password was entered incorrectly.";
}
}
if (empty($error)) {
$loginmessage = change_password($_SESSION['user_id'], $newpass);
} else {
$loginmessage = $error;
}
}
// text variables
$pass_title = "Change Password Service";
$pass_intro = "\n\t\t\t<p>Please complete this form to change your password. Once your password has been changed successfully you will need to log in again.</p>\n\t\t\t<p><strong>NOTE: Your new password must be between 6 - 10 characters.</strong></p>";
$pass_form = "\n\t\t\t<form name=\"changepass\" method=\"post\" action=\"" . $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING'] . "\">\n\t\t\t\t<p><label for=\"currentpass\">Current Password:</label><br/>\n\t\t\t\t\t<input name=\"currentpass\" type=\"password\" id=\"currentpass\" class=\"loginpass\"></p>\n\t\t\t\t<p><label for=\"newpass\">New Password:</label><br/>\n\t\t\t\t\t<input name=\"newpass\" id=\"newpass\" type=\"password\" class=\"loginpass\"></p>\n\t\t\t\t<p><label for=\"newpass2\">Re-enter New Password:</label><br/>\n\t\t\t\t\t<input name=\"newpass2\" type=\"password\" id=\"newpass2\" class=\"loginpass\"></p>\n\t\t\t\t<p><input type=\"submit\" class=\"button\" name=\"change\" value=\"Change\"></p>\n\t\t\t\t</form>\n\t\t\t";
break;
default:
echo "not allowed";
break;
}
// show html page framework
echo html_header($pass_title);
示例15: change_password
?>
<b><a href="<?php
echo $user_data['username'];
?>
" >Profile</b></a><br><br>
<?php
echo 'Your password Successfully Chnaged';
} else {
if (isset($_GET['force']) && empty($_GET['force'])) {
?>
<p> You must change your password </p>
<?php
}
if (empty($_POST) === false && empty($errors) === true) {
change_password($s_id, $_POST['password']);
header('Location: changepassword.php?success');
} else {
if (empty($errors) === false) {
echo output_errors($errors);
}
}
?>
<form action="" method="POST">
<ul>
<li>
Current Password*:<br>
<input type="password" name="current_password">
</li>
<li>
New Password*:<br>