@@ -116,6 +116,7 @@ public function setWatchOnFolder($node, $userId, $watchType, $targetUsers = arra
116
116
* @param AJXP_Node $node
117
117
* @param $userId
118
118
* @param bool $clearUsers
119
+ * @param bool $targetUserId
119
120
*/
120
121
public function removeWatchFromFolder ($ node , $ userId , $ clearUsers = false , $ targetUserId = false )
121
122
{
@@ -181,6 +182,7 @@ public function removeWatchFromFolder($node, $userId, $clearUsers = false, $targ
181
182
* @param AJXP_Node $node
182
183
* @param $userId
183
184
* @param string $ns Watch namespace
185
+ * @param array $result
184
186
* @return string|bool the type of watch
185
187
*/
186
188
public function hasWatchOnNode ($ node , $ userId , $ ns = "META_WATCH " , &$ result = array ())
@@ -320,9 +322,22 @@ private function loadWatchesFromMeta($watchType, $currentUserId, $node, $watchMe
320
322
continue ;
321
323
}
322
324
if (!AuthService::userExists ($ id )) {
323
- $ changes = true ;
324
- unset($ watchMeta [$ id ]);
325
325
unset($ IDS [$ index ]);
326
+ if (is_array ($ watchMeta )){
327
+ $ changes = true ;
328
+ $ watchMeta [$ id ] = AJXP_VALUE_CLEAR ;
329
+ }
330
+ }else {
331
+ // Make sure the user is still authorized on this node, otherwise remove it.
332
+ $ uObject = ConfService::getConfStorageImpl ()->createUserObject ($ id );
333
+ $ acl = $ uObject ->mergedRole ->getAcl ($ node ->getRepositoryId ());
334
+ if (empty ($ acl ) || strpos ($ acl , "r " ) === FALSE ){
335
+ unset($ IDS [$ index ]);
336
+ if (is_array ($ watchMeta )){
337
+ $ changes = true ;
338
+ $ watchMeta [$ id ] = AJXP_VALUE_CLEAR ;
339
+ }
340
+ }
326
341
}
327
342
}
328
343
if ($ changes ) {
0 commit comments