当前位置: 首页>>代码示例>>PHP>>正文


PHP Hash::GenerateHash方法代码示例

本文整理汇总了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;
 }
开发者ID:rb-ma,项目名称:myaarth,代码行数:18,代码来源:lib_v2.php

示例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;
}
开发者ID:rb-ma,项目名称:myaarth,代码行数:31,代码来源:methods.php


注:本文中的Hash::GenerateHash方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。