diff options
Diffstat (limited to 'server/init.php')
| -rwxr-xr-x | server/init.php | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/server/init.php b/server/init.php new file mode 100755 index 0000000..2c07947 --- /dev/null +++ b/server/init.php @@ -0,0 +1,72 @@ +<?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"); + + //traitement requete, recuperation data + if(isset($_POST["key"])){ + //recuperation des donnes sauvegardes + + }else if(isset($_POST["user"]) && isset($_POST["password"]) && isset($_POST["project"]) ){ + + $user = $_POST["user"]; + $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 { + $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"] + ); + } + + $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)); + +?> |
