Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Welcome extends Controller {
- function index() {
- $this->load->library('Ddauth');
- $this->ddauth->execute();
- $this->load->view('welcome_message', array(
- 'userId' => $this->ddauth->id
- ));
- }
- /**
- * Validate authentication credentials
- */
- function ddAuthValidateCredentials($username = null, $password = null) {
- $userToPassword = array(
- '5' => array( 'username' => 'test', 'password' => 'asdf', ),
- );
- foreach ( $userToPassword as $id => $user ) {
- if ( $user['username'] == $username ) {
- if ( $user['password'] == $password ) {
- return $id;
- } else {
- return false;
- }
- }
- }
- return null;
- }
- }
- ?>
Add Comment
Please, Sign In to add comment