mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
create checkout dir if required and allowed in the settings
This commit is contained in:
parent
8b065cf7ac
commit
c0ba8a6711
|
@ -53,7 +53,15 @@ if ($document->isCheckedOut()) {
|
|||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("document_already_checkedout"));
|
||||
}
|
||||
|
||||
if (!$document->checkOut($user, sprintf($settings->_checkOutDir.'/', preg_replace('/[^A-Za-z0-9_-]/', '', $user->getLogin())))) {
|
||||
$checkoutpath = sprintf($settings->_checkOutDir.'/', preg_replace('/[^A-Za-z0-9_-]/', '', $user->getLogin()));
|
||||
if(!file_exists($checkoutpath) && $settings->_createCheckOutDir) {
|
||||
SeedDMS_Core_File::makeDir($checkoutpath);
|
||||
}
|
||||
if(!file_exists($checkoutpath)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("checkoutpath_does_not_exist"));
|
||||
}
|
||||
|
||||
if (!$document->checkOut($user, $checkoutpath)) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user