aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/ajax/getmailtemplate.php
blob: 8caf0ebcec81272f16743bce58d194630c4c1a6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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