|
|
|
@ -57,4 +57,15 @@ switch ($VARS['action']) {
|
|
|
|
|
}
|
|
|
|
|
$note->deleteNote();
|
|
|
|
|
returnToSender("note_deleted");
|
|
|
|
|
case "downloadnote":
|
|
|
|
|
if (empty($VARS['noteid'])) {
|
|
|
|
|
die($Strings->get("invalid parameters", false));
|
|
|
|
|
}
|
|
|
|
|
$note = Note::loadNote($VARS['noteid']);
|
|
|
|
|
if (!$note->hasReadAccess(new User($_SESSION['uid']))) {
|
|
|
|
|
die($Strings->get("invalid parameters", false));
|
|
|
|
|
}
|
|
|
|
|
header("Content-Type: text/markdown; charset=UTF-8");
|
|
|
|
|
header("Content-disposition: attachment; filename=\"" . $note->getCleanTitle() . "_" . $note->getModified() . ".md\"");
|
|
|
|
|
echo $note->getText();
|
|
|
|
|
}
|