|
|
|
@ -283,8 +283,7 @@ class User extends Component
|
|
|
|
|
$this->setReturnUrl($request->getUrl()); |
|
|
|
|
} |
|
|
|
|
if ($this->loginUrl !== null) { |
|
|
|
|
$response = Yii::$app->getResponse(); |
|
|
|
|
$response->redirect($this->loginUrl)->send(); |
|
|
|
|
Yii::$app->controller->getResponse()->redirect($this->loginUrl)->send(); |
|
|
|
|
exit(); |
|
|
|
|
} else { |
|
|
|
|
throw new HttpException(403, Yii::t('yii', 'Login Required')); |
|
|
|
@ -372,7 +371,7 @@ class User extends Component
|
|
|
|
|
$cookie = new Cookie($this->identityCookie); |
|
|
|
|
$cookie->value = $value; |
|
|
|
|
$cookie->expire = time() + (int)$data[2]; |
|
|
|
|
Yii::$app->getResponse()->getCookies()->add($cookie); |
|
|
|
|
Yii::$app->controller->getResponse()->getCookies()->add($cookie); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -395,7 +394,7 @@ class User extends Component
|
|
|
|
|
$duration, |
|
|
|
|
)); |
|
|
|
|
$cookie->expire = time() + $duration; |
|
|
|
|
Yii::$app->getResponse()->getCookies()->add($cookie); |
|
|
|
|
Yii::$app->controller->getResponse()->getCookies()->add($cookie); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -429,7 +428,7 @@ class User extends Component
|
|
|
|
|
$this->sendIdentityCookie($identity, $duration); |
|
|
|
|
} |
|
|
|
|
} elseif ($this->enableAutoLogin) { |
|
|
|
|
Yii::$app->getResponse()->getCookies()->remove(new Cookie($this->identityCookie)); |
|
|
|
|
Yii::$app->controller->getResponse()->getCookies()->remove(new Cookie($this->identityCookie)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|