5 include_once
"Modules/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";
9 require_once(
'./Services/WebAccessChecker/interfaces/interface.ilWACCheckingClass.php');
24 $lng->loadLanguageModule(
"wsp");
58 if(!$ilSetting->get(
"enable_global_profiles") && $ilUser->getId() == ANONYMOUS_USER_ID)
64 if (!$ilSetting->get(
'user_portfolios'))
78 if($pf->getOwner() == $a_user_id)
90 if($a_permission ==
"read" || $a_permission ==
"visible")
93 $objects = self::_getPermissions($a_node_id);
96 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
99 foreach($objects as $obj_id)
108 if(self::getSharedNodePassword($a_node_id) == self::getSharedSessionPassword($a_node_id) ||
109 $a_permission ==
"visible")
116 if($ilUser->getId() != ANONYMOUS_USER_ID)
143 if($rbacreview->isAssigned($a_user_id, $obj_id))
151 if($a_user_id == $obj_id)
184 public function addPermission($a_node_id, $a_object_id, $a_extended_data = null)
189 if($a_object_id == $ilUser->getId())
194 $ilDB->manipulate(
"INSERT INTO usr_portf_acl (node_id, object_id, extended_data, tstamp)".
195 " VALUES (".$ilDB->quote($a_node_id,
"integer").
", ".
196 $ilDB->quote($a_object_id,
"integer").
",".
197 $ilDB->quote($a_extended_data,
"text").
",".
198 $ilDB->quote(
time(),
"integer").
")");
214 $query =
"DELETE FROM usr_portf_acl".
215 " WHERE node_id = ".$ilDB->quote($a_node_id,
"integer");
219 $query .=
" AND object_id = ".$ilDB->quote($a_object_id,
"integer");
222 $ilDB->manipulate(
$query);
236 return self::_getPermissions($a_node_id);
249 $set = $ilDB->query(
"SELECT object_id FROM usr_portf_acl".
250 " WHERE node_id = ".$ilDB->quote($a_node_id,
"integer"));
252 while(
$row = $ilDB->fetchAssoc($set))
263 $set = $ilDB->query(
"SELECT object_id FROM usr_portf_acl".
264 " WHERE node_id = ".$ilDB->quote($a_node_id,
"integer").
266 return (
bool)$ilDB->numRows($set);
273 $set = $ilDB->query(
"SELECT object_id FROM usr_portf_acl".
274 " WHERE node_id = ".$ilDB->quote($a_node_id,
"integer").
276 return (
bool)$ilDB->numRows($set);
283 $set = $ilDB->query(
"SELECT object_id FROM usr_portf_acl".
284 " WHERE node_id = ".$ilDB->quote($a_node_id,
"integer").
286 return (
bool)$ilDB->numRows($set);
295 $sql =
"SELECT obj.obj_id".
296 " FROM object_data obj".
297 " JOIN usr_portfolio prtf ON (prtf.id = obj.obj_id)".
298 " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)".
299 " WHERE obj.owner = ".$ilDB->quote($ilUser->getId(),
"integer");
303 $sql .=
" AND prtf.is_online = ".$ilDB->quote(1,
"integer");
306 $set = $ilDB->query($sql);
307 while (
$row = $ilDB->fetchAssoc($set))
319 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
320 include_once
"Services/Membership/classes/class.ilParticipants.php";
324 $obj_ids = array_merge($grp_ids, $crs_ids);
325 $obj_ids[] = $ilUser->getId();
340 $set = $ilDB->query(
"SELECT DISTINCT(obj.owner), u.lastname, u.firstname, u.title".
341 " FROM object_data obj".
342 " JOIN usr_portfolio prtf ON (prtf.id = obj.obj_id)".
343 " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)".
344 " JOIN usr_data u on (u.usr_id = obj.owner)".
345 " WHERE ".$ilDB->in(
"acl.object_id", $obj_ids,
"",
"integer").
346 " AND obj.owner <> ".$ilDB->quote($ilUser->getId(),
"integer").
347 " AND prtf.is_online = ".$ilDB->quote(1,
"integer").
348 " ORDER BY u.lastname, u.firstname, u.title");
349 while (
$row = $ilDB->fetchAssoc($set))
351 $user_ids[
$row[
"owner"]] = $row[
"lastname"].
", ".$row[
"firstname"];
354 $user_ids[$row[
"owner"]] .=
", ".$row[
"title"];
368 $set = $ilDB->query(
"SELECT obj.obj_id, obj.owner".
369 " FROM object_data obj".
370 " JOIN usr_portfolio prtf ON (prtf.id = obj.obj_id)".
371 " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)".
372 " WHERE ".$ilDB->in(
"acl.object_id", $obj_ids,
"",
"integer").
373 " AND obj.owner = ".$ilDB->quote($a_owner_id,
"integer").
374 " AND prtf.is_online = ".$ilDB->quote(1,
"integer"));
375 while (
$row = $ilDB->fetchAssoc($set))
377 $res[
$row[
"obj_id"]] = $row[
"obj_id"];
391 $set = $ilDB->query(
"SELECT obj.obj_id, obj.owner, obj.title".
392 " FROM object_data obj".
393 " JOIN usr_portfolio prtf ON (prtf.id = obj.obj_id)".
394 " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)".
395 " WHERE ".$ilDB->in(
"acl.object_id", $obj_ids,
"",
"integer").
396 " AND ".$ilDB->in(
"obj.owner", $a_owner_ids,
"",
"integer").
397 " AND prtf.is_online = ".$ilDB->quote(1,
"integer"));
398 while (
$row = $ilDB->fetchAssoc($set))
409 if(!$a_filter[
"acl_type"])
415 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
417 switch($a_filter[
"acl_type"])
432 $obj_ids = $a_crs_ids;
436 $obj_ids = $a_grp_ids;
440 $obj_ids =
array($ilUser->getId());
447 $sql =
"SELECT obj.obj_id,obj.title,obj.owner".
448 ",acl.object_id acl_type, acl.tstamp acl_date".
449 " FROM object_data obj".
450 " JOIN usr_portfolio prtf ON (prtf.id = obj.obj_id)".
451 " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)".
452 " WHERE ".$ilDB->in(
"acl.object_id", $obj_ids,
"",
"integer").
453 " AND obj.owner <> ".$ilDB->quote($ilUser->getId(),
"integer").
454 " AND obj.type = ".$ilDB->quote(
"prtf",
"text").
455 " AND prtf.is_online = ".$ilDB->quote(1,
"integer");
457 if($a_filter[
"title"] && strlen($a_filter[
"title"]) >= 3)
459 $sql .=
" AND ".$ilDB->like(
"obj.title",
"text",
"%".$a_filter[
"title"].
"%");
461 if($a_filter[
"user"] && strlen($a_filter[
"user"]) >= 3)
464 $set = $ilDB->query(
"SELECT usr_id FROM usr_data".
465 " WHERE (".$ilDB->like(
"login",
"text",
"%".$a_filter[
"user"].
"%").
" ".
466 "OR ".$ilDB->like(
"firstname",
"text",
"%".$a_filter[
"user"].
"%").
" ".
467 "OR ".$ilDB->like(
"lastname",
"text",
"%".$a_filter[
"user"].
"%").
" ".
468 "OR ".$ilDB->like(
"email",
"text",
"%".$a_filter[
"user"].
"%").
")");
469 while(
$row = $ilDB->fetchAssoc($set))
471 $usr_ids[] =
$row[
"usr_id"];
473 if(!
sizeof($usr_ids))
477 $sql .=
" AND ".$ilDB->in(
"obj.owner", $usr_ids,
"",
"integer");
480 if($a_filter[
"acl_date"])
484 $sql .=
" AND acl.tstamp > ".$ilDB->quote($dt->get(
IL_CAL_UNIX),
"integer");
487 if($a_filter[
"crsgrp"])
489 include_once
"Services/Membership/classes/class.ilParticipants.php";
491 $part = $part->getParticipants();
496 $sql .=
" AND ".$ilDB->in(
"obj.owner", $part,
"",
"integer");
500 $sql .=
" ORDER BY acl.tstamp";
502 $set = $ilDB->query($sql);
503 while (
$row = $ilDB->fetchAssoc($set))
507 $row[
"acl_type"] =
array($row[
"acl_type"]);
512 $res[$row[
"obj_id"]][
"acl_type"][] = $row[
"acl_type"];
523 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
525 $set = $ilDB->query(
"SELECT extended_data FROM usr_portf_acl".
526 " WHERE node_id = ".$ilDB->quote($a_node_id,
"integer").
528 $res = $ilDB->fetchAssoc($set);
531 return $res[
"extended_data"];
537 $_SESSION[
"ilshpw_".$a_node_id] = $a_password;
550 include_once
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
557 if(!$has_registered && !$has_global)
559 $ilUser->setPref(
"public_profile",
"n");
560 $ilUser->writePrefs();
571 if($ilUser->getPref(
"public_profile") != $new_pref)
573 $ilUser->setPref(
"public_profile", $new_pref);
574 $ilUser->writePrefs();
589 if (preg_match(
"/\\/prtf_([\\d]*)\\//uism", $ilWACPath->
getPath(),
$results))
595 if ($this->
checkAccessOfUser($ilUser->getId(),
"read",
"view", $obj_id,
"prtf")) {
605 if ($ilAccess->checkAccessOfUser($ilUser->getId(),
"read",
"view",
$ref_id,
"prtt", $obj_id))
static getSharedNodePassword($a_node_id)
checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $a_node_id, $a_type="")
check access for an object
setPermissions($a_parent_node_id, $a_node_id)
Set permissions after creating node/object.
const PERMISSION_ALL_PASSWORD
hasGlobalPermission($a_node_id)
static _getMembershipByType($a_usr_id, $a_type, $a_only_member_role=false)
get membership by type Get course or group membership
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static getSharedSessionPassword($a_node_id)
addPermission($a_node_id, $a_object_id, $a_extended_data=null)
Add permission to node for object.
const PERMISSION_REGISTERED
static _getAllReferences($a_id)
get all reference ids of object
static _getPermissions($a_node_id)
Get all permissions to node.
canBeDelivered(ilWACPath $ilWACPath)
static keepSharedSessionPassword($a_node_id, $a_password)
hasGlobalPasswordPermission($a_node_id)
static setUserDefault($a_user_id, $a_portfolio_id=null)
Set the user default portfolio.
findSharedObjects(array $a_filter=null, array $a_crs_ids=null, array $a_grp_ids=null)
Class ilWACCheckingClass.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
getPermissions($a_node_id)
Get all permissions to node.
removePermission($a_node_id, $a_object_id=null)
Remove permission[s] (for object) to node.
getShardObjectsDataForUserIds(array $a_owner_ids)
getSharedObjects($a_owner_id)
Access handler for portfolio.
hasRegisteredPermission($a_node_id)
static getPossibleSharedTargets()
static getDefaultPortfolio($a_user_id)
Get default portfolio of user.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
static getInstanceByObjId($a_obj_id)
Get instance by obj type.
checkAccess($a_permission, $a_cmd, $a_node_id, $a_type="")
check access for an object
getObjectsIShare($a_online_only=true)