aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/ajax/getmailtemplate.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/ajax/getmailtemplate.php')
-rw-r--r--apps/files_sharing/ajax/getmailtemplate.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/apps/files_sharing/ajax/getmailtemplate.php b/apps/files_sharing/ajax/getmailtemplate.php
new file mode 100644
index 00000000000..8caf0ebcec8
--- /dev/null
+++ b/apps/files_sharing/ajax/getmailtemplate.php
@@ -0,0 +1,21 @@
+<?php
+
+OC_JSON::checkAdminUser();
+OCP\JSON::callCheck();
+
+if(!\OCP\App::isEnabled('files_sharing')){
+ \OC_Response::setStatus(410); // GONE
+}
+
+// Get data
+if ( isset( $_GET['theme'] ) && isset( $_GET['template'] ) ) {
+
+ $template = new \OCA\Files_Sharing\MailTemplate( $_GET['theme'], $_GET['template'] );
+ try {
+ $template->renderContent();
+ } catch (\OCP\Files\NotPermittedException $ex) {
+ \OC_Response::setStatus(403); // forbidden
+ }
+ exit();
+}
+\OC_Response::setStatus(404); // not found