diff options
Diffstat (limited to 'server/init.php')
| -rwxr-xr-x | server/init.php | 56 |
1 files changed, 16 insertions, 40 deletions
diff --git a/server/init.php b/server/init.php index 2c07947..a00927d 100755 --- a/server/init.php +++ b/server/init.php @@ -1,13 +1,15 @@ <?php - include_once("config.inc.php"); - include_once("core/Plugin_Api.php"); - require "vendor/autoload.php"; - include_once("core/LibOverride/genTokenOptions.php"); - include_once("core/Identity.php"); + include_once("core/App.php"); + $user = ""; + $password = ""; + $project = ""; + + //traitement requete, recuperation data - if(isset($_POST["key"])){ - //recuperation des donnes sauvegardes + if(isset($_POST["token"])){ + + $token = $_POST["token"]; }else if(isset($_POST["user"]) && isset($_POST["password"]) && isset($_POST["project"]) ){ @@ -15,28 +17,14 @@ $password = $_POST["password"]; $project = $_POST["project"]; - $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 { + } /*else { // Test Backend $user = "admin"; $password = "ae5or6cn"; $project = "admin"; - $Args = Array( + }*/ + + $Args = Array( "user" => Array( "name" => $user, "password" => $password, @@ -52,21 +40,9 @@ ), "authUrl" => $config["urlAuth"] ); - } - - $pluginApi = plugin_api::getInstance(); - //$openstack_api = new OpenStack\OpenStack($Args); - //$id = new identity($openstack_api, $pluginApi); - - //$token = $id->genToken(); - - $tmp = new genTokenOptions($Args); - $tmp->genIdentityToken(); - $array = $tmp->getOptions("Identity"); - $openstack_api = new OpenStack\OpenStack([]); - - $identityBack = $tmp->getBackup("Identity"); - //file_put_contents("token", serialize($tmp)); + $App = new App($Args); + if(isset($token)) + $App->setToken($token); ?> |
