aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/ajax/getmailtemplate.php
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2014-02-21 10:01:02 +0100
committerJörn Friedrich Dreyer <jfd@butonic.de>2014-06-02 19:22:58 +0200
commit37afab87b56fa7b2a1b0e751df72e9624663f94f (patch)
tree11252d05738f7d7ee4bdad333ee762a8a63dfad6 /apps/files_sharing/ajax/getmailtemplate.php
parentc88c0b9a13231478c626296d78aac7c1f66d87d9 (diff)
downloadnextcloud-server-37afab87b56fa7b2a1b0e751df72e9624663f94f.tar.gz
nextcloud-server-37afab87b56fa7b2a1b0e751df72e9624663f94f.zip
minimal mail template editor for administrators, refs #7177
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