diff --git a/helpers/RememberUserInfo.php b/helpers/RememberUserInfo.php index efcd59e..611d0fc 100644 --- a/helpers/RememberUserInfo.php +++ b/helpers/RememberUserInfo.php @@ -3,6 +3,7 @@ namespace app\helpers; use Yii; +use app\models\Xlogins; class RememberUserInfo { @@ -11,6 +12,7 @@ public static function rememberAll($response = null) if ($response === null) { return ; } + static::rememberLevel($response); static::rememberXlogin($response); } @@ -26,10 +28,9 @@ private static function rememberLevel($response) private static function rememberXlogin($response) { - echo '
'; - foreach ($response as $k => $v) { - echo $k . PHP_EOL; - } - echo ''; die(); + $xlogins = new Xlogins(); + $xlogins->attributes = $xlogins->findOne(['xid' => $response['id']]); + $xlogins->attributes = $response; + $xlogins->save(false); } } diff --git a/models/Xlogins.php b/models/Xlogins.php index 57ca1c0..e602fb4 100644 --- a/models/Xlogins.php +++ b/models/Xlogins.php @@ -57,6 +57,16 @@ public function rules() ]; } + /** + * {@inheritdoc} + */ + public function init() + { + $this->kick = 0; // ???WTF + $this->lastloc = date('Y-m-d H:i:s'); // ???WTF + parent::init(); + } + /** * {@inheritdoc} */