- check if expiritation is set before doing any action

This commit is contained in:
steinm 2012-07-06 10:57:22 +00:00
parent d9f83a155d
commit acaaac7b69

View File

@ -168,29 +168,31 @@ if (is_uploaded_file($_FILES["userfile"]["tmp_name"]) && $_FILES["userfile"]["si
$expires = ($_POST["expires"] == "true") ? mktime(0,0,0, $_POST["expmonth"], $_POST["expday"], $_POST["expyear"]) : false; $expires = ($_POST["expires"] == "true") ? mktime(0,0,0, $_POST["expmonth"], $_POST["expday"], $_POST["expyear"]) : false;
if ($document->setExpires($expires)) { if ($expires) {
$document->getNotifyList(); if($document->setExpires($expires)) {
if($notifier) { $document->getNotifyList();
$folder = $document->getFolder(); if($notifier) {
// Send notification to subscribers. $folder = $document->getFolder();
$subject = "###SITENAME###: ".$document->_name." - ".getMLText("expiry_changed_email"); // Send notification to subscribers.
$message = getMLText("expiry_changed_email")."\r\n"; $subject = "###SITENAME###: ".$document->_name." - ".getMLText("expiry_changed_email");
$message .= $message = getMLText("expiry_changed_email")."\r\n";
getMLText("document").": ".$document->_name."\r\n". $message .=
getMLText("folder").": ".$folder->getFolderPathPlain()."\r\n". getMLText("document").": ".$document->_name."\r\n".
getMLText("comment").": ".$document->getComment()."\r\n". getMLText("folder").": ".$folder->getFolderPathPlain()."\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->_id."\r\n";
// $subject=mydmsDecodeString($subject); // $subject=mydmsDecodeString($subject);
// $message=mydmsDecodeString($message); // $message=mydmsDecodeString($message);
$notifier->toList($user, $document->_notifyList["users"], $subject, $message); $notifier->toList($user, $document->_notifyList["users"], $subject, $message);
foreach ($document->_notifyList["groups"] as $grp) { foreach ($document->_notifyList["groups"] as $grp) {
$notifier->toGroup($user, $grp, $subject, $message); $notifier->toGroup($user, $grp, $subject, $message);
}
} }
} else {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
} }
} else {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
} }
} }
} }