Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 73d2d05

Browse files
committed
Error when removing user from share if the workspace does not have meta.watch.
1 parent 2c6b444 commit 73d2d05

File tree

1 file changed

+7
-94
lines changed

1 file changed

+7
-94
lines changed

core/src/plugins/action.share/class.ShareCenter.php

Lines changed: 7 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,95 +1468,6 @@ public function computeSharedRepositoryAccessRights($repoId, $mixUsersAndGroups,
14681468
return array_merge(array_values($sharedGroups), array_values($sharedEntries));
14691469

14701470
}
1471-
1472-
/*
1473-
$users = AuthService::getUsersForRepository($repoId);
1474-
//var_dump($roles);
1475-
$baseGroup = "/";
1476-
$groups = AuthService::listChildrenGroups($baseGroup);
1477-
$mess = ConfService::getMessages();
1478-
$groups[$baseGroup] = $mess["447"];
1479-
$sharedEntries = array();
1480-
if (!$mixUsersAndGroups) {
1481-
$sharedGroups = array();
1482-
}
1483-
1484-
foreach ($groups as $gId => $gLabel) {
1485-
$r = AuthService::getRole("AJXP_GRP_".AuthService::filterBaseGroup($gId));
1486-
if ($r != null) {
1487-
$right = $r->getAcl($repoId);
1488-
if (!empty($right)) {
1489-
$entry = array(
1490-
"ID" => "AJXP_GRP_".AuthService::filterBaseGroup($gId),
1491-
"TYPE" => "group",
1492-
"LABEL" => $gLabel,
1493-
"RIGHT" => $right);
1494-
if (!$mixUsersAndGroups) {
1495-
$sharedGroups[$gId] = $entry;
1496-
} else {
1497-
$sharedEntries[] = $entry;
1498-
}
1499-
}
1500-
}
1501-
}
1502-
1503-
foreach ($roles as $rId){
1504-
if(strpos($rId, "AJXP_GRP_") === 0 || strpos($rId, "AJXP_USR_") === 0) continue;
1505-
$role = AuthService::getRole($rId);
1506-
if ($role != null) {
1507-
$right = $role->getAcl($repoId);
1508-
if (!empty($right)) {
1509-
$label = $role->getLabel();
1510-
if(empty($label)) $label = $rId;
1511-
$entry = array(
1512-
"ID" => $rId,
1513-
"TYPE" => "group",
1514-
"LABEL" => $label,
1515-
"RIGHT" => $right);
1516-
if (!$mixUsersAndGroups) {
1517-
$sharedGroups[$rId] = $entry;
1518-
} else {
1519-
$sharedEntries[] = $entry;
1520-
}
1521-
}
1522-
}
1523-
}
1524-
1525-
foreach ($users as $userId => $userObject) {
1526-
if($userObject->getId() == $loggedUser->getId() && !$loggedUser->isAdmin()) {
1527-
continue;
1528-
}
1529-
$ri = $userObject->personalRole->getAcl($repoId);
1530-
$uLabel = $userObject->personalRole->filterParameterValue("core.conf", "USER_DISPLAY_NAME", AJXP_REPO_SCOPE_ALL, "");
1531-
if(empty($uLabel)) $uLabel = $userId;
1532-
if (!empty($ri)) {
1533-
$entry = array(
1534-
"ID" => $userId,
1535-
"TYPE" => $userObject->hasParent()?"tmp_user":"user",
1536-
"LABEL" => $uLabel,
1537-
"RIGHT" => $userObject->personalRole->getAcl($repoId)
1538-
);
1539-
if ($this->watcher !== false && $currentFileUrl != null) {
1540-
$entry["WATCH"] = $this->watcher->hasWatchOnNode(
1541-
new AJXP_Node($currentFileUrl),
1542-
$userId,
1543-
MetaWatchRegister::$META_WATCH_USERS_NAMESPACE
1544-
);
1545-
}
1546-
if (!$mixUsersAndGroups) {
1547-
$sharedEntries[$userId] = $entry;
1548-
} else {
1549-
$sharedEntries[] = $entry;
1550-
}
1551-
}
1552-
}
1553-
1554-
if (!$mixUsersAndGroups) {
1555-
return array("USERS" => $sharedEntries, "GROUPS" => $sharedGroups);
1556-
}
1557-
return $sharedEntries;
1558-
*/
1559-
15601471
}
15611472

15621473
/**
@@ -1977,11 +1888,13 @@ public function createSharedRepository($httpVars, $repository, $accessDriver, $u
19771888
$userObject->personalRole->setAcl($newRepoUniqueId, "");
19781889
$userObject->save("superuser");
19791890
}
1980-
$this->watcher->removeWatchFromFolder(
1981-
new AJXP_Node($this->urlBase.$file),
1982-
$user,
1983-
true
1984-
);
1891+
if($this->watcher !== false){
1892+
$this->watcher->removeWatchFromFolder(
1893+
new AJXP_Node($this->urlBase.$file),
1894+
$user,
1895+
true
1896+
);
1897+
}
19851898
}
19861899
}
19871900
$originalGroups = array_keys($currentRights["GROUPS"]);

0 commit comments

Comments
 (0)