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