Skip to content

Commit

Permalink
[WIP][unitfactoryAlumni#66] Xlogins update implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
vbrazas committed Mar 27, 2019
1 parent e32dd81 commit bc784ee
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
11 changes: 6 additions & 5 deletions helpers/RememberUserInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace app\helpers;

use Yii;
use app\models\Xlogins;

class RememberUserInfo
{
Expand All @@ -11,6 +12,7 @@ public static function rememberAll($response = null)
if ($response === null) {
return ;
}

static::rememberLevel($response);
static::rememberXlogin($response);
}
Expand All @@ -26,10 +28,9 @@ private static function rememberLevel($response)

private static function rememberXlogin($response)
{
echo '<pre>';
foreach ($response as $k => $v) {
echo $k . PHP_EOL;
}
echo '</pre>'; die();
$xlogins = new Xlogins();
$xlogins->attributes = $xlogins->findOne(['xid' => $response['id']]);
$xlogins->attributes = $response;
$xlogins->save(false);
}
}
10 changes: 10 additions & 0 deletions models/Xlogins.php
Original file line number Diff line number Diff line change
Expand Up @@ -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}
*/
Expand Down

0 comments on commit bc784ee

Please sign in to comment.