diff --git a/front/authorization.form.php b/front/authorization.form.php index 2d05e82..75796e9 100644 --- a/front/authorization.form.php +++ b/front/authorization.form.php @@ -27,12 +27,30 @@ include ('../../../inc/includes.php'); $authorization = new PluginOauthimapAuthorization(); +$application = new PluginOauthimapApplication(); if (isset($_POST['id']) && isset($_POST['delete'])) { $authorization->check($_POST['id'], DELETE); $authorization->delete($_POST); Html::back(); -} +} else if (isset($_POST['id']) && isset($_POST['update'])) { + $authorization->check($_POST['id'], UPDATE); + if ($authorization->update($_POST) + && $application->getFromDB($authorization->fields[$application->getForeignKeyField()])) { + Html::redirect($application->getLinkURL()); + } -Html::displayErrorAndDie('lost'); + Html::back(); +} else if (isset($_GET['id'])) { + $application = new PluginOauthimapApplication(); + $application->displayHeader(); + $authorization->display( + [ + 'id' => $_GET['id'], + ] + ); + Html::footer(); +} else { + Html::displayErrorAndDie('lost'); +} diff --git a/inc/authorization.class.php b/inc/authorization.class.php index 313ce21..b70a075 100644 --- a/inc/authorization.class.php +++ b/inc/authorization.class.php @@ -34,6 +34,9 @@ class PluginOauthimapAuthorization extends CommonDBChild { + // From CommonGlpi + protected $displaylist = false; + // From CommonDBTM public $dohistory = true; @@ -100,7 +103,7 @@ static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtem echo '