/** * Check if user is authenticated * * @param User $user * @param int $uid Given fe_users uid * @return void */ protected function testSpoof($user, $uid) { if ($user->getUid() !== (int) $uid && $uid > 0) { LogUtility::log(Log::STATUS_PROFILEUPDATEREFUSEDSECURITY, $user); $this->addFlashMessage(LocalizationUtility::translateByState(Log::STATUS_PROFILEUPDATEREFUSEDSECURITY), '', FlashMessage::ERROR); $this->forward('edit'); } }
/** * Check if FE Session exists * * @param User $user * @return bool */ public static function checkFrontendSessionToUser(User $user) { $select = 'ses_id'; $from = 'fe_sessions'; $where = 'ses_userid = ' . (int) $user->getUid(); $res = self::getDatabaseConnection()->exec_SELECTquery($select, $from, $where); $row = self::getDatabaseConnection()->sql_fetch_assoc($res); return !empty($row['ses_id']); }