aboutsummaryrefslogtreecommitdiff
path: root/src/frontend_blog/essay_fulfillment.php
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-01-21 11:40:51 +0100
committerFlorian Dold <florian.dold@gmail.com>2016-01-21 11:40:51 +0100
commit96622672cd6e3eb71c21b993215d645c1f58aa6e (patch)
tree657fd63b475bae20921641c0142bbbe7fe9d2c23 /src/frontend_blog/essay_fulfillment.php
parent6d59885dfd02b1fff292bdd9075ce38461f128b9 (diff)
parent1e936a747b2c3380332f0b3dda410261fb97a2b0 (diff)
downloadmerchant-96622672cd6e3eb71c21b993215d645c1f58aa6e.tar.gz
merchant-96622672cd6e3eb71c21b993215d645c1f58aa6e.tar.bz2
merchant-96622672cd6e3eb71c21b993215d645c1f58aa6e.zip
Merge branch 'master' of ssh://taler.net/var/git/merchant
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();
+?>