. * */ require_once 'lib/impress.php'; // Check if we are a user OCP\User::checkLoggedIn(); OCP\JSON::checkAppEnabled('impress'); $filename = OCP\Util::sanitizeHTML($_GET['file']); $title = OCP\Util::sanitizeHTML($_GET['name']); if(!\OC\Files\Filesystem::file_exists($filename)) { header("HTTP/1.0 404 Not Found"); $tmpl = new OCP\Template( '', '404', 'guest' ); $tmpl->assign('file', $filename); $tmpl->printPage(); exit; } $data=\OC\Files\Filesystem::file_get_contents( $filename ); if((stripos($data,'false) or (stripos($data,'false) or (stripos($data,'false)) { echo('
This is not a valid impress file. Please check the documentation.
'); exit; } if(stripos($data,'false) { echo('
Please don\'t use javascript in impress files.
'); exit; } header('Content-Type: text/html', true); OCP\Response::disableCaching(); @ob_end_clean(); \OCA_Impress\Storage::showHeader($title); \OC\Files\Filesystem::readfile( $filename ); \OCA_Impress\Storage::showFooter();