do not use internal variables of LetoDMS_Core_xxx classes

This commit is contained in:
steinm 2013-01-24 10:12:15 +00:00
parent c7ee6d9b4a
commit 8432ce207b
18 changed files with 443 additions and 421 deletions

View File

@ -72,7 +72,7 @@ if (is_bool($res) && !$res) {
$document->getNotifyList();
// Send notification to subscribers.
if($notifier) {
$subject = "###SITENAME###: ".$document->_name." - ".getMLText("new_file_email");
$subject = "###SITENAME###: ".$document->getName()." - ".getMLText("new_file_email");
$message = getMLText("new_file_email")."\r\n";
$message .=
getMLText("name").": ".$name."\r\n".

View File

@ -80,7 +80,7 @@ if( move_uploaded_file( $source_file_path, $target_file_path ) ) {
$document->getNotifyList();
// Send notification to subscribers.
if($notifier) {
$subject = "###SITENAME###: ".$document->_name." - ".getMLText("new_file_email");
$subject = "###SITENAME###: ".$document->getName()." - ".getMLText("new_file_email");
$message = getMLText("new_file_email")."\r\n";
$message .=
getMLText("name").": ".$name."\r\n".

View File

@ -195,7 +195,7 @@ if( move_uploaded_file( $source_file_path, $target_file_path ) ) {
// Send notification to subscribers.
if($notifier) {
$folder->getNotifyList();
$subject = "###SITENAME###: ".$folder->_name." - ".getMLText("new_document_email");
$subject = "###SITENAME###: ".$folder->getName()." - ".getMLText("new_document_email");
$message = getMLText("new_document_email")."\r\n";
$message .=
getMLText("name").": ".$name."\r\n".

View File

@ -1,61 +1,61 @@
<?php
// MyDMS. Document Management System
// Copyright (C) 2002-2005 Markus Westphal
// Copyright (C) 2006-2008 Malcolm Cowe
// Copyright (C) 2010 Matteo Lucarelli
//
// 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
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include("../inc/inc.Settings.php");
include("../inc/inc.LogInit.php");
include("../inc/inc.Utils.php");
<?php
// MyDMS. Document Management System
// Copyright (C) 2002-2005 Markus Westphal
// Copyright (C) 2006-2008 Malcolm Cowe
// Copyright (C) 2010 Matteo Lucarelli
//
// 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
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include("../inc/inc.Settings.php");
include("../inc/inc.LogInit.php");
include("../inc/inc.Utils.php");
include("../inc/inc.DBInit.php");
include("../inc/inc.Language.php");
include("../inc/inc.ClassUI.php");
include("../inc/inc.ClassEmail.php");
include("../inc/inc.Authentication.php");
include("../inc/inc.Language.php");
include("../inc/inc.ClassUI.php");
include("../inc/inc.ClassEmail.php");
include("../inc/inc.Authentication.php");
/* Check if the form data comes for a trusted request */
if(!checkFormKey('addsubfolder')) {
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_request_token"))),getMLText("invalid_request_token"));
}
if (!isset($_POST["folderid"]) || !is_numeric($_POST["folderid"]) || intval($_POST["folderid"])<1) {
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
}
$folderid = $_POST["folderid"];
if (!isset($_POST["folderid"]) || !is_numeric($_POST["folderid"]) || intval($_POST["folderid"])<1) {
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
}
$folderid = $_POST["folderid"];
$folder = $dms->getFolder($folderid);
if (!is_object($folder)) {
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
}
$folderPathHTML = getFolderPathHTML($folder, true);
if (!is_object($folder)) {
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
}
$folderPathHTML = getFolderPathHTML($folder, true);
if ($folder->getAccessMode($user) < M_READWRITE) {
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("access_denied"));
}
}
$sequence = $_POST["sequence"];
if (!is_numeric($sequence)) {
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("invalid_sequence"));
}
$name = $_POST["name"];
$comment = $_POST["comment"];
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("invalid_sequence"));
}
$name = $_POST["name"];
$comment = $_POST["comment"];
$attributes = $_POST["attributes"];
$subFolder = $folder->addSubFolder($name, $comment, $user, $sequence, $attributes);
@ -63,7 +63,7 @@ if (is_object($subFolder)) {
// Send notification to subscribers.
if($notifier) {
$folder->getNotifyList();
$subject = "###SITENAME###: ".$folder->_name." - ".getMLText("new_subfolder_email");
$subject = "###SITENAME###: ".$folder->getName()." - ".getMLText("new_subfolder_email");
$message = getMLText("new_subfolder_email")."\r\n";
$message .=
getMLText("name").": ".$name."\r\n".
@ -82,11 +82,11 @@ if (is_object($subFolder)) {
}
} else {
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("error_occured"));
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("error_occured"));
}
add_log_line("?name=".$name."&folderid=".$folderid);
add_log_line("?name=".$name."&folderid=".$folderid);
header("Location:../out/out.ViewFolder.php?folderid=".$folderid."&showtree=".$_POST["showtree"]);
?>
?>

View File

@ -155,10 +155,10 @@ if ($_POST["approvalStatus"]==-1){
// Send notification to subscribers.
if($notifier) {
$folder = $document->getFolder();
$subject = "###SITENAME###: ".$document->_name." - ".getMLText("document_status_changed_email");
$subject = "###SITENAME###: ".$document->getName()." - ".getMLText("document_status_changed_email");
$message = getMLText("document_status_changed_email")."\r\n";
$message .=
getMLText("document").": ".$document->_name."\r\n".
getMLText("document").": ".$document->getName()."\r\n".
getMLText("status").": ".getOverallStatusText($status)."\r\n".
getMLText("folder").": ".$folder->getFolderPathPlain()."\r\n".
getMLText("comment").": ".$document->getComment()."\r\n".
@ -202,10 +202,10 @@ if ($_POST["approvalStatus"]==-1){
// Send notification to subscribers.
if($notifier) {
$folder = $document->getFolder();
$subject = "###SITENAME###: ".$document->_name." - ".getMLText("document_status_changed_email");
$subject = "###SITENAME###: ".$document->getName()." - ".getMLText("document_status_changed_email");
$message = getMLText("document_status_changed_email")."\r\n";
$message .=
getMLText("document").": ".$document->_name."\r\n".
getMLText("document").": ".$document->getName()."\r\n".
getMLText("status").": ".getOverallStatusText($newStatus)."\r\n".
getMLText("folder").": ".$folder->getFolderPathPlain()."\r\n".
getMLText("comment").": ".$document->getComment()."\r\n".

View File

@ -1,141 +1,141 @@
<?php
// MyDMS. Document Management System
// Copyright (C) 2002-2005 Markus Westphal
// Copyright (C) 2006-2008 Malcolm Cowe
//
// 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
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include("../inc/inc.Settings.php");
include("../inc/inc.LogInit.php");
include("../inc/inc.Utils.php");
<?php
// MyDMS. Document Management System
// Copyright (C) 2002-2005 Markus Westphal
// Copyright (C) 2006-2008 Malcolm Cowe
//
// 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
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include("../inc/inc.Settings.php");
include("../inc/inc.LogInit.php");
include("../inc/inc.Utils.php");
include("../inc/inc.DBInit.php");
include("../inc/inc.Language.php");
include("../inc/inc.ClassUI.php");
include("../inc/inc.ClassEmail.php");
include("../inc/inc.Authentication.php");
if (!isset($_GET["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
$documentid = $_GET["documentid"];
include("../inc/inc.Language.php");
include("../inc/inc.ClassUI.php");
include("../inc/inc.ClassEmail.php");
include("../inc/inc.Authentication.php");
if (!isset($_GET["documentid"]) || !is_numeric($_GET["documentid"]) || intval($_GET["documentid"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
$documentid = $_GET["documentid"];
$document = $dms->getDocument($documentid);
if (!is_object($document)) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
$folder = $document->getFolder();
$docPathHTML = getFolderPathHTML($folder, true). " / <a href=\"../out/out.ViewDocument.php?documentid=".$documentid."\">".$document->getName()."</a>";
if (!is_object($document)) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
$folder = $document->getFolder();
$docPathHTML = getFolderPathHTML($folder, true). " / <a href=\"../out/out.ViewDocument.php?documentid=".$documentid."\">".$document->getName()."</a>";
if ($document->getAccessMode($user) < M_ALL) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
}
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
}
/* Check if the form data comes for a trusted request */
/* FIXME: Currently GET request are allowed. */
if(!checkFormKey('documentaccess', 'GET')) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_request_token"));
}
switch ($_GET["action"]) {
case "setowner":
case "delaccess":
case "inherit":
$action = $_GET["action"];
break;
case "setdefault":
case "editaccess":
case "addaccess":
$action = $_GET["action"];
switch ($_GET["action"]) {
case "setowner":
case "delaccess":
case "inherit":
$action = $_GET["action"];
break;
case "setdefault":
case "editaccess":
case "addaccess":
$action = $_GET["action"];
if (!isset($_GET["mode"]) || !is_numeric($_GET["mode"]) || $_GET["mode"]<M_ANY || $_GET["mode"]>M_ALL) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_access_mode"));
}
$mode = $_GET["mode"];
break;
case "notinherit":
$action = $_GET["action"];
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_access_mode"));
}
$mode = $_GET["mode"];
break;
case "notinherit":
$action = $_GET["action"];
if (strcasecmp($_GET["mode"], "copy") && strcasecmp($_GET["mode"], "empty")) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_access_mode"));
}
$mode = $_GET["mode"];
break;
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_access_mode"));
}
$mode = $_GET["mode"];
break;
default:
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_action"));
break;
}
if (isset($_GET["userid"])) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_action"));
break;
}
if (isset($_GET["userid"])) {
if (!is_numeric($_GET["userid"])) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("unknown_user"));
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("unknown_user"));
}
if (!strcasecmp($action, "addaccess") && $_GET["userid"]==-1) {
$userid = -1;
}
else {
if (!is_object($dms->getUser($_GET["userid"]))) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("unknown_user"));
}
$userid = $_GET["userid"];
}
}
if (isset($_GET["groupid"])) {
if (!strcasecmp($action, "addaccess") && $_GET["userid"]==-1) {
$userid = -1;
}
else {
if (!is_object($dms->getUser($_GET["userid"]))) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("unknown_user"));
}
$userid = $_GET["userid"];
}
}
if (isset($_GET["groupid"])) {
if (!is_numeric($_GET["groupid"])) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("unknown_group"));
}
if (!strcasecmp($action, "addaccess") && $_GET["groupid"]==-1) {
$groupid = -1;
}
else {
if (!is_object($dms->getGroup($_GET["groupid"]))) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("unknown_group"));
}
$groupid = $_GET["groupid"];
}
}
//Ändern des Besitzers ----------------------------------------------------------------------------
if ($action == "setowner") {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("unknown_group"));
}
if (!strcasecmp($action, "addaccess") && $_GET["groupid"]==-1) {
$groupid = -1;
}
else {
if (!is_object($dms->getGroup($_GET["groupid"]))) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("unknown_group"));
}
$groupid = $_GET["groupid"];
}
}
//Ändern des Besitzers ----------------------------------------------------------------------------
if ($action == "setowner") {
if (!$user->isAdmin()) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
}
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
}
if (!isset($_GET["ownerid"]) || !is_numeric($_GET["ownerid"]) || $_GET["ownerid"]<1) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("unknown_user"));
}
$newOwner = $dms->getUser($_GET["ownerid"]);
if (!is_object($newOwner)) {
if (!is_object($newOwner)) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("unknown_user"));
}
}
$oldOwner = $document->getOwner();
if($document->setOwner($newOwner)) {
$document->getNotifyList();
// Send notification to subscribers.
if($notifier) {
$folder = $document->getFolder();
$subject = "###SITENAME###: ".$document->_name." - ".getMLText("ownership_changed_email");
$subject = "###SITENAME###: ".$document->getName()." - ".getMLText("ownership_changed_email");
$message = getMLText("ownership_changed_email")."\r\n";
$message .=
getMLText("document").": ".$document->_name."\r\n".
getMLText("document").": ".$document->getName()."\r\n".
getMLText("old").": ".$oldOwner->getFullName()."\r\n".
getMLText("new").": ".$newOwner->getFullName()."\r\n".
getMLText("folder").": ".$folder->getFolderPathPlain()."\r\n".
getMLText("comment").": ".$document->_comment."\r\n".
"URL: ###URL_PREFIX###out/out.ViewDocument.php?documentid=".$document->_id."\r\n";
getMLText("comment").": ".$document->getComment()."\r\n".
"URL: ###URL_PREFIX###out/out.ViewDocument.php?documentid=".$document->getID()."\r\n";
// $subject=mydmsDecodeString($subject);
// $message=mydmsDecodeString($message);
@ -150,21 +150,21 @@ if ($action == "setowner") {
}
}
//Änderung auf nicht erben ------------------------------------------------------------------------
else if ($action == "notinherit") {
$defAccess = $document->getDefaultAccess();
//Änderung auf nicht erben ------------------------------------------------------------------------
else if ($action == "notinherit") {
$defAccess = $document->getDefaultAccess();
if($document->setInheritAccess(false)) {
$document->getNotifyList();
if($notifier) {
$folder = $document->getFolder();
// Send notification to subscribers.
$subject = "###SITENAME###: ".$document->_name." - ".getMLText("access_permission_changed_email");
$subject = "###SITENAME###: ".$document->getName()." - ".getMLText("access_permission_changed_email");
$message = getMLText("access_permission_changed_email")."\r\n";
$message .=
getMLText("document").": ".$document->_name."\r\n".
getMLText("document").": ".$document->getName()."\r\n".
getMLText("folder").": ".$folder->getFolderPathPlain()."\r\n".
"URL: ###URL_PREFIX###out/out.ViewDocument.php?documentid=".$document->_id."\r\n";
"URL: ###URL_PREFIX###out/out.ViewDocument.php?documentid=".$document->getID()."\r\n";
// $subject=mydmsDecodeString($subject);
// $message=mydmsDecodeString($message);
@ -180,12 +180,12 @@ else if ($action == "notinherit") {
if($notifier) {
$folder = $document->getFolder();
// Send notification to subscribers.
$subject = "###SITENAME###: ".$document->_name." - ".getMLText("access_permission_changed_email");
$subject = "###SITENAME###: ".$document->getName()." - ".getMLText("access_permission_changed_email");
$message = getMLText("access_permission_changed_email")."\r\n";
$message .=
getMLText("document").": ".$document->_name."\r\n".
getMLText("document").": ".$document->getName()."\r\n".
getMLText("folder").": ".$folder->getFolderPathPlain()."\r\n".
"URL: ###URL_PREFIX###out/out.ViewDocument.php?documentid=".$document->_id."\r\n";
"URL: ###URL_PREFIX###out/out.ViewDocument.php?documentid=".$document->getID()."\r\n";
// $subject=mydmsDecodeString($subject);
// $message=mydmsDecodeString($message);
@ -196,36 +196,36 @@ else if ($action == "notinherit") {
}
}
}
//copy ACL of parent folder
if ($mode == "copy") {
$accessList = $folder->getAccessList();
foreach ($accessList["users"] as $userAccess)
$document->addAccess($userAccess->getMode(), $userAccess->getUserID(), true);
foreach ($accessList["groups"] as $groupAccess)
$document->addAccess($groupAccess->getMode(), $groupAccess->getGroupID(), false);
}
}
//Änderung auf erben ------------------------------------------------------------------------------
else if ($action == "inherit") {
$document->clearAccessList();
$document->setInheritAccess(true);
}
//Standardberechtigung setzen----------------------------------------------------------------------
else if ($action == "setdefault") {
//copy ACL of parent folder
if ($mode == "copy") {
$accessList = $folder->getAccessList();
foreach ($accessList["users"] as $userAccess)
$document->addAccess($userAccess->getMode(), $userAccess->getUserID(), true);
foreach ($accessList["groups"] as $groupAccess)
$document->addAccess($groupAccess->getMode(), $groupAccess->getGroupID(), false);
}
}
//Änderung auf erben ------------------------------------------------------------------------------
else if ($action == "inherit") {
$document->clearAccessList();
$document->setInheritAccess(true);
}
//Standardberechtigung setzen----------------------------------------------------------------------
else if ($action == "setdefault") {
if($document->setDefaultAccess($mode)) {
$document->getNotifyList();
if($notifier) {
$folder = $document->getFolder();
// Send notification to subscribers.
$subject = "###SITENAME###: ".$document->_name." - ".getMLText("access_permission_changed_email");
$subject = "###SITENAME###: ".$document->getName()." - ".getMLText("access_permission_changed_email");
$message = getMLText("access_permission_changed_email")."\r\n";
$message .=
getMLText("document").": ".$document->_name."\r\n".
getMLText("document").": ".$document->getName()."\r\n".
getMLText("folder").": ".$folder->getFolderPathPlain()."\r\n".
"URL: ###URL_PREFIX###out/out.ViewDocument.php?documentid=".$document->_id."\r\n";
"URL: ###URL_PREFIX###out/out.ViewDocument.php?documentid=".$document->getID()."\r\n";
// $subject=mydmsDecodeString($subject);
// $message=mydmsDecodeString($message);
@ -236,40 +236,40 @@ else if ($action == "setdefault") {
}
}
}
}
// Bestehende Berechtigung ändern --------------------------------------------
else if ($action == "editaccess") {
if (isset($userid)) {
$document->changeAccess($mode, $userid, true);
}
else if (isset($groupid)) {
$document->changeAccess($mode, $groupid, false);
}
}
//Berechtigung löschen ----------------------------------------------------------------------------
else if ($action == "delaccess") {
if (isset($userid)) {
$document->removeAccess($userid, true);
}
else if (isset($groupid)) {
$document->removeAccess($groupid, false);
}
}
//Neue Berechtigung hinzufügen --------------------------------------------------------------------
else if ($action == "addaccess") {
if (isset($userid) && $userid != -1) {
$document->addAccess($mode, $userid, true);
}
if (isset($groupid) && $groupid != -1) {
$document->addAccess($mode, $groupid, false);
}
}
add_log_line("");
// Bestehende Berechtigung ändern --------------------------------------------
else if ($action == "editaccess") {
if (isset($userid)) {
$document->changeAccess($mode, $userid, true);
}
else if (isset($groupid)) {
$document->changeAccess($mode, $groupid, false);
}
}
header("Location:../out/out.DocumentAccess.php?documentid=".$documentid);
?>
//Berechtigung löschen ----------------------------------------------------------------------------
else if ($action == "delaccess") {
if (isset($userid)) {
$document->removeAccess($userid, true);
}
else if (isset($groupid)) {
$document->removeAccess($groupid, false);
}
}
//Neue Berechtigung hinzufügen --------------------------------------------------------------------
else if ($action == "addaccess") {
if (isset($userid) && $userid != -1) {
$document->addAccess($mode, $userid, true);
}
if (isset($groupid) && $groupid != -1) {
$document->addAccess($mode, $groupid, false);
}
}
add_log_line("");
header("Location:../out/out.DocumentAccess.php?documentid=".$documentid);
?>

View File

@ -111,7 +111,7 @@ if ($action == "delnotify"){
getMLText("document").": ".$document->getName()."\r\n".
getMLText("folder").": ".$path."\r\n".
getMLText("comment").": ".$document->getComment()."\r\n".
"URL: ###URL_PREFIX###out/out.ViewDocument.php?documentid=".$document->_id."\r\n";
"URL: ###URL_PREFIX###out/out.ViewDocument.php?documentid=".$document->getID()."\r\n";
// $subject=mydmsDecodeString($subject);
// $message=mydmsDecodeString($message);
@ -165,7 +165,7 @@ else if ($action == "addnotify") {
getMLText("document").": ".$document->getName()."\r\n".
getMLText("folder").": ".$path."\r\n".
getMLText("comment").": ".$document->getComment()."\r\n".
"URL: ###URL_PREFIX###out/out.ViewDocument.php?documentid=".$document->_id."\r\n";
"URL: ###URL_PREFIX###out/out.ViewDocument.php?documentid=".$document->getID()."\r\n";
// $subject=mydmsDecodeString($subject);
// $message=mydmsDecodeString($message);
@ -208,7 +208,7 @@ else if ($action == "addnotify") {
getMLText("document").": ".$document->getName()."\r\n".
getMLText("folder").": ".$path."\r\n".
getMLText("comment").": ".$document->getComment()."\r\n".
"URL: ###URL_PREFIX###out/out.ViewDocument.php?documentid=".$document->_id."\r\n";
"URL: ###URL_PREFIX###out/out.ViewDocument.php?documentid=".$document->getID()."\r\n";
// $subject=mydmsDecodeString($subject);
// $message=mydmsDecodeString($message);

View File

@ -64,14 +64,14 @@ if(($oldname = $folder->getName()) != $name) {
// Send notification to subscribers.
if($notifier) {
$folder->getNotifyList();
$subject = "###SITENAME###: ".$folder->_name." - ".getMLText("folder_renamed_email");
$subject = "###SITENAME###: ".$folder->getName()." - ".getMLText("folder_renamed_email");
$message = getMLText("folder_renamed_email")."\r\n";
$message .=
getMLText("old").": ".$oldname."\r\n".
getMLText("new").": ".$folder->_name."\r\n".
getMLText("new").": ".$folder->getName()."\r\n".
getMLText("folder").": ".$folder->getFolderPathPlain()."\r\n".
getMLText("comment").": ".$comment."\r\n".
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->_id."\r\n";
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->getID()."\r\n";
// $subject=mydmsDecodeString($subject);
// $message=mydmsDecodeString($message);
@ -90,13 +90,13 @@ if(($oldcomment = $folder->getComment()) != $comment) {
// Send notification to subscribers.
if($notifier) {
$folder->getNotifyList();
$subject = "###SITENAME###: ".$folder->_name." - ".getMLText("comment_changed_email");
$subject = "###SITENAME###: ".$folder->getName()." - ".getMLText("comment_changed_email");
$message = getMLText("comment_changed_email")."\r\n";
$message .=
getMLText("name").": ".$folder->_name."\r\n".
getMLText("name").": ".$folder->getName()."\r\n".
getMLText("folder").": ".$folder->getFolderPathPlain()."\r\n".
getMLText("comment").": ".$comment."\r\n".
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->_id."\r\n";
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->getID()."\r\n";
// $subject=mydmsDecodeString($subject);
// $message=mydmsDecodeString($message);

View File

@ -124,15 +124,15 @@ if ($action == "setowner") {
if($notifier) {
// Send notification to subscribers.
$folder->getNotifyList();
$subject = "###SITENAME###: ".$folder->_name." - ".getMLText("ownership_changed_email");
$subject = "###SITENAME###: ".$folder->getName()." - ".getMLText("ownership_changed_email");
$message = getMLText("ownership_changed_email")."\r\n";
$message .=
getMLText("name").": ".$folder->_name."\r\n".
getMLText("name").": ".$folder->getName()."\r\n".
getMLText("old").": ".$oldOwner->getFullName()."\r\n".
getMLText("new").": ".$newOwner->getFullName()."\r\n".
getMLText("folder").": ".$folder->getFolderPathPlain()."\r\n".
getMLText("comment").": ".$folder->_comment."\r\n".
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->_id."\r\n";
getMLText("comment").": ".$folder->getComment()."\r\n".
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->getID()."\r\n";
// $subject=mydmsDecodeString($subject);
// $message=mydmsDecodeString($message);
@ -155,12 +155,12 @@ else if ($action == "notinherit") {
if($notifier) {
// Send notification to subscribers.
$folder->getNotifyList();
$subject = "###SITENAME###: ".$folder->_name." - ".getMLText("access_permission_changed_email");
$subject = "###SITENAME###: ".$folder->getName()." - ".getMLText("access_permission_changed_email");
$message = getMLText("access_permission_changed_email")."\r\n";
$message .=
getMLText("name").": ".$folder->_name."\r\n".
getMLText("name").": ".$folder->getName()."\r\n".
getMLText("folder").": ".$folder->getFolderPathPlain()."\r\n".
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->_id."\r\n";
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->getID()."\r\n";
// $subject=mydmsDecodeString($subject);
// $message=mydmsDecodeString($message);
@ -175,12 +175,12 @@ else if ($action == "notinherit") {
if($notifier) {
// Send notification to subscribers.
$folder->getNotifyList();
$subject = "###SITENAME###: ".$folder->_name." - ".getMLText("access_permission_changed_email");
$subject = "###SITENAME###: ".$folder->getName()." - ".getMLText("access_permission_changed_email");
$message = getMLText("access_permission_changed_email")."\r\n";
$message .=
getMLText("name").": ".$folder->_name."\r\n".
getMLText("name").": ".$folder->getName()."\r\n".
getMLText("folder").": ".$folder->getFolderPathPlain()."\r\n".
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->_id."\r\n";
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->getID()."\r\n";
// $subject=mydmsDecodeString($subject);
// $message=mydmsDecodeString($message);
@ -211,12 +211,12 @@ else if ($action == "inherit") {
if($notifier) {
// Send notification to subscribers.
$folder->getNotifyList();
$subject = "###SITENAME###: ".$folder->_name." - ".getMLText("access_permission_changed_email");
$subject = "###SITENAME###: ".$folder->getName()." - ".getMLText("access_permission_changed_email");
$message = getMLText("access_permission_changed_email")."\r\n";
$message .=
getMLText("name").": ".$folder->_name."\r\n".
getMLText("name").": ".$folder->getName()."\r\n".
getMLText("folder").": ".$folder->getFolderPathPlain()."\r\n".
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->_id."\r\n";
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->getID()."\r\n";
// $subject=mydmsDecodeString($subject);
// $message=mydmsDecodeString($message);
@ -235,12 +235,12 @@ else if ($action == "setdefault") {
if($notifier) {
// Send notification to subscribers.
$folder->getNotifyList();
$subject = "###SITENAME###: ".$folder->_name." - ".getMLText("access_permission_changed_email");
$subject = "###SITENAME###: ".$folder->getName()." - ".getMLText("access_permission_changed_email");
$message = getMLText("access_permission_changed_email")."\r\n";
$message .=
getMLText("name").": ".$folder->_name."\r\n".
getMLText("name").": ".$folder->getName()."\r\n".
getMLText("folder").": ".$folder->getFolderPathPlain()."\r\n".
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->_id."\r\n";
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->getID()."\r\n";
// $subject=mydmsDecodeString($subject);
// $message=mydmsDecodeString($message);

View File

@ -67,7 +67,7 @@ if ($folder->getAccessMode($user) < M_READ) {
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("access_denied"));
}
//Benachrichtigung löschen ------------------------------------------------------------------------
// Delete notification -------------------------------------------------------
if ($action == "delnotify") {
if ($userid > 0) {
@ -108,7 +108,7 @@ if ($action == "delnotify") {
getMLText("name").": ".$folder->getName()."\r\n".
getMLText("folder").": ".$path."\r\n".
getMLText("comment").": ".$folder->getComment()."\r\n".
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->_id."\r\n";
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->getID()."\r\n";
// $subject=mydmsDecodeString($subject);
// $message=mydmsDecodeString($message);
@ -124,7 +124,7 @@ if ($action == "delnotify") {
}
}
//Benachrichtigung hinzufügen ---------------------------------------------------------------------
//Benachrichtigung hinzufügen ---------------------------------------------------------------------
else if ($action == "addnotify") {
if ($userid != -1) {
@ -159,7 +159,7 @@ else if ($action == "addnotify") {
getMLText("name").": ".$folder->getName()."\r\n".
getMLText("folder").": ".$path."\r\n".
getMLText("comment").": ".$folder->getComment()."\r\n".
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->_id."\r\n";
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->getID()."\r\n";
// $subject=mydmsDecodeString($subject);
// $message=mydmsDecodeString($message);
@ -202,7 +202,7 @@ else if ($action == "addnotify") {
getMLText("name").": ".$folder->getName()."\r\n".
getMLText("folder").": ".$path."\r\n".
getMLText("comment").": ".$folder->getComment()."\r\n".
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->_id."\r\n";
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->getID()."\r\n";
// $subject=mydmsDecodeString($subject);
// $message=mydmsDecodeString($message);

View File

@ -125,7 +125,7 @@ if ($_GET["type"]=="document"){
getMLText("name").": ".$folder->getName()."\r\n".
getMLText("folder").": ".$path."\r\n".
getMLText("comment").": ".$folder->getComment()."\r\n".
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->_id."\r\n";
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->getID()."\r\n";
// $subject=mydmsDecodeString($subject);
// $message=mydmsDecodeString($message);

View File

@ -58,10 +58,10 @@ if ($targetid != $oldFolder->getID()) {
$document->getNotifyList();
// Send notification to subscribers.
if($notifier) {
$subject = "###SITENAME###: ".$document->_name." - ".getMLText("document_moved_email");
$subject = "###SITENAME###: ".$document->getName()." - ".getMLText("document_moved_email");
$message = getMLText("document_moved_email")."\r\n";
$message .=
getMLText("document").": ".$document->_name."\r\n".
getMLText("document").": ".$document->getName()."\r\n".
getMLText("folder").": ".$oldFolder->getFolderPathPlain()."\r\n".
getMLText("new_folder").": ".$targetFolder->getFolderPathPlain()."\r\n".
"URL: ###URL_PREFIX###out/out.ViewDocument.php?documentid=".$document->getID()."\r\n";

View File

@ -58,13 +58,13 @@ if ($folder->setParent($targetFolder)) {
// Send notification to subscribers.
if($notifier) {
$folder->getNotifyList();
$subject = "###SITENAME###: ".$folder->_name." - ".getMLText("folder_moved_email");
$subject = "###SITENAME###: ".$folder->getName()." - ".getMLText("folder_moved_email");
$message = getMLText("folder_moved_email")."\r\n";
$message .=
getMLText("name").": ".$folder->_name."\r\n".
getMLText("name").": ".$folder->getName()."\r\n".
getMLText("folder").": ".$folder->getFolderPathPlain()."\r\n".
getMLText("comment").": ".$folder->_comment."\r\n".
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->_id."\r\n";
getMLText("comment").": ".$folder->getComment()."\r\n".
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->getID()."\r\n";
// $subject=mydmsDecodeString($subject);
// $message=mydmsDecodeString($message);

View File

@ -76,10 +76,10 @@ if ($overrideStatus != $overallStatus["status"]) {
// Send notification to subscribers.
if($notifier) {
$folder = $document->getFolder();
$subject = "###SITENAME###: ".$document->_name." - ".getMLText("document_status_changed_email");
$subject = "###SITENAME###: ".$document->getName()." - ".getMLText("document_status_changed_email");
$message = getMLText("document_status_changed_email")."\r\n";
$message .=
getMLText("document").": ".$document->_name."\r\n".
getMLText("document").": ".$document->getName()."\r\n".
getMLText("status").": ".getOverallStatusText($overrideStatus)."\r\n".
getMLText("folder").": ".$folder->getFolderPathPlain()."\r\n".
getMLText("comment").": ".$document->getComment()."\r\n".

View File

@ -1,66 +1,88 @@
<?php
// MyDMS. Document Management System
// Copyright (C) 2002-2005 Markus Westphal
// Copyright (C) 2006-2008 Malcolm Cowe
//
// 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
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include("../inc/inc.Settings.php");
include("../inc/inc.LogInit.php");
include("../inc/inc.ClassEmail.php");
<?php
// MyDMS. Document Management System
// Copyright (C) 2002-2005 Markus Westphal
// Copyright (C) 2006-2008 Malcolm Cowe
//
// 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
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include("../inc/inc.Settings.php");
include("../inc/inc.LogInit.php");
include("../inc/inc.ClassEmail.php");
include("../inc/inc.DBInit.php");
include("../inc/inc.Language.php");
include("../inc/inc.ClassUI.php");
include("../inc/inc.Authentication.php");
include("../inc/inc.Language.php");
include("../inc/inc.ClassUI.php");
include("../inc/inc.Authentication.php");
/* Check if the form data comes for a trusted request */
if(!checkFormKey('removefolder')) {
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_request_token"))),getMLText("invalid_request_token"));
}
if (!isset($_POST["folderid"]) || !is_numeric($_POST["folderid"]) || intval($_POST["folderid"])<1) {
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
}
$folderid = $_POST["folderid"];
if (!isset($_POST["folderid"]) || !is_numeric($_POST["folderid"]) || intval($_POST["folderid"])<1) {
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
}
$folderid = $_POST["folderid"];
$folder = $dms->getFolder($folderid);
if (!is_object($folder)) {
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
}
if (!is_object($folder)) {
UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id"));
}
if ($folderid == $settings->_rootFolderID || !$folder->getParent()) {
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("cannot_rm_root"));
}
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("cannot_rm_root"));
}
if ($folder->getAccessMode($user) < M_ALL) {
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("access_denied"));
}
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("access_denied"));
}
$parent=$folder->getParent();
/* Register a callback which removes each document from the fulltext index
* The callback must return true other the removal will be canceled.
*/
if($settings->_enableFullSearch) {
if(!empty($settings->_luceneClassDir))
require_once($settings->_luceneClassDir.'/Lucene.php');
else
require_once('LetoDMS/Lucene.php');
$index = LetoDMS_Lucene_Indexer::open($settings->_luceneDir);
function removeFromIndex($index, $document) {
if($hits = $index->find('document_id:'.$document->getId())) {
$hit = $hits[0];
echo $hit->id;
$index->delete($hit->id);
$index->commit();
}
return true;
}
$dms->setCallback('onPreRemoveDocument', 'removeFromIndex', $index);
}
if ($folder->remove()) {
// Send notification to subscribers.
if ($notifier) {
$folder->getNotifyList();
$subject = "###SITENAME###: ".$folder->_name." - ".getMLText("folder_deleted_email");
$subject = "###SITENAME###: ".$folder->getName()." - ".getMLText("folder_deleted_email");
$message = getMLText("folder_deleted_email")."\r\n";
$message .=
getMLText("name").": ".$folder->_name."\r\n".
getMLText("name").": ".$folder->getName()."\r\n".
getMLText("folder").": ".$folder->getFolderPathPlain()."\r\n".
getMLText("comment").": ".$folder->_comment."\r\n".
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->_id."\r\n";
getMLText("comment").": ".$folder->getComment()."\r\n".
"URL: ###URL_PREFIX###out/out.ViewFolder.php?folderid=".$folder->getID()."\r\n";
$notifier->toList($user, $folder->_notifyList["users"], $subject, $message);
foreach ($folder->_notifyList["groups"] as $grp) {
@ -68,11 +90,11 @@ if ($folder->remove()) {
}
}
} else {
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("error_occured"));
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("error_occured"));
}
add_log_line();
header("Location:../out/out.ViewFolder.php?folderid=".$parent->getID()."&showtree=".$_POST["showtree"]);
?>
header("Location:../out/out.ViewFolder.php?folderid=".$parent->getID()."&showtree=".$_POST["showtree"]);
?>

View File

@ -1,67 +1,67 @@
<?php
// MyDMS. Document Management System
// Copyright (C) 2002-2005 Markus Westphal
// Copyright (C) 2006-2008 Malcolm Cowe
//
// 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
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include("../inc/inc.Settings.php");
include("../inc/inc.LogInit.php");
include("../inc/inc.ClassEmail.php");
<?php
// MyDMS. Document Management System
// Copyright (C) 2002-2005 Markus Westphal
// Copyright (C) 2006-2008 Malcolm Cowe
//
// 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
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include("../inc/inc.Settings.php");
include("../inc/inc.LogInit.php");
include("../inc/inc.ClassEmail.php");
include("../inc/inc.DBInit.php");
include("../inc/inc.Language.php");
include("../inc/inc.ClassUI.php");
include("../inc/inc.Authentication.php");
include("../inc/inc.Language.php");
include("../inc/inc.ClassUI.php");
include("../inc/inc.Authentication.php");
/* Check if the form data comes for a trusted request */
if(!checkFormKey('removeversion')) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_request_token"))),getMLText("invalid_request_token"));
}
if (!isset($_POST["documentid"]) || !is_numeric($_POST["documentid"]) || intval($_POST["documentid"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
$documentid = $_POST["documentid"];
if (!isset($_POST["documentid"]) || !is_numeric($_POST["documentid"]) || intval($_POST["documentid"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
$documentid = $_POST["documentid"];
$document = $dms->getDocument($documentid);
if (!is_object($document)) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
if (!is_object($document)) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
if (!$settings->_enableVersionDeletion && !$user->isAdmin()) {
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
}
if ($document->getAccessMode($user) < M_ALL) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
}
if (!isset($_POST["version"]) || !is_numeric($_POST["version"]) || intval($_POST["version"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
if ($document->getAccessMode($user) < M_ALL) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
}
$version_num = $_POST["version"];
if (!isset($_POST["version"]) || !is_numeric($_POST["version"]) || intval($_POST["version"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
}
$version_num = $_POST["version"];
$version = $document->getContentByVersion($version_num);
if (!is_object($version)) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
}
if (count($document->getContent())==1) {
if (!is_object($version)) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
}
if (count($document->getContent())==1) {
if (!$document->remove()) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
} else {
$document->getNotifyList();
if ($notifier){
@ -112,8 +112,8 @@ else {
}
}
if (!$document->removeContent($version)) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
if (!$document->removeContent($version)) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
} else {
// Notify affected users.
if ($notifier){
@ -147,7 +147,7 @@ else {
}
add_log_line("?documentid=".$documentid."&version".$version_num);
header("Location:../out/out.ViewDocument.php?documentid=".$documentid);
?>
?>

View File

@ -154,10 +154,10 @@ if ($_POST["reviewStatus"]==-1){
// Send notification to subscribers.
if($notifier) {
$folder = $document->getFolder();
$subject = "###SITENAME###: ".$document->_name." - ".getMLText("document_status_changed_email");
$subject = "###SITENAME###: ".$document->getName()." - ".getMLText("document_status_changed_email");
$message = getMLText("document_status_changed_email")."\r\n";
$message .=
getMLText("document").": ".$document->_name."\r\n".
getMLText("document").": ".$document->getName()."\r\n".
getMLText("status").": ".getOverallStatusText(S_REJECTED)."\r\n".
getMLText("folder").": ".$folder->getFolderPathPlain()."\r\n".
getMLText("comment").": ".$document->getComment()."\r\n".
@ -222,10 +222,10 @@ if ($_POST["reviewStatus"]==-1){
$nl=$document->getNotifyList();
if($notifier) {
$folder = $document->getFolder();
$subject = "###SITENAME###: ".$document->_name." - ".getMLText("document_status_changed_email");
$subject = "###SITENAME###: ".$document->getName()." - ".getMLText("document_status_changed_email");
$message = getMLText("document_status_changed_email")."\r\n";
$message .=
getMLText("document").": ".$document->_name."\r\n".
getMLText("document").": ".$document->getName()."\r\n".
getMLText("status").": ".getOverallStatusText($newStatus)."\r\n".
getMLText("folder").": ".$folder->getFolderPathPlain()."\r\n".
getMLText("comment").": ".$document->getComment()."\r\n".

View File

@ -1,48 +1,48 @@
<?php
// MyDMS. Document Management System
// Copyright (C) 2002-2005 Markus Westphal
// Copyright (C) 2006-2008 Malcolm Cowe
// Copyright (C) 2010 Matteo Lucarelli
//
// 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
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include("../inc/inc.Settings.php");
include("../inc/inc.LogInit.php");
<?php
// MyDMS. Document Management System
// Copyright (C) 2002-2005 Markus Westphal
// Copyright (C) 2006-2008 Malcolm Cowe
// Copyright (C) 2010 Matteo Lucarelli
//
// 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
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
include("../inc/inc.Settings.php");
include("../inc/inc.LogInit.php");
include("../inc/inc.DBInit.php");
include("../inc/inc.Language.php");
include("../inc/inc.ClassUI.php");
include("../inc/inc.ClassEmail.php");
include("../inc/inc.Authentication.php");
if (!isset($_POST["documentid"]) || !is_numeric($_POST["documentid"]) || intval($_POST["documentid"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
include("../inc/inc.Language.php");
include("../inc/inc.ClassUI.php");
include("../inc/inc.ClassEmail.php");
include("../inc/inc.Authentication.php");
if (!isset($_POST["documentid"]) || !is_numeric($_POST["documentid"]) || intval($_POST["documentid"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
$documentid = $_POST["documentid"];
$documentid = $_POST["documentid"];
$document = $dms->getDocument($documentid);
if (!is_object($document)) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
if ($document->getAccessMode($user) < M_READWRITE) {
if (!is_object($document)) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
if ($document->getAccessMode($user) < M_READWRITE) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
}
}
$expires = false;
if ($_POST["expires"] != "false") {
if (!isset($_POST["expires"]) || $_POST["expires"] != "false") {
if($_POST["expdate"]) {
$tmp = explode('-', $_POST["expdate"]);
$expires = mktime(0,0,0, $tmp[1], $tmp[0], $tmp[2]);
@ -58,6 +58,6 @@ $document->verifyLastestContentExpriry();
add_log_line("?documentid=".$documentid);
header("Location:../out/out.ViewDocument.php?documentid=".$documentid);
?>
header("Location:../out/out.ViewDocument.php?documentid=".$documentid);
?>