Dateien hochladen nach „api“
This commit is contained in:
parent
3f55867d8c
commit
fe88130aaf
|
@ -1,18 +1,30 @@
|
|||
<?php
|
||||
$data = json_decode(file_get_contents('php://input'), true);
|
||||
//file_put_contents("debug.txt", file_get_contents('php://input'));
|
||||
//print_r($data);
|
||||
|
||||
//Add Grid
|
||||
if(isset($data['RegionOwnerURL']['HomeURI']))
|
||||
$GridData = new OSGrid(@$data['GridName'], @$data['RegionOwnerURL']['HomeURI'], @$data['RegionOwnerURL']['AssetServerURI'], @$data['RegionOwnerURL']['IMServerURI']);
|
||||
|
||||
if(!isset($GridData))
|
||||
die("Unknown Error: Grid data not in db.");
|
||||
|
||||
//Add Region
|
||||
$RegionData = $GridData->addRegion(@$data['RegionName'], @$data['UUID'], @$data['RegionOwnerID'], @$data['UUID'], @$data['Hostname'], @$data['Port']);
|
||||
|
||||
//Add User
|
||||
$UserData = $GridData->addUser(@$data['RegionOwnerID'], @$data['RegionOwnerName'], @$data['RegionOwnerMail']);
|
||||
<?php
|
||||
$data = json_decode(file_get_contents('php://input'), true);
|
||||
//file_put_contents("debug.txt", file_get_contents('php://input'));
|
||||
//print_r($data);
|
||||
|
||||
if(count($data) == 0)
|
||||
die("data count error");
|
||||
|
||||
if(!isset($data['GridName']))
|
||||
die("cant find gridname");
|
||||
|
||||
if(!isset($data['RegionOwnerURL']))
|
||||
die("cant find RegionOwnerURL");
|
||||
|
||||
if(!isset($data['RegionOwnerURL']))
|
||||
die("cant find RegionOwnerURL");
|
||||
|
||||
//Add Grid
|
||||
if(isset($data['RegionOwnerURL']['HomeURI']))
|
||||
$GridData = new OSGrid(@$data['GridName'], @$data['RegionOwnerURL']['HomeURI'], @$data['RegionOwnerURL']['AssetServerURI'], @$data['RegionOwnerURL']['IMServerURI']);
|
||||
|
||||
if(!isset($GridData))
|
||||
die("Unknown Error: Grid data not in db.");
|
||||
|
||||
//Add Region
|
||||
$RegionData = $GridData->addRegion(@$data['RegionName'], @$data['UUID'], @$data['RegionOwnerID'], @$data['UUID'], @$data['Hostname'], @$data['Port']);
|
||||
|
||||
//Add User
|
||||
$UserData = $GridData->addUser(@$data['RegionOwnerID'], @$data['RegionOwnerName'], @$data['RegionOwnerMail']);
|
||||
?>
|
|
@ -1,34 +1,38 @@
|
|||
<?php
|
||||
$gridInfo = getGridInfo($_POST['region_grid_home_url']);
|
||||
$serviceURLS = getUserServiceURL($_POST['region_grid_home_url'], $_POST['object_owner']);
|
||||
$userInfo = getUserInfo(@$serviceURLS['SRV_HomeURI'], $_POST['object_owner']);
|
||||
$regionInfo = getRegionInfo($serviceURLS['SRV_HomeURI'], $_POST['region_name']);
|
||||
$regionData = getRegionData($serviceURLS['SRV_HomeURI'], $regionInfo['uuid']);
|
||||
|
||||
if(!isset($gridInfo) || count($gridInfo) == 0)
|
||||
die("getGridInfo request error");
|
||||
|
||||
if(!isset($serviceURLS) || count($serviceURLS) == 0)
|
||||
die("serviceURLS request error");
|
||||
|
||||
if(!isset($regionInfo['result']) || $regionInfo['result'] == "false")
|
||||
die("regionInfo request error");
|
||||
|
||||
if(!isset($regionData['result']) || $regionData['result'] == "false")
|
||||
die("regionData request error");
|
||||
|
||||
if(!isset($userInfo['result']) || $userInfo['result'] == "false")
|
||||
die("userInfo request error");
|
||||
|
||||
//Add Grid
|
||||
$GridData = new OSGrid(@$gridInfo['gridname'], @$serviceURLS['SRV_HomeURI'], @$serviceURLS['SRV_AssetServerURI'], @$serviceURLS['SRV_IMServerURI']);
|
||||
|
||||
if(!isset($GridData))
|
||||
die("Unknown Error: Grid data not in db.");
|
||||
|
||||
//Add Region
|
||||
$RegionData = $GridData->addRegion(@$regionData['region_name'], @$regionInfo['uuid'], @$_POST['object_owner'], @$_POST['region_image_asset'], @$regionData['hostname'], @$regionData['http_port']);
|
||||
|
||||
//Add User
|
||||
$UserData = $GridData->addUser(@$_POST['object_owner'], $userInfo['user_firstname']." ".$userInfo['user_lastname'], "");
|
||||
<?php
|
||||
$gridInfo = getGridInfo($_POST['region_grid_home_url']);
|
||||
$serviceURLS = getUserServiceURL($_POST['region_grid_home_url'], $_POST['object_owner']);
|
||||
$userInfo = getUserInfo(@$serviceURLS['SRV_HomeURI'], $_POST['object_owner']);
|
||||
$regionInfo = getRegionInfo($serviceURLS['SRV_HomeURI'], $_POST['region_name']);
|
||||
$regionData = getRegionData($serviceURLS['SRV_HomeURI'], $regionInfo['uuid']);
|
||||
|
||||
if(!isset($gridInfo) || count($gridInfo) == 0)
|
||||
die("getGridInfo request error");
|
||||
|
||||
if(!isset($serviceURLS) || count($serviceURLS) == 0)
|
||||
die("serviceURLS request error");
|
||||
|
||||
if(!isset($regionInfo['result']) || $regionInfo['result'] == "false")
|
||||
die("regionInfo request error");
|
||||
|
||||
if(!isset($regionData['result']) || $regionData['result'] == "false")
|
||||
die("regionData request error");
|
||||
|
||||
if(!isset($userInfo['result']) || $userInfo['result'] == "false")
|
||||
die("userInfo request error");
|
||||
|
||||
if(trim(@$gridInfo['gridname']) == "")
|
||||
die("empty grid name");
|
||||
|
||||
//Add Grid
|
||||
$GridData = new OSGrid(@$gridInfo['gridname'], @$serviceURLS['SRV_HomeURI'], @$serviceURLS['SRV_AssetServerURI'], @$serviceURLS['SRV_IMServerURI']);
|
||||
|
||||
if(!isset($GridData))
|
||||
die("Unknown Error: Grid data not in db.");
|
||||
|
||||
//Add Region
|
||||
//$regionName, $regionUUID, $userUUID, $regionImage, $regionHostname, $regionPort
|
||||
$RegionData = $GridData->addRegion(@$regionData['region_name'], @$regionInfo['uuid'], @$_POST['object_owner'], @$_POST['region_image_asset'], @$regionData['hostname'], @$regionData['http_port']);
|
||||
|
||||
//Add User
|
||||
$UserData = $GridData->addUser(@$_POST['object_owner'], $userInfo['user_firstname']." ".$userInfo['user_lastname'], "");
|
||||
?>
|
Loading…
Reference in New Issue