public function index()
 {
     $session = new Session();
     if (!$session->has("steamID")) {
         $login = new SteamLogin();
         $id = $login->validate();
         $session->set('steamID', $id);
         $steam = new SteamTrade();
         $steam->setup('1e1d06a9181f9ac97c40a10c', 'steamLogin=76561198047101004%7C%7CB1B0009AF0E71B3B96D0537D5F7193D523EA552E; steamLoginSecure=76561198047101004%7C%7C7D58C71A36B792D116133E289B08F4CD34BE9484;');
     }
     return view("csgo/index")->with('session', $session);
 }
Пример #2
0
 /**
  * @Route("/link_steam_account", name="link_steam_account")
  */
 public function testAction(Request $request)
 {
     $user = $this->getUser();
     if ($user->getSteamAccount()) {
         return $this->render('BoardBundle:Steam:link_already_linked.html.twig');
     }
     if ($request->query->has('openid_claimed_id')) {
         $steamID = explode('/', $request->query->get('openid_claimed_id'));
         $steamID = $steamID[count($steamID) - 1];
         if (is_numeric($steamID)) {
             $user->setSteamAccount(new SteamAccount($steamID));
             $em = $this->getDoctrine()->getManager();
             $em->flush();
             return new RedirectResponse("link_steam_success");
         }
     }
     $login = new SteamLogin();
     return new Response('<a href="' . $login->url($this->get('router')->generate('link_steam_account', array(), UrlGeneratorInterface::ABSOLUTE_URL)) . '" id="">STEAM AUTH</a>');
 }