1
0
mirror of https://github.com/owncloud/bookmarks.git synced 2025-02-20 17:54:25 +01:00

add username to exported bookmark name

This commit is contained in:
Qingping Hou 2013-03-17 16:04:38 -04:00
parent 9f1f349d8a
commit 89ddfa014e

View File

@ -41,11 +41,13 @@ foreach($bookmarks as $bm) {
if($bm['description'])
$file .= '<DD>'.htmlspecialchars($bm['description'], ENT_QUOTES, 'UTF-8');
}
$export_name = "owncloud-bookmarks-".date('Y-m-d').'.html';
$user_name = trim(OCP\User::getDisplayName()) != '' ?
OCP\User::getDisplayName() : OCP\User::getUser();
$export_name = 'owncloud-bookmarks-'.$user_name.'-'.date('Y-m-d').'.html';
header("Cache-Control: private");
header("Content-Type: application/stream");
header("Content-Length: ".$fileSize);
header("Content-Disposition: attachment; filename=".$export_name);
echo $file;
exit;
exit;