also check if user is disabled

This commit is contained in:
Uwe Steinmann 2017-07-20 17:00:19 +02:00
parent 7259c668c4
commit 9e87300567

View File

@ -75,8 +75,10 @@ $tmprevs = $dms->getDocumentsInRevision();
$docsinrevision = array();
foreach($tmprevs as $rev) {
if($doc = $dms->getDocument($rev['documentID'])) {
$isdisabled = false;
if($rev['type'] == 0) {
$ruser = $dms->getUser($rev['required']);
$isdisabled = $ruser->isDisabled();
$mode = $doc->getAccessMode($ruser);
$content = $doc->getContentByVersion($rev['version']);
$cmode = $content->getAccessMode($ruser);
@ -88,7 +90,7 @@ foreach($tmprevs as $rev) {
/* Caution: $content->getAccessMode($ruser) doesn't work as it uses the role
* restrictions of the currently logged in user
*/
if($mode < M_READ || $cmode < M_READ)
if($mode < M_READ || $cmode < M_READ || $isdisabled)
$docsinrevision[] = $doc;
}
}
@ -96,8 +98,10 @@ $tmprevs = $dms->getDocumentsInReception();
$docsinreception = array();
foreach($tmprevs as $rev) {
if($doc = $dms->getDocument($rev['documentID'])) {
$isdisabled = false;
if($rev['type'] == 0) {
$ruser = $dms->getUser($rev['required']);
$isdisabled = $ruser->isDisabled();
$mode = $doc->getAccessMode($ruser);
$content = $doc->getContentByVersion($rev['version']);
$cmode = $content->getAccessMode($ruser);
@ -109,7 +113,7 @@ foreach($tmprevs as $rev) {
/* Caution: $content->getAccessMode($ruser) doesn't work as it uses the role
* restrictions of the currently logged in user
*/
if($mode < M_READ || $cmode < M_READ)
if($mode < M_READ || $cmode < M_READ || $isdisabled)
$docsinreception[] = $doc;
}
}