本文整理汇总了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;
}