Created
April 2, 2013 18:10
-
-
Save flacodirt/5294662 to your computer and use it in GitHub Desktop.
Authenticate user provided passphrase against previously stored passphrase hash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* authenticatePassphrase | |
* | |
* Authenticate user provided passphrase against previously stored passphrase hash | |
* | |
* @author https://gist.github.com/dirte | |
* @access public | |
* @param string $frmPassphrase | |
* @param string $dbPassphrase | |
* @return boolean | |
*/ | |
public function authenticatePassphrase($frmPassphrase, $dbPassphrase) { | |
if (crypt($frmPassphrase, $dbPassphrase) == $dbPassphrase) { | |
// User authenticated | |
return true; | |
} else { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment