本文整理汇总了PHP中updatePassword函数的典型用法代码示例。如果您正苦于以下问题:PHP updatePassword函数的具体用法?PHP updatePassword怎么用?PHP updatePassword使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了updatePassword函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: nss_init_admin
function nss_init_admin()
{
global $nss;
$permissionError = testFilePermissions();
if ($nss->get('plugin_mode') != 'wordpress') {
activatePluginMode('wordpress');
}
$dynpw = NSS_WP_URL . LOGGED_IN_KEY . date('d') . AUTH_KEY;
$_SESSION['nss_admin_password'] = $dynpw;
if (!is_logged_in($nss)) {
updatePassword($dynpw, false);
}
add_menu_page('neosmart-stream-admin', 'neosmart STREAM', 'manage_options', 'neosmart-stream', 'nss_dashboard', NSS_WP_URL . '/nss-core/nss-icon-16x16.png', 100.3);
}
示例2: access
<?php
include '../../settings.php';
include '../../inc/login_functions.php';
include '../../inc/helper.php';
include 'functions.php';
$logedIn = access($mysqli);
$userData = getUserData($mysqli, $_SESSION['userId']);
$updateEmail = updateEmail($mysqli, $_SESSION['userId']);
$updateProfile = updateProfile($mysqli, $_SESSION['userId']);
$updatePassword = updatePassword($mysqli, $_SESSION['userId']);
if ($updateProfile == 1 || $updatePassword == 1 || $updateEmail == 1) {
header("Location: updateRedirect.php");
exit;
}
if ($updatePassword == 2 || $updateEmail == 2) {
header("Location: ../../404.php");
exit;
}
include "../../inc/header.php";
include "../../inc/topNavbar.php";
?>
<section id="main-container">
<?php
include "../../inc/leftNavbar.php";
?>
<!--Page main section start-->
<section id="min-wrapper">
示例3: updateInfosPerso
if ($envoi == 1) {
updateInfosPerso($_SESSION['ID'], $_POST['nom'], $_POST['prenom'], $_POST['mail'], $_POST['adresse'], $_POST['codepostal'], $_POST['ville'], $_POST['pays']);
if ($_POST['changePassword'] != '' or $_POST['changePassword2'] != '') {
$envoi2 = 1;
//vérification du password
$send[] = verificationFormulaire($_POST['changePassword'], $rgxPassword, 'Erreur dans votre mot de passe. Les modifications de profil ont été envoyés mais votre mot de passe n\'a pas été modifié !', false);
//vérif correspondance password 1 & 2
if ($_POST['changePassword'] != $_POST['changePassword2']) {
$send[] = 'Les deux nouveaux mots de passe ne correspondent pas. Les modifications de profil ont été envoyés mais votre mot de passe n\'a pas été modifié !';
}
//vérif old password
$passwordOld = sha1($_POST['changePasswordOld']);
$verifOldPwdArray = selectIDmembre($_SESSION['pseudo'], $passwordOld);
if (!$verifOldPwdArray) {
$send[] = 'Erreur dans votre ancien mot de passe. Les modifications de profil ont été envoyés mais votre mot de passe n\'a pas été modifié !';
}
foreach ($send as $element) {
if ($element != '') {
$envoi2 = 0;
break;
}
}
if ($envoi2 == 1) {
//on crypte le mot de passe si le champs a été correctement rempli
$password = sha1($_POST['changePassword']);
include_once 'modele/membre/panel_updatePassword.php';
updatePassword($_SESSION['ID'], $password);
}
}
}
include_once 'vue/membre/panelEnvoi.php';
示例4: updatePassword
<?php
require 'controller.php';
$email = $_POST['email'];
$password = $_POST['password'];
$message = updatePassword($email, $password);
echo $message;
示例5: ldap_connect
if (isset($_POST["password"])) {
$password = $_POST["password"];
}
if ($LDAP) {
$ldapuser = $username;
if ($LDAP_DOMAIN != "") {
$ldapuser = $LDAP_DOMAIN . "\\" . $username;
}
$ldap = ldap_connect($LDAP_SERVER);
if ($bind = ldap_bind($ldap, $ldapuser, $password)) {
$cost = 10;
$salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.');
$salt = sprintf("\$2a\$%02d\$", $cost) . $salt;
$hash = crypt($password, $salt);
$token = storeUsername($username, $hash);
$token = updatePassword($username, $hash);
$user = getUserRecord($username);
setcookie("user_id", $user['user_id']);
setcookie("username", $username);
setcookie("token", $token);
header("Location: index.php");
exit;
} else {
$error = "Username and password do not match.";
}
} else {
$user = getUserRecord($username);
if (crypt($password, $user['hash']) == $user['hash']) {
setcookie("user_id", $user['user_id']);
setcookie("username", $username);
setcookie("token", $user['token']);
示例6: updatePassword
$newPasswordConfirm = $_POST['NewPasswordConfirm'];
}
// On vérifie si des champs sont vides
if (empty($newPassword) || empty($newPasswordConfirm)) {
$error_fieldsempty = '- Un ou plusieurs champs de texte sont vides. Veuillez les remplir. \\n';
$i++;
}
// Si le mot de passe et sa confirmation ne correspondent pas
if ($newPassword != $newPasswordConfirm) {
$error_passwordconfirm = '- Le mot de passe et sa confirmation sont différents. \\n';
$i++;
}
// Si le mot de passe est trop petit
if (strlen($newPassword) < 6 && !empty($newPassword)) {
$error_passwordwrongsize = '- Votre mot de passe doit contenir au minimum huit caractères. \\n';
$i++;
}
// S'il n'y a aucune erreur
if ($i == 0) {
updatePassword($noUser, createHash($newPassword));
header('Location: ../view/view_update_password.php');
$_SESSION['success_update_password'] = "Mot de passe modifié avec succès";
} else {
setErrors();
header('Location: ../view/view_update_password.php');
}
function setErrors()
{
global $error_passwordconfirm, $error_fieldsempty, $error_passwordwrongsize;
$_SESSION['errors_update_password'] = 'Une ou plusieurs erreurs se sont produites : \\n\\n' . $error_passwordconfirm . $error_fieldsempty . $error_passwordwrongsize;
}
示例7: checkSession
checkSession();
$user_data = getUserData($_SESSION['gebruiker_id']);
//voor wachtwoord wijzigen
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
//checken als er gegevens ingevoerd zijn
if (isset($_POST['wijzigen'])) {
$match = password_verify($_POST["huidig"], $user_data["wachtwoord"]);
if ($match === FALSE) {
$_SESSION["message"] = "Wachtwoord onjuist";
} else {
$nieuw = $_POST["nieuw"];
$nieuwheraal = $_POST["nieuwheraal"];
if (passTest($nieuw, $nieuwheraal) === TRUE) {
$user_id = $_SESSION['gebruiker_id'];
$nieuw = password_hash($nieuw, PASSWORD_BCRYPT);
updatePassword($nieuw, $user_id);
$_SESSION['message-success'] = 'Uw wachtwoord is gewijzigd!';
}
}
}
}
$pagename = "settings";
?>
<?php
include ROOT_PATH . "includes/templates/header.php";
//als docent ingelogd is sidebar-docent anders sidebar-leerling
if (checkRole($_SESSION['gebruiker_id']) == 2) {
include ROOT_PATH . "includes/templates/sidebar-docent.php";
} else {
include ROOT_PATH . "includes/templates/sidebar-leerling.php";
示例8: switch
//}
switch ($action) {
case 'login':
login();
break;
case 'logout':
logout();
break;
case 'register':
register();
break;
case 'update':
update();
break;
case 'updatePassword':
updatePassword();
break;
case 'addImage':
addImage();
break;
case 'updateGroupImage':
updateGroupImage();
break;
case 'createGroup':
createGroup();
break;
case 'acceptGroupRequest':
acceptGroupRequest();
break;
case 'declineGroupRequest':
declineGroupRequest();
示例9: where
$stmt = $mysql->prepare("SELECT state,password,password_salt,id from users where (username = ? or email = ?)");
$stmt->bind_param('ss', $username, $username);
$stmt->execute();
$stmt->bind_result($method, $password_h, $password_salt, $uid);
$stmt->fetch();
$stmt->close();
if (isValidMd5($password_h)) {
$cv_hash = cv_hash($password);
if ($password_h == $cv_hash) {
updatePassword($uid, $password);
$login = true;
}
} elseif ($method != 3) {
$nc_hash = hashpass($password);
if ($password_h == $nc_hash) {
updatePassword($uid, $password);
$login = true;
}
} else {
$options = ['cost' => 11, 'salt' => $password_salt];
$pwd_h = password_hash($password, PASSWORD_BCRYPT, $options);
if ($password_h == $pwd_h) {
$login = true;
}
}
if ($login) {
$ip = stripslashes($_SERVER['REMOTE_ADDR']);
$login_q = $mysql->prepare("SELECT users.id as id,username,email,rank,user_titles.title as title from users left join user_titles on user_titles.id = users.rank where users.id = ?");
$login_q->bind_param('i', $uid);
$login_q->execute();
$login_q->bind_result($id, $qusername, $qemail, $qrank, $qtitle);
示例10: connect
<?php
include_once '../connection/connection.php';
include_once '../connection/dbFogetPassword.php';
if (isset($_POST['changePassword'])) {
$conn = connect();
if ($conn->connect_error) {
die("Connection failed:" . $conn->connect_error);
} else {
echo "ghfh";
updatePassword($_POST);
header('location:signin.php');
}
}
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="../css/style.css">
</head>
<body>
<div class=upperHeader> Reset Password</div>
<form method='Post' action=''>
<table>
<tr>
<td> Enter your Email address
</td>
<td>
<input type=text name=email>
</td>
</tr>
示例11: updatePassword
updatePassword($result["id"], $result["password"]);
echo json_encode(array("id" => $result["id"], "message" => "Add user successfully"));
} catch (Exception $e) {
echo $e->getMessage();
}
});
/* User Update */
$app->put('/user/:id/:jsondata', function ($id, $jsondata) use($app, $db) {
try {
$updateUserData = json_decode($jsondata, true);
$app->response()->header('Content-Type', 'application/json');
$user = $db->users()->where('id', $id);
if ($user) {
$result = $user->update($updateUserData);
if ($user->update(['password' => $user->update($updateUserData)])) {
updatePassword($id, $updateUserData["password"]);
}
echo json_encode(array("status" => (bool) $result, "message" => "User updated successfully"));
} else {
echo json_encode(array("status" => false, "message" => "User id {$id} does not exist"));
}
} catch (Exception $e) {
echo $e->getMessage();
}
});
/* User Delete */
$app->delete('/user/:id', function ($id) use($app, $db) {
try {
$app->response()->header('Content-Type', 'application/json');
$user = $db->users()->where('id', $id);
if ($user->fetch()) {
示例12:
require "lib/menu.php";
?>
<script src="js/accountVerif.js" type="text/javascript"></script>
<section class="main" id="account">
<?php
if (!isConnect()) {
echo "<h2>Vous n'êtes pas connecté</h2>\n</section>\n</body>\n</html>\n";
exit;
}
if (isset($_POST['validPassword'])) {
if (isset($errorPassword)) {
echo "<ul>\n{$errorPassword}</ul>\n";
} else {
if (updatePassword($login, $newpass)) {
echo "<h2>Changement de mot de passe réussi</h2>";
} else {
echo "<h2>Une erreur s'est produite. Veuillez recommencer, s'il vous plait !</h2>";
}
}
}
if (isset($_POST['validIdentity'])) {
if (isset($errorIdentity)) {
echo "<ul>\n{$errorIdentity}</ul>\n";
} else {
if (count($changes) == 0) {
echo "<h2>Aucune modification de l'identité</h2>";
} else {
if (updateIdentity($login, $_POST['name'], $_POST['firstname'], $changes)) {
echo "<h2>Changement d'identité réussi</h2>";
示例13: randomPassword
<?php
require "manageDB.php";
$email = $_POST['email'];
// definisco mittente e destinatario della mail
$nome_mittente = "OpenIdeas";
$mail_mittente = "";
$mail_destinatario = "{$email}";
// definisco il subject
$mail_oggetto = "Recupero password";
$newPassword = randomPassword();
updatePassword($email, $newPassword);
// definisco il messaggio formattato in HTML
$mail_corpo = <<<HTML
<html>
<head>
<title>Recupero password portale OpenIdeas</title>
</head>
<body>
La tua password è stata reimpostata a: {$newPassword}
</body>
</html>
HTML;
// aggiusto un po' le intestazioni della mail
// E' in questa sezione che deve essere definito il mittente (From)
// ed altri eventuali valori come Cc, Bcc, ReplyTo e X-Mailer
$mail_headers = "From: " . $nome_mittente . " <" . $mail_mittente . ">\r\n";
$mail_headers .= "Reply-To: " . $mail_mittente . "\r\n";
$mail_headers .= "X-Mailer: PHP/" . phpversion() . "\r\n";
// Aggiungo alle intestazioni della mail la definizione di MIME-Version,
// Content-type e charset (necessarie per i contenuti in HTML)
示例14: handleUpdatePW
function handleUpdatePW($data)
{
$uid = $data['userId'];
$prePW = $data['prePassword'];
//检查密码是否正确
$users = queryUid($uid);
$truePW = 0;
while ($row = mysql_fetch_array($users)) {
$truePW = $row['password'];
}
if (strcmp($prePW ^ key, $truePW)) {
$Response['status'] = 'failed';
$Response['message'] = '当前密码错误';
return $Response;
}
$newPW = addslashes($data['newPassword'] ^ key);
$result = updatePassword($uid, $newPW);
if (!$result) {
$Response['status'] = 'success';
$Response['message'] = '修改密码成功';
} else {
$Response['status'] = 'error';
$Response['message'] = $result;
}
return $Response;
}
示例15: getError
along with Cybermin; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2006 Namont Nicolas
include/post_moncompte.php V0.1
*/
// Fichier de post de mon compte / modification du mot de passe
if (isset($_POST["submit"])) {
$pass1 = $_POST["pass1"];
$pass2 = $_POST["pass2"];
if ($pass1 != "" and $pass2 != "") {
if ($pass1 != $pass2) {
$mess = getError(7);
} else {
$result = updatePassword($_SESSION["iduser"], $pass1);
if ($result == FALSE) {
$mess = getError(0);
} else {
$mess = getError(8);
}
}
}
///inscription a la newsletter
if (FALSE == updateNewsletter($_SESSION["iduser"], $_POST["newsletter"])) {
$mess = getError(0);
} else {
$mess = getError(8);
}
}