Refactoring of comments beginning
This commit is contained in:
parent
477dc82182
commit
5263cf00a2
13 changed files with 1535 additions and 1744 deletions
|
@ -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);
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue