本文整理匯總了PHP中Hash::GenerateHash方法的典型用法代碼示例。如果您正苦於以下問題:PHP Hash::GenerateHash方法的具體用法?PHP Hash::GenerateHash怎麽用?PHP Hash::GenerateHash使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Hash
的用法示例。
在下文中一共展示了Hash::GenerateHash方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: CommitUserToDatabase
public function CommitUserToDatabase($Email, $Password, $WelcomeHash)
{
$this->Connect();
$InUse = null;
$HashedPassword = Hash::GenerateHash($Password);
if ($Statement = $this->MySQLi->prepare("INSERT INTO users (user_email, password_sha256_hash, welcome_hash) VALUES (?,?,?)")) {
$Time = time();
$Statement->bind_param("sss", $Email, $HashedPassword, $WelcomeHash);
$Statement->execute();
$Rows = $this->MySQLi->affected_rows;
if ($Rows == 1) {
//UserManagement::CreateSession($Email);
}
$Statement->close();
}
$this->Disconnect();
return $Rows == 1 ? true : false;
}
示例2: Database
return;
}
$DB = new Database();
$RecoveryHash = $DB->StoreRecoveryHash($EmailAddress);
$EmailObject = new Email();
$EmailObject->SendRecoveryEmail($EmailAddress, $RecoveryHash);
print JSONResponse::PrepareResponse(true, "Sent", null);
break;
case 'updatepassword':
if (isset($_REQUEST['e']) && isset($_REQUEST['p']) && isset($_REQUEST['h'])) {
$EmailAddress = $_REQUEST['e'];
$NewPassword = $_REQUEST['p'];
$Hash = $_REQUEST['h'];
} else {
return;
}
$NewHash = Hash::GenerateHash($NewPassword);
$DB = new Database();
$DB->UpdateRecoveryPassword($EmailAddress, $Hash, $NewHash);
break;
case 'resetportfolio':
$DB = new Database();
UserManagement::InitSession();
$DB->ResetPortfolio($_SESSION['User']->user_id);
print JSONResponse::PrepareResponse(true, "Sent", null);
break;
case 'testmessage':
$EmailObject = new Email();
$EmailObject->SendWelcomeEmail("timothyferrell@gmail.com", "test");
break;
}