<?php
require_once('nusoap/nusoap.php');
$action = $_GET[action];
$apiurl = "PLEASE CONTACT ME, TO REQUEST YOUR PERSONAL LOGIN-URL";
$client = new nusoap_client($apiurl);
////////////////////////////////////////////////////////////////////////////////////////////
// German: Software installieren
// English: install software
////////////////////////////////////////////////////////////////////////////////////////////
if ($action == "INSTALLSOFTWARE" AND is_numeric($_GET[pid])) {
$result = $client->call( 'installer.api_install',
array( 'string' => array( "auth" => array("key" => $apikey),
"package" => $_GET[pid],
"postvars" => $_POST))
);
// check if fault
// return installid / ticketid
if ($client->fault) {
echo $result["1"];
}
////////////////////////////////////////////////////////////////////////////////////////////
// German: Formular einlesen und in Datenbank schreiben
// English: get form of software
////////////////////////////////////////////////////////////////////////////////////////////
} elseif ($action == "GETFORMULAR" AND is_numeric($_GET[sid])) {
$result = $client->call( 'installer.api_getformular',
array( 'string' => array( "auth" => array("key" => $apikey),
"package" => $_GET[sid]))
);
// check if fault
// return form
if ($client->fault) {
echo $result["1"];
}
////////////////////////////////////////////////////////////////////////////////////////////
// German: Lizenz einlesen und in Datenbank schreiben
// English: get licence of software
////////////////////////////////////////////////////////////////////////////////////////////
} elseif ($action == "GETLICENCE" AND is_numeric($_GET[sid])) {
$result = $client->call( 'installer.api_getlicence',
array( 'string' => array( "auth" => array("key" => $apikey),
"package" => $_GET[sid]))
);
// check if fault
// return licence
if ($client->fault) {
echo $result["1"];
}
////////////////////////////////////////////////////////////////////////////////////////////
// German: Softwareliste einlesen und in Datenbank schreiben
// English: get softwarelist with additional licence and form
////////////////////////////////////////////////////////////////////////////////////////////
} elseif ($action == "GETSOFTWARELIST") {
$result = $client->call( 'installer.api_getsoftwarelist',
array( 'string' => array( "auth" => array("key" => $apikey)))
);
// Durchlaufe Gruppen
foreach($result["1"]["item"] as $group){
// Durchlaufe Software-Einträge
foreach($group["software"] as $item){
$sidformular = $client->call( 'installer.api_getformular',
array( 'string' => array( "auth" => array("key" => $apikey),
"package" => $item[id]))
);
$sidlicence = $client->call( 'installer.api_getlicence',
array( 'string' => array( "auth" => array("key" => $apikey),
"package" => $item[id]))
);
echo "<b>" . $item[name] . "</b> have SoftwareID " . $item[id] . "<br>";
echo "Script use SQL: " . $item[sql] . "<br>";
echo "Script is on GruptID: " . $group[groupid] . "<br>";
echo "<i>" . $sidlicence[1] . "</i><br>";
echo "<br><hl><br>";
}
}
////////////////////////////////////////////////////////////////////////////////////////////
// German: Gruppenliste einlesen und in Datenbank schreiben
// English: get softwaregroups
////////////////////////////////////////////////////////////////////////////////////////////
} elseif ($action == "GETGROUPLIST") {
$result = $client->call( 'installer.api_getinstalllog',
array( 'string' => array( "auth" => array("key" => $apikey)))
);
foreach($result["1"]["item"] as $group){
echo "Group ID: " . $group[id] . "<br>";
echo "Group Name:" . $group[name]. "<br>";
echo "<br><hl><br>";
}
////////////////////////////////////////////////////////////////////////////////////////////
// German: Log-Liste eines Installations-Ticket
// English: get full log of install
////////////////////////////////////////////////////////////////////////////////////////////
} elseif ($action == "INSTALLLOG" AND is_numeric($_GET[id])) {
$result = $client->call( 'installer.api_getinstalllog',
array( 'string' => array( "auth" => array("key" => $apikey),
"ticket" => $_GET[id]))
);
if ($client->fault) {
echo $result["1"]["item"];
}
}
?>