diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-01-20 18:15:46 +0100 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-01-20 18:15:46 +0100 |
commit | 44b4a0b20e798756826d7e3175e453b439e758dc (patch) | |
tree | 50e13f2b902f572979ec002fbd821d99fa01d2e2 /src/frontend_blog/essay_fulfillment.php | |
parent | 09b3cfee78cebd84cfec64ce28cd5d39be0a12d2 (diff) |
Adding most of blog-type website.
Diffstat (limited to 'src/frontend_blog/essay_fulfillment.php')
-rw-r--r-- | src/frontend_blog/essay_fulfillment.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/frontend_blog/essay_fulfillment.php b/src/frontend_blog/essay_fulfillment.php new file mode 100644 index 00000000..df2f8cfa --- /dev/null +++ b/src/frontend_blog/essay_fulfillment.php @@ -0,0 +1,20 @@ +<?php + +session_start(); + +if (!isset($_GET['article'])){ + http_response_code(400); + echo "No article specified"; + die(); +} +$article = $_GET['article']; +/* check if the client is allowed to get the wanted article */ +if(!isset($_SESSION['allowed_articles'][$article])){ + http_response_code(401); // unauthorized + echo "Not allowed to read this article"; + die(); +} +// get the article +$article_doc = get_article($article); +echo $article_doc->saveHTML(); +?> |