本文整理汇总了PHP中resetPassword函数的典型用法代码示例。如果您正苦于以下问题:PHP resetPassword函数的具体用法?PHP resetPassword怎么用?PHP resetPassword使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了resetPassword函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: adminResetPasswordByUsername
function adminResetPasswordByUsername($username, $adminUid)
{
$row = get_row_null(sprintf("SELECT * FROM user_info WHERE username='%s';", mysql_real_escape_string($username)));
if (!$row) {
return FALSE;
}
resetPassword($row, $adminUid);
return TRUE;
}
示例2: addUser
function addUser($user)
{
if (is_array($user)) {
$db = Database::obtain();
if ($user['id'] == NULL) {
if ($user['group'] == '2') {
$group = 'User';
$user['maxwebsites'] = 1;
} elseif ($user['group'] == '3') {
$group = 'Developer';
$user['maxwebsites'] = 25;
}
$user['joined'] = "NOW()";
$user['account_active'] = 0;
$userid = $db->insert("users", $user);
newWebsite($userid);
$newpass = resetPassword($userid);
$subject = 'Your account details for ' . szName();
$message = '
Thank you for registering on ' . szName() . '
Below are the details for your user account on ' . szUrl() . '
Please keep this information in a save place.
User ID: U53R' . $userid . '
Username: ' . $user['username'] . '
Password: ' . $newpass . '
Full Names: ' . $user['fullnames'] . '
Account Type: ' . $group . '
Phone Number: ' . $user['phone'] . '
Website: ' . $user['user_website'] . '
Email Address: ' . $user['email'] . '
Thank you for signing up with us. While we try to automate almost everything on our servers it does not mean that we do not care about our clients. By automating the functions online we are able to provide our clients with faster response times. If you feel the need to contact us directly please do not hesitate to do so. We are always happy to hear from our clients. Compliments motivate us and complaints improves our service whilst suggestions make what we do better every day.
' . szName() . ' is a new product created from scratch; should you find any problems or have suggestions, we would be glad to hear from you. Our first priority is to fix any errors as they get reported. We upload new templates weekly and you can watch the total number of templates increase in the ' . szName() . ' Stats box on the home page of the ' . szName() . ' website. If you have a theme that you would like included, please let us know and we will add it to the collection. We are also planning a lot of new and exciting features in the near future and we will update the news pages as we make changes, fix errors and add additional functions.
For billing and invoice related queries please email us directly at ' . szEmail() . '. Any other support questions should be directed to the Support Forums. For the best experience please use Firefox. It is a free web browser and can be downloaded online from http://www.mozilla.org/en-US/firefox/new/
By default Developers can only create 25 websites. This is only implemented to prevent abuse. If you are registered as a Developer and need 50 or 100 extra websites just contact us and we will be happy to set this number to whatever you need it to be. We look forward to doing business with you for many years to come.
Kind Regards
The ' . szName() . ' Team
';
$headers = 'From: ' . szEmail() . "\r\n" . 'Bcc: ' . szCronEmail() . "\r\n";
if (sendEmail($user['email'], $subject, $message, $headers)) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return false;
}
}
示例3: array
<?php
require "../API/loginUser.php";
require "../API/registerUser.php";
$response = array("login" => "fail", "user" => array("id" => "-1", "username" => null, "email" => null));
$file = $_SERVER['DOCUMENT_ROOT'] . '/concept/bower_components/bootstrap/mobile/logfile.txt';
$postdata = file_get_contents("php://input");
$data = json_decode($postdata);
if (!empty($data)) {
switch ($data->method) {
case "login":
$json = loginUser($data->username, $data->password);
$loginObj = json_decode($json);
$response['login'] = $loginObj->{'status'};
$response['user'] = $loginObj->{'user'};
break;
case "register":
$retVal = registerUser($data->username, $data->email, $data->password);
$response['register'] = $retVal;
break;
case "resetPassword":
$retVal = resetPassword($data->username, $data->email);
$response['reset'] = $retVal;
break;
default:
$retVal = "Error";
$response['user'] = $retVal;
break;
}
}
echo json_encode($response);
示例4: lang_get
$userID = tlUser::doesUserExist($db, $args->login);
if (!$userID) {
$gui->note = lang_get('bad_user');
} else {
// need to know if auth method for user allows reset
$user = new tlUser(intval($userID));
$user->readFromDB($db);
if (tlUser::isPasswordMgtExternal($user->authentication, $user->authentication)) {
$gui->external_password_mgmt = 1;
$gui->password_mgmt_feedback = sprintf(lang_get('password_mgmt_feedback'), trim($args->login));
}
}
}
if (!$gui->external_password_mgmt && $userID) {
echo __LINE__;
$result = resetPassword($db, $userID);
$gui->note = $result['msg'];
if ($result['status'] >= tl::OK) {
$user = new tlUser($userID);
if ($user->readFromDB($db) >= tl::OK) {
logAuditEvent(TLS("audit_pwd_reset_requested", $user->login), "PWD_RESET", $userID, "users");
}
redirect(TL_BASE_HREF . "login.php?note=lost");
exit;
} else {
if ($result['status'] == tlUser::E_EMAILLENGTH) {
$gui->note = lang_get('mail_empty_address');
} else {
if ($note != "") {
$gui->note = getUserErrorMessage($result['status']);
}
示例5: crypt
<title>
</title>
</head>
<body>
<?php
/**
* Created by PhpStorm.
* User: Adriana
* Date: 10/11/2015
* Time: 14:04
*/
$email = $_POST["user"];
$numero = crypt($email, '."#$%&/()');
include "../Model/resetPassword.php";
resetPassword($email, $numero);
require "../PHPMailer-master/PHPMailer-master/PHPMailerAutoload.php";
$mail = new PHPMailer();
$mail->isSMTP();
$mail->SMTPDebug = 2;
$mail->Debugoutput = 'html';
$mail->Host = 'smtp-mail.outlook.com';
$mail->Port = 587;
$mail->SMTPSecure = 'tls';
$mail->SMTPAuth = true;
$mail->Username = "oshamosham@outlook.com";
$mail->Password = "proyectoPHP123";
$mail->setFrom("oshamosham@outlook.com", 'Osham Fashion Community');
$mail->addReplyTo("oshamosham@outlook.com", 'Osham Fashion Community');
$mail->addAddress($email, 'Usuario');
$mail->Subject = 'Reset Password';
示例6: require
<?
require("_functions.php");
require("_database.php");
$email = trim($_GET['email']);
$temppass = trim($_GET['token']);
$message = '';
if (!$email || !$temppass) {
die('Missing $email or $token parameter.');
}
if ($_POST['action'] == 'reset') {
if (!resetPassword($email, $temppass, $password)) {
$message = '<p class="error" style="margin:2em 0">System error. Cannot reset password now.</p>';
}
else {
$message = "<p class='ok' style='margin:2em 0'>Ok, your account's been deleted. <a href='/halfnote'>Go create a new one!</a>.</p>";
}
}
?>
<html>
<head>
<style type="text/css">
<? include("_style_base.php"); ?>
<? include("_style_form.php"); ?>
</style>
<title>halfnote - reset account</title>
<table id="masthead" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="left">
示例7: lower
<?
//security check
if(!$GLOBALS['vlDC']) {
die("<font face=arial size=2>Job 38:11</font>");
}
//should we send the password to an email?
if($remindEmail) {
resetPassword($remindEmail);
go("/sentreminder/$remindEmail/");
}
if($login && $email && $pass) {
//validate
$email=validate($email);
//authenticate
$u=0;
$u=mysqlquery("select * from vl_users where lower(email)='".strtolower($email)."'");
if(mysqlnumrows($u)) {
while($un=mysqlfetcharray($u)) {
if(strtolower($email)==strtolower($un["email"])) {
//email authentic
if(vlSimpleDecrypt($un["xp"])==hash("sha256",$pass)) {
//has this account been de-activated?
if(!$un["active"]) {
go("/login/in/");
} else {
//register session variables
$_SESSION["VLEMAIL"]=$email;
//log
示例8: switch
switch ($i) {
case 10:
//获取token
var_dump(getToken());
break;
case 11:
//创建单个用户
var_dump(createUser("zhangsan", "123456"));
break;
case 12:
//创建批量用户
var_dump(createUsers(array(array("username" => "zhangsan", "password" => "123456"), array("username" => "lisi", "password" => "123456"))));
break;
case 13:
//重置用户密码
var_dump(resetPassword("zhangsan", "123456"));
break;
case 14:
//获取单个用户
var_dump(getUser("zhangsan"));
break;
case 15:
//获取批量用户---不分页(默认返回10个)
var_dump(getUsers());
break;
case 16:
//获取批量用户----分页
$cursor = readCursor("userfile.txt");
var_dump(getUsersForPage(10, $cursor));
break;
case 17:
示例9: header
$message = null;
/** Redirect if key and login are not set */
if (!count($_POST) && (!array_key_exists('key', $_GET) || !array_key_exists('login', $_GET))) {
header('Location: ' . $GLOBALS['RELPATH']);
}
/** Check key for validity */
if (!checkForgottonPasswordKey(sanitize($_GET['key']), sanitize($_GET['login']))) {
header('Location: ' . $GLOBALS['RELPATH'] . '?forgot_password&keyInvalid');
}
if (count($_POST)) {
extract($_POST);
extract($_GET);
if ($user_password != $cpassword) {
$message = sprintf('<p class="failed">%s</p>', _('The passwords do not match.'));
} else {
if (!resetPassword(sanitize($login), sanitize($key), sanitize($user_password))) {
$message = sprintf('<p class="failed">%s</p>', _('Your password failed to get updated.'));
} else {
require_once ABSPATH . 'fm-modules/facileManager/classes/class_logins.php';
$fm_login->checkPassword($login, $user_password);
exit(printResetConfirmation());
}
}
}
printPasswordResetForm($message);
/**
* Display password reset user form.
*
* @since 1.0
* @package facileManager
*/
示例10: getLang
<?php
// include files
include "../../includes/ini.php";
include "../../includes/session.php";
include "../../includes/functions.php";
include "../../lang/" . getLang('');
// send user new password
if ($_POST && $_POST['userEmail']) {
$result = resetPassword($_POST['userEmail']);
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" href="style.css">
<style>
.text
{
font-family: Verdana, Arial;
font-size: 12px;
font-style: normal;
color: #84B2DE;
}
</style>
示例11: resetPassword
<?php
require_once 'includes/header.php';
require_once DIR_APP . 'users.php';
if (isset($_POST['reset_password'])) {
$result = resetPassword($_POST['email']);
}
?>
<div class="home-page content page-forgot">
<div class="main-content">
<div class="content-block">
<div class="content-title">Reset Password</div>
<form action="" method="post">
<?php
if (!empty($result)) {
echo '<p>' . $result . '</p>';
}
?>
<?php
if ($result != 'Thank you. We have sent a login passcode to your email. Please do login with that sent passcode and remember to change it.') {
echo '
<div class="form-item"><label>Your Email:</label> <input type="email" name="email"></div>
<div class="form-bottom"><input type="submit" name="reset_password" value="Send" style=""></div>';
}
?>
</form>
</div>
示例12: session_start
<?php
session_start();
require_once 'config.php';
$isSuccess = false;
$isValid = false;
$expired = '';
$token = htmlspecialchars($_GET["token"]);
if (isset($_SESSION['current_user']['login_username'])) {
header("Location: photography.php");
return;
}
$isValid = SetupSession($token);
if (isset($_POST['changePass'])) {
resetPassword($_POST['newpass']);
}
function SetupSession($token)
{
$conn = mysqli_connect(db_host, db_user, db_pass, db_name);
if (mysqli_connect_errno()) {
echo "Error connecting to database";
return false;
}
$currentDate = date('m/d/Y h:i:s a', time());
$query = "SELECT DISTINCT * FROM users WHERE token = '" . $token . "' AND tokenexpiration >= '" . $currentDate . "'";
$result = mysqli_fetch_assoc(mysqli_query($conn, $query));
if (!$result) {
mysqli_close($conn);
echo "Error connecting to database";
return false;
}
示例13: str_replace
if (!$register_message) {
// Username is a slug of the email address with the dashes removed.
// End users won't use this, we just need a unique ID for the account.
$username = str_replace('-', '', str::slug(get('email')));
// Check for duplicate accounts
$duplicateEmail = $site->users()->findBy('email', trim(get('email')));
$duplicateUsername = $site->users()->findBy('username', $username);
if (count($duplicateEmail) === 0 and count($duplicateUsername) === 0) {
try {
// Random password for initial setup.
// User will create their own password after opt-in email verification.
$password = bin2hex(openssl_random_pseudo_bytes(16));
// Create account
$user = $site->users()->create(array('username' => $username, 'email' => trim(get('email')), 'password' => $password, 'firstName' => trim(get('fullname')), 'language' => 'en', 'country' => get('country')));
// Send password reset email
if (resetPassword($user->email(), true)) {
$register_message = l::get('register-success');
$success = true;
} else {
$register_message = l::get('register-failure-verification');
}
} catch (Exception $e) {
$register_message = l::get('register-failure');
}
} else {
$register_message = l::get('register-duplicate');
}
}
} else {
$register_message = false;
}
示例14: sendValidation
<?php
include "../universal/config.php";
//---sendValidation---//
if (isset($_POST["sendValidation"])) {
include "sendValidation.php";
$result = sendValidation($_POST["email"]);
echo $result;
} elseif (isset($_POST["signUp"])) {
include "signUp.php";
$result = signUp($_POST["key"], $_POST["email"], $_POST["username"], $_POST["password"]);
echo $result;
} elseif (isset($_POST["signIn"])) {
include "signIn.php";
$result = signIn($_POST["email"], $_POST["password"], $_POST["remember"]);
echo $result;
} elseif (isset($_POST["resetValidation"])) {
include "resetValidation.php";
$result = resetValidation($_POST["email"]);
echo $result;
} elseif (isset($_POST["resetPassword"])) {
include "resetPassword.php";
$result = resetPassword($_POST["key"], $_POST["email"], $_POST["password"]);
echo $result;
} elseif (isset($_POST["signOut"])) {
include "signOut.php";
$result = signOut();
echo $result;
}
示例15: header
<?php
header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"');
$userId = $_POST['conf_pass__uid'];
$current_password = $_POST['conf_pass_curr_pass'];
$new_password = $_POST['conf_pass_new_pass'];
$conf_password = $_POST['conf_pass_copy_pass'];
if ($userId == "" || $current_password == "" || $new_password == "" || $conf_password == "") {
header('Location: index.php');
}
if ($new_password != $conf_password) {
header('Location: myprofile.php?resetpass=1');
}
include_once "dbinfo.inc.oop.php";
$result = resetPassword($userId, $current_password, $new_password);
if ($result) {
header('Location: myprofile.php?resetpass=0');
} else {
header('Location: myprofile.php?resetpass=2');
}
?>