Skip to content

Instantly share code, notes, and snippets.

@flacodirt
Created April 2, 2013 18:10
Show Gist options
  • Save flacodirt/5294662 to your computer and use it in GitHub Desktop.
Save flacodirt/5294662 to your computer and use it in GitHub Desktop.
Authenticate user provided passphrase against previously stored passphrase hash
/**
* 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