Which environment do you want the application to be initialized in?
[0] Development
[1] Production
Your choice [0-1, or "q" to quit] 0
Initialize the application under 'Development' environment? [yes|no] yes
Start initialization ...
generate frontend/config/test-local.php
generate frontend/config/params-local.php
generate frontend/config/main-local.php
generate frontend/config/codeception-local.php
generate frontend/web/index.php
generate frontend/web/robots.txt
generate frontend/web/index-test.php
generate yii
generate backend/config/test-local.php
generate backend/config/params-local.php
generate backend/config/main-local.php
generate backend/config/codeception-local.php
generate backend/web/index.php
generate backend/web/robots.txt
generate backend/web/index-test.php
generate common/config/test-local.php
generate common/config/params-local.php
generate common/config/main-local.php
generate common/config/codeception-local.php
generate yii_test.bat
generate yii_test
generate console/config/test-local.php
generate console/config/params-local.php
generate console/config/main-local.php
generate cookie validation key in backend/config/main-local.php
generate cookie validation key in common/config/codeception-local.php
generate cookie validation key in frontend/config/main-local.php
chmod 0777 backend/runtime
chmod 0777 backend/web/assets
chmod 0777 console/runtime
chmod 0777 frontend/runtime
chmod 0777 frontend/web/assets
chmod 0755 yii
chmod 0755 yii_test
... initialization completed.
php yii migrate
[создались 2 таблицы в бд user , migration]
Зашла на фронтенд и задала данные для signup логин: admin, email: dfghhhhh@gmail.com, пароль: 123456
Мне вышло сообщение что ] должна подтвердить данные на почте
Я пробую залогиниться - ошибка Incorrect username or pasport
Меняла версию php c 5.6 на 7.0.32
Пробовала выбирать production
Не помогло
Что я делаю не так?
<?php
namespace common\models;
use Yii;
use yii\base\Model;
/**
* Login form
*/
class LoginForm extends Model
{
public $username;
public $password;
public $rememberMe = true;
private $_user;
/**
* {@inheritdoc}
*/
public function rules()
{
return [
// username and password are both required
[['username', 'password'], 'required'],
// rememberMe must be a boolean value
['rememberMe', 'boolean'],
// password is validated by validatePassword()
['password', 'validatePassword'],
];
}
/**
* Validates the password.
* This method serves as the inline validation for password.
*
* @param string $attribute the attribute currently being validated
* @param array $params the additional name-value pairs given in the rule
*/
public function validatePassword($attribute, $params)
{
if (!$this->hasErrors()) {
$user = $this->getUser();
if (!$user || !$user->validatePassword($this->password)) {
$this->addError($attribute, 'Incorrect username or password.');
}
}
}
/**
* Logs in a user using the provided username and password.
*
* @return bool whether the user is logged in successfully
*/
public function login()
{
if ($this->validate()) {
return Yii::$app->user->login($this->getUser(), $this->rememberMe ? 3600 * 24 * 30 : 0);
}
return false;
}
/**
* Finds user by [[username]]
*
* @return User|null
*/
protected function getUser()
{
if ($this->_user === null) {
$this->_user = User::findByUsername($this->username);
}
return $this->_user;
}
}