mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 09:35:00 +00:00
use the checkout space of the logged in user not the substituted user
This commit is contained in:
parent
eee4e2f0eb
commit
f7b2d5b6d6
|
@ -53,7 +53,12 @@ if ($document->isCheckedOut()) {
|
|||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("document_already_checkedout"));
|
||||
}
|
||||
|
||||
$checkoutpath = sprintf($settings->_checkOutDir.'/', preg_replace('/[^A-Za-z0-9_-]/', '', $user->getLogin()));
|
||||
if($session->getSu()) {
|
||||
$origuser = $dms->getUser($session->getUser());
|
||||
$checkoutpath = sprintf($settings->_checkOutDir.'/', preg_replace('/[^A-Za-z0-9_-]/', '', $origuser->getLogin()));
|
||||
} else {
|
||||
$checkoutpath = sprintf($settings->_checkOutDir.'/', preg_replace('/[^A-Za-z0-9_-]/', '', $user->getLogin()));
|
||||
}
|
||||
if(!file_exists($checkoutpath) && $settings->_createCheckOutDir) {
|
||||
SeedDMS_Core_File::makeDir($checkoutpath);
|
||||
}
|
||||
|
|
|
@ -232,8 +232,14 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
$this->contentHeading(getMLText("document_infos"));
|
||||
if($info = $document->getCheckOutInfo()) {
|
||||
echo "<div class=\"alert alert-info\">";
|
||||
$checkoutpath = sprintf($checkoutdir, preg_replace('/[^A-Za-z0-9_-]/', '', $user->getLogin()));
|
||||
echo "<a href=\"file://".$info['filename']."\">".getMLText('copied_to_checkout_as', array('filename'=>substr($info['filename'], strlen($checkoutpath)+1)))."</a>";
|
||||
$session = $this->params['session'];
|
||||
if($session->getSu()) {
|
||||
$origuser = $dms->getUser($session->getUser());
|
||||
$checkoutpath = sprintf($checkoutdir, preg_replace('/[^A-Za-z0-9_-]/', '', $origuser->getLogin()));
|
||||
} else {
|
||||
$checkoutpath = sprintf($checkoutdir, preg_replace('/[^A-Za-z0-9_-]/', '', $user->getLogin()));
|
||||
}
|
||||
echo "<a href=\"file://".$info['filename']."\">".getMLText('copied_to_checkout_as', array('date'=>$info['date'], 'filename'=>substr($info['filename'], strlen($checkoutpath)+1)))."</a>";
|
||||
echo "</div>";
|
||||
}
|
||||
$this->contentContainerStart();
|
||||
|
|
Loading…
Reference in New Issue
Block a user