aboutsummaryrefslogtreecommitdiff
path: root/src/frontend_blog/essay_fulfillment.php
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2016-01-20 18:15:46 +0100
committerMarcello Stanisci <marcello.stanisci@inria.fr>2016-01-20 18:15:46 +0100
commit44b4a0b20e798756826d7e3175e453b439e758dc (patch)
tree50e13f2b902f572979ec002fbd821d99fa01d2e2 /src/frontend_blog/essay_fulfillment.php
parent09b3cfee78cebd84cfec64ce28cd5d39be0a12d2 (diff)
Adding most of blog-type website.
Diffstat (limited to 'src/frontend_blog/essay_fulfillment.php')
-rw-r--r--src/frontend_blog/essay_fulfillment.php20
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();
+?>