Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function ddAuthValidateCredentials($username = null, $password = null) {
- $user = $this->user_model->find($username);
- // Maybe your password is stored in plaintext (BAD) in the database.
- if ( $password == $user['password'] ) {
- return $user['user_id'];
- }
- return null;
- }
- function ddAuthValidateCredentials($username = null, $password = null) {
- $user = $this->user_model->find($username);
- // Maybe your password is encrypted in the database against a salt
- // for the user. In that case, crypt the password we received
- // with the user's salt and see if it matches.
- if ( crypt($password, $user['salt']) == $user['encrypted_password'] ) {
- return $user['user_id'];
- }
- return null;
- }
- ?>
Add Comment
Please, Sign In to add comment