

Nextrek
@ 730
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
<?php session_start(); header("Access-Control-Allow-Origin: *"); header('Content-Type: application/json; charset=UTF-8'); require_once("constants.php"); require_once("repositories/UserRepository.php"); /*$servername = "localhost"; $username = "smartcharging"; $password = "LXRLBaEAuRr7M7jY";*/ //$params = json_decode($_REQUEST["params"], true); //$input = file_get_contents('php://input'); $params = json_decode(file_get_contents('php://input'), true); $conn; $user_repo; //var_dump($params); try { $conn = new PDO("mysql:host=".DB_SERVERNAME.";dbname=".DB_NAME, DB_USERNAME, DB_PASSWORD); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); //echo "Connesso con successo al DB"; $username = (isset($params["username"])) ? $params["username"] : null; $user_repo = new UserRepository($conn); $risposta = $user_repo->facebookLogin($params["fb_user"], $params["user_email"], $params["fb_token"], $params["username"]); } catch(PDOException $e) { echo $e->getMessage(); $risposta = createErrorMessage(2, "Errore DB"); //$risposta["return"] = 2; $risposta["id"] = -1; } echo json_encode($risposta); $conn = null; //Close the connection to the DBMS ?> |
Commits for Nextrek/Android/SmartCharging/endPoints/nightly/login_facebook.php
Revision | Author | Commited | Message |
---|---|---|---|
730
![]() |
![]() |
Tue 15 Sep, 2015 08:03:22 +0000 | |
537
![]() |
![]() |
Mon 24 Aug, 2015 14:46:21 +0000 | |
519
![]() |
![]() |
Fri 21 Aug, 2015 08:03:03 +0000 | |
517
![]() |
![]() |
Thu 20 Aug, 2015 14:25:03 +0000 | |
509 |
![]() |
Thu 20 Aug, 2015 09:58:00 +0000 | Login su facebook |