This commit is contained in:
resurtm
2016-12-21 12:32:43 +06:00
parent 05566c0c58
commit 82dfada5c8
5 changed files with 89 additions and 4 deletions

View File

@ -19,13 +19,14 @@ use Da\User\Query\SocialNetworkAccountQuery;
use Da\User\Service\SocialNetworkAccountConnectService;
use Da\User\Service\SocialNetworkAuthenticateService;
use Da\User\Traits\ContainerAwareTrait;
use Yii;
use yii\authclient\AuthAction;
use yii\base\Module;
use yii\filters\AccessControl;
use yii\filters\VerbFilter;
use yii\web\Controller;
use Yii;
use \yii\web\Response;
use yii\web\Response;
use yii\widgets\ActiveForm;
class SecurityController extends Controller
{
@ -113,6 +114,11 @@ class SecurityController extends Controller
/** @var FormEvent $event */
$event = $this->make(FormEvent::class, [$form]);
if (Yii::$app->request->isAjax && $form->load(Yii::$app->request->post())) {
Yii::$app->response->format = Response::FORMAT_JSON;
return ActiveForm::validate($form);
}
if ($form->load(Yii::$app->request->post())) {
$this->trigger(FormEvent::EVENT_BEFORE_LOGIN, $event);
if ($form->login()) {

View File

@ -28,7 +28,7 @@ use yii\web\IdentityInterface;
*
* @property bool $isAdmin
* @property bool $isBlocked
* @property bool $isConfirmed
* @property bool $isConfirmed whether user account has been confirmed or not
*
* Database fields:
* @property int $id
@ -224,7 +224,8 @@ class User extends ActiveRecord implements IdentityInterface
}
/**
* @return bool
* Returns whether user account has been confirmed or not.
* @return bool whether user account has been confirmed or not
*/
public function getIsConfirmed()
{