Move certain user functions (api accessed and logged in) into specific events

This commit is contained in:
DariusIII
2019-02-20 15:08:53 +01:00
parent 7e56928831
commit f2c1eaaddc
10 changed files with 163 additions and 30 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
require_once NN_LIB.'utility/SmartyUtils.php';
use App\Events\UserLoggedIn;
use App\Models\User;
use Blacklight\SABnzbd;
use App\Models\Category;
@@ -243,7 +244,7 @@ class BasePageController extends Controller
// Update last login every 15 mins.
if ((strtotime($this->userdata['now']) - 900) > strtotime($this->userdata['lastlogin'])) {
User::updateSiteAccessed($this->userdata->id);
event(new UserLoggedIn($this->userdata));
}
$this->smarty->assign('userdata', $this->userdata);