Refactoring of comments beginning

This commit is contained in:
EoleDev 2016-04-26 20:42:31 +02:00
parent 477dc82182
commit 5263cf00a2
13 changed files with 1535 additions and 1744 deletions

View file

@ -1,48 +1,55 @@
<?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 = "";
//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";
}*/
include_once("core/App.php");
$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"]
);
$App = new App($Args);
$user = "";
$password = "";
$project = "";
if(isset($token))
$App->setToken($token);
//token processing
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"];
}
//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);
?>