summaryrefslogtreecommitdiff
path: root/server/init.php
diff options
context:
space:
mode:
authorEole <EoleDev@outlook.fr>2016-04-27 16:42:28 +0200
committerEole <EoleDev@outlook.fr>2016-04-27 16:42:28 +0200
commit49f416dc5061032e0514ea0cfeceaca37d13e432 (patch)
tree1202ac2a6fa860b8929afdc886c94fc50bd0a1de /server/init.php
parentc7edd70b5e5b0f5159c78ce3d924d4e7f60db816 (diff)
parentc9202d9113210981ae47df40511645da2ee140df (diff)
Merge branch 'develop' into Eole_Graph
Conflicts: client/index.html client/js/controllers/home/home.js client/partials/home/home.html
Diffstat (limited to 'server/init.php')
-rwxr-xr-xserver/init.php92
1 files changed, 51 insertions, 41 deletions
diff --git a/server/init.php b/server/init.php
index a00927d..e6a90fb 100755
--- a/server/init.php
+++ b/server/init.php
@@ -1,48 +1,58 @@
<?php
- include_once("core/App.php");
+/**
+ * File containing the initialisation of the API.
+ *
+ * @version 1.0 Initialisation of this file
+ * @since 1.0 Core application's file
+ *
+ * @author Eole 'eoledev at outlook . fr'
+ *
+ */
- $user = "";
- $password = "";
- $project = "";
+/*
+* Include Main Api Class
+*/
+include_once("core/App.php");
+
+$user = "";
+$password = "";
+$project = "";
+
+
+//token processing
+if(isset($_POST["token"])){
+ $token = $_POST["token"];
- //traitement requete, recuperation data
- if(isset($_POST["token"])){
-
- $token = $_POST["token"];
-
- }else if(isset($_POST["user"]) && isset($_POST["password"]) && isset($_POST["project"]) ){
-
- $user = $_POST["user"];
- $password = $_POST["password"];
- $project = $_POST["project"];
-
- } /*else { // Test Backend
- $user = "admin";
- $password = "ae5or6cn";
- $project = "admin";
-
- }*/
-
- $Args = Array(
- "user" => Array(
- "name" => $user,
- "password" => $password,
- "domain" => Array(
- "name" => "Default")
- ),
- "scope" => Array(
- "project" => Array(
- "name" => $project,
- "domain" => Array(
- "name" => "Default")
- )
- ),
- "authUrl" => $config["urlAuth"]
- );
+}else if(isset($_POST["user"]) && isset($_POST["password"]) && isset($_POST["project"]) ){
- $App = new App($Args);
+ $user = $_POST["user"];
+ $password = $_POST["password"];
+ $project = $_POST["project"];
+
+}
+
+//Library args
+$Args = Array(
+ "user" => Array(
+ "name" => $user,
+ "password" => $password,
+ "domain" => Array(
+ "name" => "Default")
+ ),
+ "scope" => Array(
+ "project" => Array(
+ "name" => $project,
+ "domain" => Array(
+ "name" => "Default")
+ )
+ ),
+ "authUrl" => $config["urlAuth"]
+);
+
+//Init core Api
+$App = new App($Args);
- if(isset($token))
- $App->setToken($token);
+if(isset($token))
+ $App->setToken($token);
?>