From 1b6f5e650fa774cda77d511bf4cbdc638a2b42f6 Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Thu, 12 Apr 2018 16:54:59 +0200 Subject: delete_update_media_blank --- public/w/index.php | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'public/w') diff --git a/public/w/index.php b/public/w/index.php index 93d9f46..0a153b0 100644 --- a/public/w/index.php +++ b/public/w/index.php @@ -38,15 +38,33 @@ if (isset($_POST['action'])) { } break; + case 'delete': + if ($app->exist($_GET['id'])) { + $art = new Art($_POST); + $app->delete($art); + header('Location: ?id=' . $art->id()); + } + break; + + case 'login': $_SESSION['level'] = $app->login($_POST['pass']); - header('Location: ?id=' . $_GET['id']); + if (isset($_GET['id'])) { + header('Location: ?id=' . $_GET['id']); + } else { + header('Location: ?'); + } break; case 'logout': $_SESSION['level'] = $app->logout(); - header('Location: ?id=' . $_GET['id']); + if (isset($_GET['id'])) { + header('Location: ?id=' . $_GET['id']); + } else { + header('Location: ?'); + } break; + } } @@ -111,7 +129,6 @@ if (isset($_GET['id'])) { $aff->tag($app->getlister(), $_GET['tag']); } else { - echo "

Bienvenue sur ce site.

"; $aff->home($app->lister()); } echo ''; -- cgit v1.2.3