mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 22:28:51 +01:00
Save users last login datetime
This commit is contained in:
parent
fc5b8e2408
commit
01e51593bb
@ -107,6 +107,10 @@ class UserIdentity extends CUserIdentity {
|
||||
* @param User $user
|
||||
*/
|
||||
private function onSuccessfulAuthenticate($user) {
|
||||
|
||||
$user->last_login = new CDbExpression('NOW()');
|
||||
$user->save();
|
||||
|
||||
$this->_id = $user->id;
|
||||
$this->setState('title', $user->title);
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
class m140706_135210_lastlogin extends EDbMigration
|
||||
{
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn('user', 'last_login', 'DATETIME DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m140706_135210_lastlogin does not support migration down.\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to do migration with transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user