aboutsummaryrefslogtreecommitdiff
path: root/public/w
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2018-03-19 04:06:36 +0100
committervincent-peugnet <v.peugnet@free.fr>2018-03-19 04:06:36 +0100
commit1654358ea4e4c0a100d7e58b1001ece1f908b7b3 (patch)
treec7b5848e5cbe6ff45667751589b71819737f75c0 /public/w
parentff27ff7217e4ba984ba2f9557a4b7841e7adf61b (diff)
downloadwcms-1654358ea4e4c0a100d7e58b1001ece1f908b7b3.tar.gz
wcms-1654358ea4e4c0a100d7e58b1001ece1f908b7b3.zip
nouveau style
Diffstat (limited to 'public/w')
-rw-r--r--public/w/index.php45
1 files changed, 25 insertions, 20 deletions
diff --git a/public/w/index.php b/public/w/index.php
index 2dd33c0..f12e7f4 100644
--- a/public/w/index.php
+++ b/public/w/index.php
@@ -8,14 +8,19 @@
$config = require('../../config.php');
require('../../vendor/autoload.php');
use Michelf\Markdown;
+use Michelf\MarkdownExtra;
+
require('../../fn/fn.php');
require('../../class/class.art.php');
require('../../class/class.app.php');
require('../../class/class.aff.php');
session();
-$level = 0;
-$level = $_SESSION['level'];
+if (!isset($_SESSION['level'])) {
+ $level = 0;
+} else {
+ $level = $_SESSION['level'];
+}
$app = new App($config);
$aff = new Aff($level);
@@ -24,26 +29,26 @@ $aff = new Aff($level);
if (isset($_POST['action'])) {
switch ($_POST['action']) {
-
+
case 'update':
- if ($app->exist($_GET['id'])) {
- $art = new Art($_POST);
- $app->update($art);
- header('Location: ?id=' . $art->id() . '&edit=1');
- }
- break;
-
- case 'login' :
- $_SESSION['level'] = $app->login($_POST['pass']);
- header('Location: ?id=' . $_GET['id']);
- break;
-
- case 'logout' :
- $_SESSION['level'] = $app->logout();
- header('Location: ?id=' . $_GET['id']);
- break;
+ if ($app->exist($_GET['id'])) {
+ $art = new Art($_POST);
+ $app->update($art);
+ header('Location: ?id=' . $art->id() . '&edit=1');
+ }
+ break;
+
+ case 'login':
+ $_SESSION['level'] = $app->login($_POST['pass']);
+ header('Location: ?id=' . $_GET['id']);
+ break;
+
+ case 'logout':
+ $_SESSION['level'] = $app->logout();
+ header('Location: ?id=' . $_GET['id']);
+ break;
}
-
+
}