diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2018-04-12 16:54:59 +0200 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2018-04-12 16:54:59 +0200 |
commit | 1b6f5e650fa774cda77d511bf4cbdc638a2b42f6 (patch) | |
tree | ec560104a579ac0e21de40d1666f3da80bc8862a /public/w | |
parent | 552dd49b00cedb168c95cdf841971e93b0ad678d (diff) | |
download | wcms-1b6f5e650fa774cda77d511bf4cbdc638a2b42f6.tar.gz wcms-1b6f5e650fa774cda77d511bf4cbdc638a2b42f6.zip |
delete_update_media_blank
Diffstat (limited to 'public/w')
-rw-r--r-- | public/w/index.php | 23 |
1 files changed, 20 insertions, 3 deletions
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 "<h4>Bienvenue sur ce site.</h4>"; $aff->home($app->lister()); } echo '</body>'; |