5 include_once
"Services/Portfolio/classes/class.ilObjPortfolio.php";
6 include_once
"Modules/Group/classes/class.ilGroupParticipants.php";
7 include_once
"Modules/Course/classes/class.ilCourseParticipants.php";
8 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
23 $lng->loadLanguageModule(
"wsp");
35 public function checkAccess($a_permission, $a_cmd, $a_node_id, $a_type =
"")
39 return $this->
checkAccessOfUser($ilUser->getId(),$a_permission, $a_cmd, $a_node_id, $a_type);
52 public function checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $a_node_id, $a_type =
"")
57 if (!$ilSetting->get(
'user_portfolios'))
71 if($pf->getOwner() == $a_user_id)
77 if($a_permission ==
"read" || $a_permission ==
"visible")
83 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
86 foreach($objects as $obj_id)
95 if(self::getSharedNodePassword($a_node_id) == self::getSharedSessionPassword($a_node_id) ||
96 $a_permission ==
"visible")
103 if($ilUser->getId() != ANONYMOUS_USER_ID)
130 if($rbacreview->isAssigned($a_user_id, $obj_id))
138 if($a_user_id == $obj_id)
171 public function addPermission($a_node_id, $a_object_id, $a_extended_data = null)
176 if($a_object_id == $ilUser->getId())
181 $ilDB->manipulate(
"INSERT INTO usr_portf_acl (node_id, object_id, extended_data)".
182 " VALUES (".$ilDB->quote($a_node_id,
"integer").
", ".
183 $ilDB->quote($a_object_id,
"integer").
",".
184 $ilDB->quote($a_extended_data,
"text").
")");
200 $query =
"DELETE FROM usr_portf_acl".
201 " WHERE node_id = ".$ilDB->quote($a_node_id,
"integer");
205 $query .=
" AND object_id = ".$ilDB->quote($a_object_id,
"integer");
208 $ilDB->manipulate(
$query);
224 $set = $ilDB->query(
"SELECT object_id FROM usr_portf_acl".
225 " WHERE node_id = ".$ilDB->quote($a_node_id,
"integer"));
227 while(
$row = $ilDB->fetchAssoc($set))
238 $set = $ilDB->query(
"SELECT object_id FROM usr_portf_acl".
239 " WHERE node_id = ".$ilDB->quote($a_node_id,
"integer").
241 return (
bool)$ilDB->numRows($set);
248 $set = $ilDB->query(
"SELECT object_id FROM usr_portf_acl".
249 " WHERE node_id = ".$ilDB->quote($a_node_id,
"integer").
251 return (
bool)$ilDB->numRows($set);
258 $set = $ilDB->query(
"SELECT object_id FROM usr_portf_acl".
259 " WHERE node_id = ".$ilDB->quote($a_node_id,
"integer").
261 return (
bool)$ilDB->numRows($set);
269 $set = $ilDB->query(
"SELECT obj.obj_id".
270 " FROM object_data obj".
271 " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)".
272 " WHERE obj.owner = ".$ilDB->quote($ilUser->getId(),
"integer"));
273 while (
$row = $ilDB->fetchAssoc($set))
285 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
286 include_once
"Services/Membership/classes/class.ilParticipants.php";
290 $obj_ids = array_merge($grp_ids, $crs_ids);
291 $obj_ids[] = $ilUser->getId();
306 $set = $ilDB->query(
"SELECT DISTINCT(obj.owner), u.lastname, u.firstname, u.title".
307 " FROM object_data obj".
308 " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)".
309 " JOIN usr_data u on (u.usr_id = obj.owner)".
310 " WHERE ".$ilDB->in(
"acl.object_id", $obj_ids,
"",
"integer").
311 " AND obj.owner <> ".$ilDB->quote($ilUser->getId(),
"integer").
312 " ORDER BY u.lastname, u.firstname, u.title");
313 while (
$row = $ilDB->fetchAssoc($set))
315 $user_ids[
$row[
"owner"]] = $row[
"lastname"].
", ".$row[
"firstname"];
318 $user_ids[$row[
"owner"]] .=
", ".$row[
"title"];
332 $set = $ilDB->query(
"SELECT obj.obj_id".
333 " FROM object_data obj".
334 " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)".
335 " WHERE ".$ilDB->in(
"acl.object_id", $obj_ids,
"",
"integer").
336 " AND obj.owner = ".$ilDB->quote($a_owner_id,
"integer"));
337 while (
$row = $ilDB->fetchAssoc($set))
339 $res[
$row[
"obj_id"]] = $row[
"obj_id"];
349 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
351 $set = $ilDB->query(
"SELECT extended_data FROM usr_portf_acl".
352 " WHERE node_id = ".$ilDB->quote($a_node_id,
"integer").
354 $res = $ilDB->fetchAssoc($set);
357 return $res[
"extended_data"];
363 $_SESSION[
"ilshpw_".$a_node_id] = $a_password;
376 include_once
"Services/Portfolio/classes/class.ilObjPortfolio.php";
383 if(!$has_registered && !$has_global)
385 $ilUser->setPref(
"public_profile",
"n");
386 $ilUser->writePrefs();
397 if($ilUser->getPref(
"public_profile") != $new_pref)
399 $ilUser->setPref(
"public_profile", $new_pref);
400 $ilUser->writePrefs();