Esempio n. 1
0
 public function actionIn()
 {
     $model = new models\LoginForm();
     if (!Yii::$app->user->isGuest || $model->load(Yii::$app->request->post()) && $model->login()) {
         return $this->redirect(Yii::$app->user->getReturnUrl(['/admin']));
     } else {
         return $this->render('in', ['model' => $model]);
     }
 }
Esempio n. 2
0
 public function actionFinish()
 {
     $root_password = Yii::$app->session->getFlash('root_password', null, true);
     if ($root_password) {
         $loginForm = new LoginForm(['username' => 'root', 'password' => $root_password]);
         if ($loginForm->login()) {
             return $this->redirect(['/admin/']);
         }
     }
     return $this->render('finish');
 }
Esempio n. 3
0
 public function actionFinish()
 {
     $root_password = Yii::$app->session->getFlash(InstallForm::ROOT_PASSWORD_KEY, true);
     $returnRoute = Yii::$app->session->getFlash(InstallForm::RETURN_URL_KEY, '/admin');
     if ($root_password) {
         $loginForm = new LoginForm(['username' => 'root', 'password' => $root_password]);
         if ($loginForm->login()) {
             return $this->redirect([$returnRoute]);
         }
     }
     return $this->render('finish');
 }
 public function down()
 {
     $this->dropTable(models\Admin::tableName());
     $this->dropTable(models\LoginForm::tableName());
     $this->dropTable(models\Module::tableName());
     $this->dropTable(models\Photo::tableName());
     $this->dropTable(models\Setting::tableName());
     $this->dropTable(Carousel::tableName());
     $this->dropTable(Category::tableName());
     $this->dropTable(Item::tableName());
     $this->dropTable(Feedback::tableName());
     $this->dropTable(File::tableName());
     $this->dropTable(Album::tableName());
     $this->dropTable(Guestbook::tableName());
     $this->dropTable(News::tableName());
     $this->dropTable(Page::tableName());
     $this->dropTable(Subscriber::tableName());
     $this->dropTable(History::tableName());
     $this->dropTable(Text::tableName());
 }
Esempio n. 5
0
 public function actionIndex()
 {
     $data = new ActiveDataProvider(['query' => LoginForm::find()->desc()]);
     return $this->render('index', ['data' => $data]);
 }
Esempio n. 6
0
 public function down()
 {
     $this->dropTable(models\Admin::tableName());
     $this->dropTable(models\LoginForm::tableName());
     $this->dropTable(models\Module::tableName());
     $this->dropTable(models\Photo::tableName());
     $this->dropTable(models\Setting::tableName());
     $this->dropTable(Carousel::tableName());
     $this->dropTable(catalog\models\Category::tableName());
     $this->dropTable(catalog\models\Item::tableName());
     $this->dropTable(article\models\Category::tableName());
     $this->dropTable(article\models\Item::tableName());
     $this->dropTable(Feedback::tableName());
     $this->dropTable(File::tableName());
     $this->dropTable(gallery\models\Category::tableName());
     $this->dropTable(Guestbook::tableName());
     $this->dropTable(News::tableName());
     $this->dropTable(Page::tableName());
     $this->dropTable(Subscriber::tableName());
     $this->dropTable(History::tableName());
     $this->dropTable(Text::tableName());
     $this->dropTable(Menu::tableName());
     $this->dropTable(MenuItem::tableName());
 }