From 5c056710bcb8084226f10b8133f7319c33938d51 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Sun, 28 Feb 2016 00:26:13 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D0=B0?= =?UTF-8?q?=20=D1=81=20=D0=BE=D1=82=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=BE?= =?UTF-8?q?=D0=B9=20=D0=BF=D0=B8=D1=81=D1=8C=D0=BC=D0=B0=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=B2=D0=BE=D1=81=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=B0=D1=80=D0=BE=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=BE=D1=82=20=D0=B0=D0=BA=D0=BA=D0=B0=D1=83=D0=BD?= =?UTF-8?q?=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/controllers/OauthController.php | 1 + common/models/Account.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/api/controllers/OauthController.php b/api/controllers/OauthController.php index a74d33e..a815116 100644 --- a/api/controllers/OauthController.php +++ b/api/controllers/OauthController.php @@ -126,6 +126,7 @@ class OauthController extends Controller { if (!$account->canAutoApprove($clientModel, $authParams['scopes'])) { $isAccept = Yii::$app->request->post('accept'); + $isAccept = null; if ($isAccept === null) { throw new AcceptRequiredException(); } diff --git a/common/models/Account.php b/common/models/Account.php index fa40f99..b961a50 100644 --- a/common/models/Account.php +++ b/common/models/Account.php @@ -206,9 +206,9 @@ class Account extends ActiveRecord implements IdentityInterface { * @return bool */ public function canAutoApprove(OauthClient $client, array $scopes = []) { - if ($client->is_trusted) { - return true; - } + //if ($client->is_trusted) { + // return true; + //} /** @var OauthSession|null $session */ $session = $this->getSessions()->andWhere(['client_id' => $client->id])->one();