Guest User

Untitled

a guest
May 1st, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <?php
  2.  
  3. class Welcome extends Controller {
  4.  
  5. function index() {
  6. $this->load->library('Ddauth');
  7. $this->ddauth->execute();
  8. $this->load->view('welcome_message', array(
  9. 'userId' => $this->ddauth->id
  10. ));
  11. }
  12.  
  13. /**
  14. * Validate authentication credentials
  15. */
  16. function ddAuthValidateCredentials($username = null, $password = null) {
  17. $userToPassword = array(
  18. '5' => array( 'username' => 'test', 'password' => 'asdf', ),
  19. );
  20. foreach ( $userToPassword as $id => $user ) {
  21. if ( $user['username'] == $username ) {
  22. if ( $user['password'] == $password ) {
  23. return $id;
  24. } else {
  25. return false;
  26. }
  27. }
  28. }
  29. return null;
  30. }
  31.  
  32. }
  33. ?>
Add Comment
Please, Sign In to add comment