Skip to content

Instantly share code, notes, and snippets.

@evercode1
Created December 31, 2014 19:09
Show Gist options
  • Select an option

  • Save evercode1/709d6e822a2b2b1c413f to your computer and use it in GitHub Desktop.

Select an option

Save evercode1/709d6e822a2b2b1c413f to your computer and use it in GitHub Desktop.
loginAdmin Chap 7
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