Created
December 31, 2014 19:09
-
-
Save evercode1/709d6e822a2b2b1c413f to your computer and use it in GitHub Desktop.
loginAdmin Chap 7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function loginAdmin() | |
| { | |
| if (($this->validate()) && $this->getUser()->role_id >= ValueHelpers::getRoleValue('Admin') | |
| && $this->getUser()->status_id == ValueHelpers::getStatusValue('Active')) { | |
| return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600 * 24 * 30 : 0); | |
| } else { | |
| throw new NotFoundHttpException('You Shall Not Pass.'); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment