- use $dms->contentDir instead of $setting->_contentDir where ever possible

This commit is contained in:
steinm 2011-01-28 07:40:27 +00:00
parent 663ffba1c9
commit 28c09f0b97
2 changed files with 17 additions and 17 deletions

View File

@ -27,8 +27,7 @@ if ($user->isGuest()) {
UI::exitError(getMLText("my_account"),getMLText("access_denied")); 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); $folder->addNotify($userid, true);
if ($recursedoc){ 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["type"])) UI::exitError(getMLText("my_account"),getMLText("error_occured"));
if (!isset($_GET["action"])) 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["type"]=="document"){
if ($_GET["action"]=="add"){ if ($_GET["action"]=="add"){
@ -67,10 +68,10 @@ if ($_GET["type"]=="document"){
$documentid = $_GET["id"]; $documentid = $_GET["id"];
}else UI::exitError(getMLText("my_account"),getMLText("error_occured")); }else UI::exitError(getMLText("my_account"),getMLText("error_occured"));
$document = $dms->getDocument($documentid); if(!$documentid || !($document = $dms->getDocument($documentid))) {
UI::exitError(getMLText("my_account"),getMLText("error_no_document_selected"));
$userid=$user->getID(); }
if ($document->getAccessMode($user) < M_READ) if ($document->getAccessMode($user) < M_READ)
UI::exitError(getMLText("my_account"),getMLText("error_occured")); UI::exitError(getMLText("my_account"),getMLText("error_occured"));
@ -78,7 +79,7 @@ if ($_GET["type"]=="document"){
if ($_GET["action"]=="add") $document->addNotify($userid, true); if ($_GET["action"]=="add") $document->addNotify($userid, true);
else if ($_GET["action"]=="del") $document->removeNotify($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 ($_GET["action"]=="add"){
if (!isset($_POST["targetidform1"])) UI::exitError(getMLText("my_account"),getMLText("error_occured")); if (!isset($_POST["targetidform1"])) UI::exitError(getMLText("my_account"),getMLText("error_occured"));
@ -88,10 +89,10 @@ if ($_GET["type"]=="document"){
$folderid = $_GET["id"]; $folderid = $_GET["id"];
}else UI::exitError(getMLText("my_account"),getMLText("error_occured")); }else UI::exitError(getMLText("my_account"),getMLText("error_occured"));
$folder = $dms->getFolder($folderid); if(!$folderid || !($folder = $dms->getFolder($folderid))) {
UI::exitError(getMLText("my_account"),getMLText("error_no_folder_selected"));
$userid=$user->getID(); }
if ($folder->getAccessMode($user) < M_READ) if ($folder->getAccessMode($user) < M_READ)
UI::exitError(getMLText("my_account"),getMLText("error_occured")); UI::exitError(getMLText("my_account"),getMLText("error_occured"));
@ -131,8 +132,8 @@ if ($_GET["type"]=="document"){
} }
} }
} }
} }
header("Location:../out/out.ManageNotify.php"); header("Location:../out/out.ManageNotify.php");
?> ?>

View File

@ -2,6 +2,7 @@
// MyDMS. Document Management System // MyDMS. Document Management System
// Copyright (C) 2002-2005 Markus Westphal // Copyright (C) 2002-2005 Markus Westphal
// Copyright (C) 2006-2008 Malcolm Cowe // Copyright (C) 2006-2008 Malcolm Cowe
// Copyright (C) 2011 Uwe Steinmann
// //
// This program is free software; you can redistribute it and/or modify // 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 // 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-Type: " . $content->getMimeType());
} }
header("Content-Disposition: filename=\"" . mydmsDecodeString( $document->getName().$content->getFileType()) . "\""); 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("Expires: 0");
header("Cache-Control: no-cache, must-revalidate"); header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache"); header("Pragma: no-cache");
readfile($settings->_contentDir . $content->getPath()); readfile($dms->contentDir . $content->getPath());
add_log_line(); add_log_line();
exit; exit;
?> ?>