except remember user, changed all cookies to sessions.
This commit is contained in:
+3
-3
@@ -21,7 +21,7 @@ if (isset($_POST['form_id'])) {
|
||||
update_article($_POST['article_id'], $_POST['title'], $_POST['excerpt'], $tags, $_POST['markdown']);
|
||||
header('Location: articles.php?article_id=' . $_POST['article_id']);
|
||||
} else {
|
||||
$id = create_article($_COOKIE['user_id'], $_POST['title'], $_POST['excerpt'], (isset($_POST['tags']) ? $_POST['tags'] : []), $_POST['markdown']);
|
||||
$id = create_article($_SESSION['user_id'], $_POST['title'], $_POST['excerpt'], (isset($_POST['tags']) ? $_POST['tags'] : []), $_POST['markdown']);
|
||||
header('Location: articles.php?article_id=' . $id);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ if (isset($_POST['form_id'])) {
|
||||
echo article_list(article_ids_by_newest());
|
||||
break;
|
||||
case 'read':
|
||||
if (isset($_COOKIE['user_id']) && isset($_GET['article_id'])) {
|
||||
if (isset($_SESSION['user_id']) && isset($_GET['article_id'])) {
|
||||
increment_read_counter($_GET['article_id']);
|
||||
echo article_page_from_markdown($_GET['article_id']);
|
||||
} else {
|
||||
@@ -67,7 +67,7 @@ if (isset($_POST['form_id'])) {
|
||||
}
|
||||
}
|
||||
|
||||
if (($view == 'list' || $view == 'sort') && (isset($_COOKIE['role_id']) && $_COOKIE['role_id'] <= 3)) {
|
||||
if (($view == 'list' || $view == 'sort') && (isset($_SESSION['role_id']) && $_SESSION['role_id'] <= 3)) {
|
||||
echo '
|
||||
<div id="floating_compose">
|
||||
<a href="articles.php?view=compose"><i class="nf nf-md-note_plus"></i></a>
|
||||
|
||||
Reference in New Issue
Block a user