connection = $connection; $this->session = $session; } /** * Authenticates user. * * @return int * * @since 1.0.0 */ public function authenticate() : int { $uid = $this->session->get('UID'); if (empty($uid)) { return 0; } return $uid; } /** * Logout the given user. * * @param int $uid User ID * * @return void * * @since 1.0.0 */ public function logout(int $uid = null) /* : void */ { // TODO: logout other users? If admin wants to kick a user for updates etc. $this->session->remove('UID'); } }