diff --git a/src/components/imaging/filters/Thumbnail.php b/src/components/imaging/filters/Thumbnail.php index db8828c0..44c09110 100644 --- a/src/components/imaging/filters/Thumbnail.php +++ b/src/components/imaging/filters/Thumbnail.php @@ -60,6 +60,10 @@ public function init() if (!$this->w && !$this->h) { throw new Exception("Необходимо указать ширину или высоту"); } + + if (!$this->m) { + $this->m = ManipulatorInterface::THUMBNAIL_INSET; + } $q = (int)$this->q; if (!$q) { diff --git a/src/controllers/AuthController.php b/src/controllers/AuthController.php index 51e0442d..da1abf26 100644 --- a/src/controllers/AuthController.php +++ b/src/controllers/AuthController.php @@ -61,6 +61,17 @@ public function behaviors() 'class' => VerbFilter::className(), 'actions' => [ 'logout' => ['post'], + 'auth-by-callcheck-phone-password' => ['post'], + 'auth-by-phone' => ['post'], + 'auth-by-callcheck-phone' => ['post'], + 'auth-by-phone-password' => ['post'], + 'auth-by-phone-sms-code' => ['post'], + 'auth-by-callcheck-phone-code' => ['post'], + 'auth-by-email-code' => ['post'], + 'generate-phone-code' => ['post'], + 'generate-callcheck-phone-code' => ['post'], + 'generate-email-code' => ['post'], + 'generate-email-code' => ['post'], ], ], ]; @@ -606,6 +617,7 @@ public function actionAuthByCallcheckPhone() public function actionAuthByPhonePassword() { $rr = new RequestResponse(); + $rr->setResponseFormatJson(); //Запрос ajax post if ($rr->isRequestAjaxPost() && \Yii::$app->user->isGuest) { @@ -660,6 +672,7 @@ public function actionAuthByPhonePassword() public function actionAuthByCallcheckPhonePassword() { $rr = new RequestResponse(); + $rr->setResponseFormatJson(); //Запрос ajax post if ($rr->isRequestAjaxPost() && \Yii::$app->user->isGuest) { diff --git a/src/controllers/ImagePreviewController.php b/src/controllers/ImagePreviewController.php index 6a216ddf..4aac9253 100644 --- a/src/controllers/ImagePreviewController.php +++ b/src/controllers/ImagePreviewController.php @@ -38,7 +38,7 @@ public function actionProcess() $imaging = \Yii::$app->imaging; if (!$imaging) { //TODO: можно добавить проверку YII ensure... - throw new \yii\base\Exception("Component Imaging not found"); + throw new NotFoundHttpException("Component Imaging not found"); } $newFileSrc = \Yii::$app->request->getPathInfo(); @@ -55,12 +55,12 @@ public function actionProcess() if (!$extension) { - throw new \yii\base\Exception("Extension not found: ".$newFileSrc); + throw new NotFoundHttpException("Extension not found: ".$newFileSrc); } if (!$imaging->isAllowExtension($extension)) { - throw new \yii\base\Exception("Extension '{$extension}' not supported in Imaging component"); + throw new NotFoundHttpException("Extension '{$extension}' not supported in Imaging component"); } @@ -99,12 +99,12 @@ public function actionProcess() if ($params = \Yii::$app->request->get()) { $pramsCheckArray = explode(DIRECTORY_SEPARATOR, $filterSting); if (count($pramsCheckArray) < 3) { - throw new \yii\base\Exception("the control line not found: ".$newFileSrc); + throw new NotFoundHttpException("the control line not found: ".$newFileSrc); } $string = $imaging->getParamsCheckString($params); if ($pramsCheckArray[1] != $string) { - throw new \yii\base\Exception("Parameters invalid: ".$newFileSrc); + throw new NotFoundHttpException("Parameters invalid: ".$newFileSrc); } } @@ -114,7 +114,7 @@ public function actionProcess() if (!class_exists($filterClass)) { - throw new \ErrorException("Filter class is not created: ".$newFileSrc); + throw new NotFoundHttpException("Filter class is not created: ".$newFileSrc); } ArrayHelper::remove($params, "ext"); @@ -134,6 +134,9 @@ public function actionProcess() try { + /*if (YII_ENV_DEV) { + print_r($filter);die; + }*/ //Проверяем а создан ли уже файл, и если да то просто делаем на него ссылку. $filter ->setOriginalRootFilePath($originalFileRoot)