Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- public function checkPassword( Validation $validation, $password ) {
- $username = $validation['username'];
- $password = $this->_hashPassword( $password, $this->_getSaltFromId( $this->_getIdFromUsername( $username ) ) );
- $query =
- DB::select( 'id' )
- ->from( 'users' )
- ->where( 'username', '=', $username )
- ->where( 'password', '=', $password );
- $result =
- $query->execute()
- ->count();
- if ( $result === 0 ) {
- $validation->error( 'password', 'checkPassword' );
- }
- }
Add Comment
Please, Sign In to add comment