本文整理汇总了PHP中updatePassword函数的典型用法代码示例。如果您正苦于以下问题:PHP updatePassword函数的具体用法?PHP updatePassword怎么用?PHP updatePassword使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了updatePassword函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:dipeshpatel306,项目名称:effective-adventure,代码行数:14,代码来源:plugin-wordpress.php
示例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">
开发者ID:vladvoth,项目名称:splitter,代码行数:31,代码来源:updateUserData.php
示例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';
开发者ID:Rbeuque74,项目名称:boutiqueMvc,代码行数:31,代码来源:panelEnvoi.php
示例4: updatePassword
<?php
require 'controller.php';
$email = $_POST['email'];
$password = $_POST['password'];
$message = updatePassword($email, $password);
echo $message;
开发者ID:uxreactor,项目名称:Library-Management-System,代码行数:7,代码来源:update-password.php
示例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']);
开发者ID:nxglabs,项目名称:odm-web,代码行数:31,代码来源:login.php
示例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;
}
开发者ID:Waverealm,项目名称:Projet_Plan-Cadre,代码行数:31,代码来源:controller_update_password.php
示例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";
开发者ID:BernardMussche,项目名称:examenanalyse,代码行数:31,代码来源:settings.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();
开发者ID:naval777,项目名称:Websites,代码行数:31,代码来源:main.php
示例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);
开发者ID:Northcodeno,项目名称:api.northcode.no,代码行数:31,代码来源:login.php
示例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>
开发者ID:pawans-optimus,项目名称:php_induction,代码行数:31,代码来源:resetPassword.php
示例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()) {
开发者ID:petrospe,项目名称:restful11,代码行数:31,代码来源:index.php
示例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>";
开发者ID:AymericDu,项目名称:PicOne,代码行数:31,代码来源:myaccount.php
示例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)
开发者ID:AmedeoLeo,项目名称:OpenIdeas,代码行数:31,代码来源:restorePassword.php
示例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;
}
开发者ID:shmilycode,项目名称:weiqi,代码行数:26,代码来源:index.php
示例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);
}
}
开发者ID:ctariel,项目名称:CyberGestionnaireLGB,代码行数:31,代码来源:post_moncompte.php
示例16: updatePassword
$user_group = $rowOp->user_group;
$type_log = 'CONNEXION';
if (version_compare(PHP_VERSION, '5.3.7') >= 0) {
require_once 'require/function_users.php';
updatePassword($login, $mdp);
}
} else {
$login_successful = $l->g(180);
$type_log = 'BAD CONNEXION';
}
} else {
$reqOp = "SELECT id,user_group,passwd FROM operators WHERE id='%s'";
$arg_reqOp = array($login);
$resOp = mysql2_query_secure($reqOp, $_SESSION['OCS']["readServer"], $arg_reqOp);
$rowOp = mysqli_fetch_object($resOp);
if (isset($rowOp->id) && password_verify($mdp, $rowOp->passwd)) {
if ($oldpassword) {
require_once 'require/function_users.php';
updatePassword($login, $mdp);
}
$login_successful = "OK";
$user_group = $rowOp->user_group;
$type_log = 'CONNEXION';
} else {
$login_successful = $l->g(180);
$type_log = 'BAD CONNEXION';
}
}
$value_log = 'USER:' . $login;
$cnx_origine = "LOCAL";
addLog($type_log, $value_log);
开发者ID:remicollet,项目名称:OCSInventory-ocsreports,代码行数:31,代码来源:local.php
示例17: resetSubmit
function resetSubmit()
{
if (!empty($_POST['passwordOne']) && !empty($_POST['passwordTwo']) && isset($_POST['submit'])) {
if ($_POST['passwordOne'] == $_POST['passwordTwo']) {
//Check passwords match.
updatePassword();
}
} else {
echo '<p class="server-message">Your Passwords did not match, please try again from the link...</p>';
}
}
开发者ID:Choc-Orange,项目名称:BLT-Application,代码行数:11,代码来源:functions.php
示例18: updatePassword
function updatePassword($username, $password)
{
global $dbConn;
$sql = "UPDATE users SET password = :password WHERE username = :username";
$stmt = $dbConn->prepare($sql);
$stmt->execute(array(":password" => $password, ":username" => $username));
return $stmt;
}
if (isset($_POST['newPassword']) && isset($_POST['confirmPassword'])) {
$newPassword = $_POST['newPassword'];
$confirmPassword = $_POST['confirmPassword'];
if (strlen($newPassword) == 0) {
print "<center><br><br>Invalid password, <a href='javascript:history.back()'>try again</a><center>";
} else {
if ($newPassword == $confirmPassword) {
updatePassword($_SESSION['user'], $newPassword);
print "<center><br><br>Password was updated, click <a href='http://www.skafia.com/cst336/assignments/4/index.php'>here</a> to continue</center>";
} else {
print "<center><br><br>Passwords do not match, <a href='javascript:history.back()'>try again</a><center>";
}
}
}
} else {
if (isset($_POST['cancelButton'])) {
header("Location: http://www.skafia.com/cst336/assignments/4/index.php");
}
}
if (!isset($_POST['newPassword'])) {
print "\n\t<body>\n\t<center>\n\t<form action=\"updatepassword.php\" method=\"post\">\n\t\t<table>\n\t\t\t<tr><td colspan=2 align=center><h3>Update Password<h3></td></tr>\n\t\t\t<tr><td colspan=2 align=center> </td></tr>\n\t\t\t<tr><td>New Password:</td><td><input type=\"password\" name=\"newPassword\"></td></tr>\n\t\t\t<tr><td>Confirm:</td><td><input type=\"password\" name=\"confirmPassword\"></td></tr>\n\t\t\t<tr><td align=center colspan=2><input type=\"submit\" name=submitButton><input type=\"submit\" \n\t\t\tvalue=\"Cancel\" name=cancelButton></td></tr>\n\t\t</table>\n\t</form>\n\t</body>\n\t</center>";
}
?>
开发者ID:k-vader,项目名称:CST336_assignment5,代码行数:31,代码来源:updatepassword.php
示例19: header
}
if (!isset($_SESSION['account_activated']) and !isset($pass)) {
$_SESSION['message'] = 'Toegang geweigerd.';
header('Location: ' . BASE_URL);
exit;
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$pass = $_POST['pass'];
$pass_confirm = $_POST['pass_confirm'];
if (passTest($pass, $pass_confirm) === TRUE) {
if (isset($_SESSION['gebruiker_id'])) {
$user_id = $_SESSION['gebruiker_id'];
}
$password = password_hash($pass, PASSWORD_BCRYPT);
//wachtwoord invoeren in de database en activate_account op 1 zetten ( dus geactiveerd )
updatePassword($password, $user_id);
unset($_SESSION['account_activated']);
if (isset($user_id, $email_code)) {
//nieuwe email code aanmaken en opslaan.
$email_code = md5($user_id + microtime());
update_email_code($user_id, $email_code);
$_SESSION['message-success'] = 'Uw wachtwoord is gewijzigd!';
header('Location: ' . BASE_URL);
exit;
} else {
header('Location: ' . BASE_URL . 'dashboard/');
exit;
}
}
}
?>
开发者ID:vincentrood,项目名称:KBS-examenanalyse,代码行数:31,代码来源:index.php
示例20: stripslashes
<?php
$formMessage = '';
$formStatus = "info";
if (isset($_POST['submit']) && 'changePassword' == $_POST['action']) {
if (empty($_POST['newPassword']) || empty($_POST['confirmPassword'])) {
$formMessage = "Password cannot be empty!";
$formStatus = "danger";
} else {
$newPassword = $_POST['newPassword'];
$confirmPassword = $_POST['confirmPassword'];
$newPassword = stripslashes($newPassword);
$confirmPassword = stripslashes($confirmPassword);
if ($newPassword == $confirmPassword) {
if (updatePassword($loggedInUser, $newPassword)) {
$formMessage = "Password has been changed.";
$formStatus = "success";
} else {
$formMessage = "Unable to change the password.";
$formStatus = "danger";
}
} else {
$formMessage = "Passwords are not equal.";
$formStatus = "danger";
}
}
}
?>
<form action="" method="post" role="form">
开发者ID:appsofluna,项目名称:appsofluna-simpleapps,代码行数:28,代码来源:change-password.php
注:本文中的updatePassword函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论