I am just starting to use the yiiframework and I am currently working on logging, authentication and authorization. My questions are.
Questions one.
Each time I log in I get taken to the home page again, Now do I change this so I get redirected to another paged eg setting.php.
Question two.
If a user is logged in and wants to go to another page within the "loggedin only" pages eg setting_2.php How do i check the users authentication and authorization.
As I said before these are two easy question but all the exmaples I have seen do not seem to explain it clearly.
This will redirect the user back to the action that required a login. To do so you don’t necessarily need RBAC. You can do like this:
public function actionSomething() {
if (Yii::app()->user->isGuest)
Yii::app()-user->loginRequired();
// The code hereafter will only execute after login
}