5 include_once
"Modules/Group/classes/class.ilGroupParticipants.php";
6 include_once
"Modules/Course/classes/class.ilCourseParticipants.php";
7 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
25 $lng->loadLanguageModule(
"wsp");
29 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
32 $this->tree = $a_tree;
54 public function checkAccess($a_permission, $a_cmd, $a_node_id, $a_type =
"")
58 return $this->
checkAccessOfUser($this->tree, $ilUser->getId(),$a_permission, $a_cmd, $a_node_id, $a_type);
79 if($a_permission ==
"write")
88 if($a_tree->lookupOwner($a_node_id) == $a_user_id)
94 if($a_permission ==
"read" || $a_permission ==
"visible")
101 foreach($objects as $obj_id)
110 if(self::getSharedNodePassword($a_node_id) == self::getSharedSessionPassword($a_node_id) ||
111 $a_permission ==
"visible")
118 if($ilUser->getId() != ANONYMOUS_USER_ID)
145 if($rbacreview->isAssigned($a_user_id, $obj_id))
153 if($a_user_id == $obj_id)
187 public function addPermission($a_node_id, $a_object_id, $a_extended_data = null)
192 if($this->tree->getTreeId() == $ilUser->getId() &&
193 $a_object_id == $ilUser->getId())
198 $ilDB->manipulate(
"INSERT INTO acl_ws (node_id, object_id, extended_data)".
199 " VALUES (".$ilDB->quote($a_node_id,
"integer").
", ".
200 $ilDB->quote($a_object_id,
"integer").
",".
201 $ilDB->quote($a_extended_data,
"text").
")");
215 $query =
"DELETE FROM acl_ws".
216 " WHERE node_id = ".$ilDB->quote($a_node_id,
"integer");
220 $query .=
" AND object_id = ".$ilDB->quote($a_object_id,
"integer");
223 return $ilDB->manipulate(
$query);
236 $publish_enabled = $ilSetting->get(
"enable_global_profiles");
240 $set = $ilDB->query(
"SELECT object_id FROM acl_ws".
241 " WHERE node_id = ".$ilDB->quote($a_node_id,
"integer"));
243 while(
$row = $ilDB->fetchAssoc($set))
245 if($publish_enabled || !in_array(
$row[
"object_id"], $publish_perm))
257 $set = $ilDB->query(
"SELECT object_id FROM acl_ws".
258 " WHERE node_id = ".$ilDB->quote($a_node_id,
"integer").
260 return (
bool)$ilDB->numRows($set);
267 if(!$ilSetting->get(
"enable_global_profiles"))
272 $set = $ilDB->query(
"SELECT object_id FROM acl_ws".
273 " WHERE node_id = ".$ilDB->quote($a_node_id,
"integer").
275 return (
bool)$ilDB->numRows($set);
282 if(!$ilSetting->get(
"enable_global_profiles"))
287 $set = $ilDB->query(
"SELECT object_id FROM acl_ws".
288 " WHERE node_id = ".$ilDB->quote($a_node_id,
"integer").
290 return (
bool)$ilDB->numRows($set);
297 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
298 include_once
"Services/Membership/classes/class.ilParticipants.php";
302 $obj_ids = array_merge($grp_ids, $crs_ids);
303 $obj_ids[] = $ilUser->getId();
306 if($ilSetting->get(
"enable_global_profiles"))
322 $set = $ilDB->query(
"SELECT DISTINCT(obj.owner), u.lastname, u.firstname, u.title".
323 " FROM object_data obj".
324 " JOIN object_reference_ws ref ON (obj.obj_id = ref.obj_id)".
325 " JOIN tree_workspace tree ON (tree.child = ref.wsp_id)".
326 " JOIN acl_ws acl ON (acl.node_id = tree.child)".
327 " JOIN usr_data u on (u.usr_id = obj.owner)".
328 " WHERE ".$ilDB->in(
"acl.object_id", $obj_ids,
"",
"integer").
329 " AND obj.owner <> ".$ilDB->quote($ilUser->getId(),
"integer").
330 " ORDER BY u.lastname, u.firstname, u.title");
331 while (
$row = $ilDB->fetchAssoc($set))
333 $user_ids[
$row[
"owner"]] = $row[
"lastname"].
", ".$row[
"firstname"];
336 $user_ids[$row[
"owner"]] .=
", ".$row[
"title"];
350 $set = $ilDB->query(
"SELECT ref.wsp_id,obj.obj_id".
351 " FROM object_data obj".
352 " JOIN object_reference_ws ref ON (obj.obj_id = ref.obj_id)".
353 " JOIN tree_workspace tree ON (tree.child = ref.wsp_id)".
354 " JOIN acl_ws acl ON (acl.node_id = tree.child)".
355 " WHERE ".$ilDB->in(
"acl.object_id", $obj_ids,
"",
"integer").
356 " AND obj.owner = ".$ilDB->quote($a_owner_id,
"integer"));
357 while (
$row = $ilDB->fetchAssoc($set))
359 $res[
$row[
"wsp_id"]] = $row[
"obj_id"];
369 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
371 $set = $ilDB->query(
"SELECT * FROM acl_ws".
372 " WHERE node_id = ".$ilDB->quote($a_node_id,
"integer").
374 $res = $ilDB->fetchAssoc($set);
377 return $res[
"extended_data"];
383 $_SESSION[
"ilshpw_".$a_node_id] = $a_password;
391 public static function getGotoLink($a_node_id, $a_obj_id, $a_additional = null)
393 include_once(
'./Services/Link/classes/class.ilLink.php');
402 $set = $ilDB->query(
"SELECT ref.wsp_id,obj.obj_id".
403 " FROM object_data obj".
404 " JOIN object_reference_ws ref ON (obj.obj_id = ref.obj_id)".
405 " JOIN tree_workspace tree ON (tree.child = ref.wsp_id)".
406 " JOIN acl_ws acl ON (acl.node_id = tree.child)".
407 " WHERE obj.owner = ".$ilDB->quote($ilUser->getId(),
"integer"));
408 while (
$row = $ilDB->fetchAssoc($set))
410 $res[
$row[
"wsp_id"]] = $row[
"obj_id"];
420 $set = $ilDB->query(
"SELECT obj.obj_id, obj.type, obj.title".
421 " FROM object_reference_ws ref".
422 " JOIN tree_workspace tree ON (tree.child = ref.wsp_id)".
423 " JOIN object_data obj ON (ref.obj_id = obj.obj_id)".
424 " WHERE ref.wsp_id = ".$ilDB->quote($a_node_id,
"integer"));
425 return $ilDB->fetchAssoc($set);