|
|
@@ -254,19 +254,17 @@ class SiteController extends FrontendController |
|
|
|
if ($model->load(Yii::$app->request->post())) { |
|
|
|
$user = $model->signup(); |
|
|
|
|
|
|
|
if ($user) { |
|
|
|
if ($this->getUser()->login($user)) { |
|
|
|
if ($model->isProducer()) { |
|
|
|
$this->redirect(Yii::$app->urlManagerBackend->createAbsoluteUrl(['site/index'])); |
|
|
|
if ($user && $this->getUserCurrent()->login($user)) { |
|
|
|
if ($model->isProducer()) { |
|
|
|
$this->redirect(Yii::$app->urlManagerBackend->createAbsoluteUrl(['site/index'])); |
|
|
|
} |
|
|
|
else { |
|
|
|
$producer = $producerManager->findOneProducerById($model->id_producer); |
|
|
|
if ($producer) { |
|
|
|
$this->redirect($this->getUrlManagerProducer()->createAbsoluteUrl(['site/index', 'slug_producer' => $producer->slug])); |
|
|
|
} |
|
|
|
else { |
|
|
|
$producer = $producerManager->findOneProducerById($model->id_producer); |
|
|
|
if ($producer) { |
|
|
|
$this->redirect($this->getUrlManagerProducer()->createAbsoluteUrl(['site/index', 'slug_producer' => $producer->slug])); |
|
|
|
} |
|
|
|
else { |
|
|
|
$this->redirect(['site/index']); |
|
|
|
} |
|
|
|
$this->redirect(['site/index']); |
|
|
|
} |
|
|
|
} |
|
|
|
} |