public function Index()
 {
     if (CommonController::IsAuthentified()) {
         $data = array($_SESSION['id']);
         $WSCtrl = new WebServicesController();
         $userResponse = $WSCtrl->Call("User", "GET", $data);
         $user = json_decode($userResponse, true);
         $userResponse = $WSCtrl->Call("Collection", "GET", $data);
         json_decode($userResponse, true);
         $userResponse = $WSCtrl->Call("Login", "GET", $data);
         json_decode($userResponse, true);
         $collectionCtrl = new CollectionController();
         $data = array('user' => $user, 'url' => array('newCollection' => CommonController::GetLink("Collection", "Create"), 'displayCollection' => CommonController::GetLink("Collection", "ViewColl"), 'signUp' => CommonController::GetLink("Login", "SignIn"), 'newCollection' => CommonController::GetLink("Collection", "Create")), 'Collections' => $collectionCtrl->GetPrivateCollections());
         CommonController::SetView("home", "index", $data);
     } else {
         CommonController::Redirect("Login");
     }
 }
Exemplo n.º 2
0
 public static function IsAuthentified()
 {
     $WebSevCtrl = new WebServicesController();
     return $WebSevCtrl->Call('Login') === 'true';
 }
Exemplo n.º 3
0
 public function GetCollection($id)
 {
     if (CommonController::IsAuthentified()) {
         $wSCtrl = new WebServicesController();
         $response = $wSCtrl->Call("Collection", "GET", ["id" => $id]);
         return json_decode($response, true);
     }
     return null;
 }