Difference between #4 and #5 of
Implementing a User Level Access System

Revision #5 has been created by Antonio Ramirez on May 13, 2011, 5:42:37 AM with the memo:

Fixed minor code variation
« previous (#4) next (#6) »

Changes

Title unchanged

Implementing a User Level Access System

Category unchanged

Tutorials

Yii version unchanged

Tags unchanged

tutorial, Authentication, tips

Content changed

[...]
$user = $this->loadUser();
if ($user)
return $user->level==LevelLookUp::ADMIN;
return false;
}
// saving logged users into a state
 
    protected function afterLogin()
 
    {
 
        $this->setState('___uid', $this->id);
 
        return true;
 
    }
     // Load user model. protected function loadUser() { if ( $this->_model === null ) { $this->_model = User::model()->findByPk( $this->getState('___uid')id );
}
return $this->_model;
}
}
```
[...]
27 0
37 followers
Viewed: 71 741 times
Version: 1.1
Category: Tutorials
Written by: Antonio Ramirez
Last updated by: Phil Loaiza
Created on: May 10, 2011
Last updated: 10 years ago
Update Article

Revisions

View all history