mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-11 16:35:38 +00:00
- use $dms->contentDir instead of $setting->_contentDir where ever possible
This commit is contained in:
parent
663ffba1c9
commit
28c09f0b97
|
@ -27,8 +27,7 @@ if ($user->isGuest()) {
|
|||
UI::exitError(getMLText("my_account"),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
function add_folder_notify($folder,$userid,$recursefolder,$recursedoc)
|
||||
{
|
||||
function add_folder_notify($folder,$userid,$recursefolder,$recursedoc) {
|
||||
$folder->addNotify($userid, true);
|
||||
|
||||
if ($recursedoc){
|
||||
|
@ -57,6 +56,8 @@ function add_folder_notify($folder,$userid,$recursefolder,$recursedoc)
|
|||
if (!isset($_GET["type"])) UI::exitError(getMLText("my_account"),getMLText("error_occured"));
|
||||
if (!isset($_GET["action"])) UI::exitError(getMLText("my_account"),getMLText("error_occured"));
|
||||
|
||||
$userid=$user->getID();
|
||||
|
||||
if ($_GET["type"]=="document"){
|
||||
|
||||
if ($_GET["action"]=="add"){
|
||||
|
@ -67,10 +68,10 @@ if ($_GET["type"]=="document"){
|
|||
$documentid = $_GET["id"];
|
||||
|
||||
}else UI::exitError(getMLText("my_account"),getMLText("error_occured"));
|
||||
|
||||
$document = $dms->getDocument($documentid);
|
||||
|
||||
$userid=$user->getID();
|
||||
|
||||
if(!$documentid || !($document = $dms->getDocument($documentid))) {
|
||||
UI::exitError(getMLText("my_account"),getMLText("error_no_document_selected"));
|
||||
}
|
||||
|
||||
if ($document->getAccessMode($user) < M_READ)
|
||||
UI::exitError(getMLText("my_account"),getMLText("error_occured"));
|
||||
|
@ -78,7 +79,7 @@ if ($_GET["type"]=="document"){
|
|||
if ($_GET["action"]=="add") $document->addNotify($userid, true);
|
||||
else if ($_GET["action"]=="del") $document->removeNotify($userid, true);
|
||||
|
||||
}else if ($_GET["type"]=="folder"){
|
||||
} else if ($_GET["type"]=="folder") {
|
||||
|
||||
if ($_GET["action"]=="add"){
|
||||
if (!isset($_POST["targetidform1"])) UI::exitError(getMLText("my_account"),getMLText("error_occured"));
|
||||
|
@ -88,10 +89,10 @@ if ($_GET["type"]=="document"){
|
|||
$folderid = $_GET["id"];
|
||||
|
||||
}else UI::exitError(getMLText("my_account"),getMLText("error_occured"));
|
||||
|
||||
$folder = $dms->getFolder($folderid);
|
||||
|
||||
$userid=$user->getID();
|
||||
|
||||
if(!$folderid || !($folder = $dms->getFolder($folderid))) {
|
||||
UI::exitError(getMLText("my_account"),getMLText("error_no_folder_selected"));
|
||||
}
|
||||
|
||||
if ($folder->getAccessMode($user) < M_READ)
|
||||
UI::exitError(getMLText("my_account"),getMLText("error_occured"));
|
||||
|
@ -131,8 +132,8 @@ if ($_GET["type"]=="document"){
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
header("Location:../out/out.ManageNotify.php");
|
||||
|
||||
?>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// MyDMS. Document Management System
|
||||
// Copyright (C) 2002-2005 Markus Westphal
|
||||
// Copyright (C) 2006-2008 Malcolm Cowe
|
||||
// Copyright (C) 2011 Uwe Steinmann
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
|
@ -55,15 +56,13 @@ if (isset($settings->_viewOnlineFileTypes) && is_array($settings->_viewOnlineFil
|
|||
header("Content-Type: " . $content->getMimeType());
|
||||
}
|
||||
header("Content-Disposition: filename=\"" . mydmsDecodeString( $document->getName().$content->getFileType()) . "\"");
|
||||
header("Content-Length: " . filesize($settings->_contentDir . $content->getPath()));
|
||||
header("Content-Length: " . filesize($dms->contentDir . $content->getPath()));
|
||||
header("Expires: 0");
|
||||
header("Cache-Control: no-cache, must-revalidate");
|
||||
header("Pragma: no-cache");
|
||||
|
||||
readfile($settings->_contentDir . $content->getPath());
|
||||
readfile($dms->contentDir . $content->getPath());
|
||||
|
||||
add_log_line();
|
||||
|
||||
|
||||
exit;
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue
Block a user