示例#1
0
You should have received a copy of the GNU General Public License
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include "../inc/includes.php";
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
$client = new APIClient();
if (isset($_POST["add"])) {
    $client->check(-1, CREATE, $_POST);
    $client->add($_POST);
    Html::back();
} else {
    if (isset($_POST["update"])) {
        $client->check($_POST["id"], UPDATE);
        $client->update($_POST);
        Html::back();
    } else {
        if (isset($_POST["purge"])) {
            $client->check($_POST["id"], PURGE);
            $client->delete($_POST);
            Html::redirect($CFG_GLPI["root_doc"] . "/front/config.form.php");
        } else {
            Html::header(APIClient::getTypeName(1), $_SERVER['PHP_SELF'], "config", "config", "apiclient");
            $client->display(array('id' => $_GET["id"]));
            Html::footer();