/** * @param $token (Token + profile_id) * @param $sessionStream * @param $clientIP * @return bool */ public static function verifyStream($token, $sessionStream, $clientIP) { //TODO them phan check thgian cho token: sau delta second thi deny //Parse Token de lay dc token clean va profileID $arr = CUtils::parseTokenStream($token); if (!isset($arr['profileid'])) { return false; } $profileid = $arr['profileid']; $tmpToken = self::makeTokenStream($sessionStream, $clientIP, $profileid); if ($token == $tmpToken) { CUtils::log('Valid Token: ' . $tmpToken); return true; } else { CUtils::log('invalid Token: ' . $tmpToken); return false; } }