istic-openstack/server/index.php

71 lines
1.5 KiB
PHP
Raw Normal View History

<?php
require "vendor/autoload.php";
include_once("config.inc.php");
include_once("init.php");
if(isset($_POST["task"]) && isset($_POST["action"])){
$task = $_POST["task"];
$action = $_POST["action"];
2016-03-09 14:53:48 +01:00
}else if(isset($_POST["task"]) && $_POST["task"] == "Authenticate" || $_POST["task"] == "Deauthenticate"){
$task = $_POST["task"];
}else{
//Gestion Erreur
}
if($task == "Authenticate"){
$App->authenticate();
$App->show();
2016-03-09 14:53:48 +01:00
}else if($task == "Deauthenticate"){
$App->deauthenticate();
$App->show();
2016-03-19 12:49:07 +01:00
}else if($App->checkToken()){
2016-03-09 14:53:48 +01:00
switch($task)
{
case "identity":
include_once("core/Identity.php");
$identityObject = new identity($App);
$identityObject->action($action);
$App->show();
break;
case "network":
include_once("core/Network.php");
$networkObject = new network($App);
$networkObject->action($action);
$App->show();
break;
case "image":
include_once("core/Image.php");
$imageObject = new image($App);
$imageObject->action($action);
$App->show();
break;
case "compute":
include_once("core/Compute.php");
$computeObject = new compute($App);
$computeObject->action($action);
$App->show();
break;
2016-04-18 20:01:50 +02:00
case "networkLayer3":
include_once("core/NetworkLayer3.php");
$computeObject = new networkLayer3($App);
2016-04-18 20:01:50 +02:00
$computeObject->action($action);
$App->show();
break;
2016-03-09 14:53:48 +01:00
}
2016-03-19 12:49:07 +01:00
}else{
2016-03-23 15:13:42 +01:00
$App->setOutput("Error", "Token Invalide");
2016-03-19 12:49:07 +01:00
$App->show();
2016-01-31 04:00:20 +01:00
}
2016-01-31 14:34:43 +01:00
2016-03-09 14:53:48 +01:00