40 $this->
lng = $DIC->language();
41 $this->
user = $DIC->user();
42 $this->rbacreview = $DIC->rbac()->review();
44 $this->db = $DIC->database();
45 $this->
access = $DIC->access();
46 $lng = $DIC->language();
48 $this->session_repo = $DIC->portfolio()
100 if ($pf->getOwner() === $a_user_id) {
105 if (!$pf->isOnline()) {
110 if ($a_permission ===
"read" || $a_permission ===
"visible") {
112 $objects = self::_getPermissions($a_node_id);
115 foreach ($objects as $obj_id) {
122 if (self::getSharedNodePassword($a_node_id) === self::getSharedSessionPassword($a_node_id) ||
123 $a_permission ===
"visible") {
152 if ($rbacreview->
isAssigned($a_user_id, $obj_id)) {
159 if ($a_user_id == $obj_id) {
180 int $a_parent_node_id,
192 string $a_extended_data = null
198 if ($a_object_id ===
$ilUser->getId()) {
205 "node_id" => [
"integer", $a_node_id],
206 "object_id" => [
"integer", $a_object_id]
209 "extended_data" => [
"text", $a_extended_data],
210 "tstamp" => [
"integer", time()]
223 int $a_object_id = null
227 $query =
"DELETE FROM usr_portf_acl" .
228 " WHERE node_id = " .
$ilDB->quote($a_node_id,
"integer");
231 $query .=
" AND object_id = " .
$ilDB->quote($a_object_id,
"integer");
245 return self::_getPermissions($a_node_id);
256 $ilDB = $DIC->database();
258 $set =
$ilDB->query(
"SELECT object_id FROM usr_portf_acl" .
259 " WHERE node_id = " .
$ilDB->quote($a_node_id,
"integer"));
261 while ($row =
$ilDB->fetchAssoc($set)) {
262 $res[] = $row[
"object_id"];
272 $set =
$ilDB->query(
"SELECT object_id FROM usr_portf_acl" .
273 " WHERE node_id = " .
$ilDB->quote($a_node_id,
"integer") .
275 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);
294 $set =
$ilDB->query(
"SELECT object_id FROM usr_portf_acl" .
295 " WHERE node_id = " .
$ilDB->quote($a_node_id,
"integer") .
297 return (
bool)
$ilDB->numRows($set);
301 bool $a_online_only =
true 308 $sql =
"SELECT obj.obj_id" .
309 " FROM object_data obj" .
310 " JOIN usr_portfolio prtf ON (prtf.id = obj.obj_id)" .
311 " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)" .
312 " WHERE obj.owner = " .
$ilDB->quote(
$ilUser->getId(),
"integer");
314 if ($a_online_only) {
315 $sql .=
" AND prtf.is_online = " .
$ilDB->quote(1,
"integer");
318 $set =
$ilDB->query($sql);
319 while ($row =
$ilDB->fetchAssoc($set)) {
320 $res[] = $row[
"obj_id"];
335 $obj_ids = array_merge($grp_ids, $crs_ids);
349 $obj_ids = self::getPossibleSharedTargets();
352 $set =
$ilDB->query(
"SELECT DISTINCT(obj.owner), u.lastname, u.firstname, u.title" .
353 " FROM object_data obj" .
354 " JOIN usr_portfolio prtf ON (prtf.id = obj.obj_id)" .
355 " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)" .
356 " JOIN usr_data u on (u.usr_id = obj.owner)" .
357 " WHERE " .
$ilDB->in(
"acl.object_id", $obj_ids,
"",
"integer") .
358 " AND obj.owner <> " .
$ilDB->quote(
$ilUser->getId(),
"integer") .
359 " AND prtf.is_online = " .
$ilDB->quote(1,
"integer") .
360 " ORDER BY u.lastname, u.firstname, u.title");
361 while ($row =
$ilDB->fetchAssoc($set)) {
362 $user_ids[$row[
"owner"]] = $row[
"lastname"] .
", " . $row[
"firstname"];
364 $user_ids[$row[
"owner"]] .=
", " . $row[
"title"];
376 $obj_ids = self::getPossibleSharedTargets();
379 $set =
$ilDB->query(
"SELECT obj.obj_id, obj.owner" .
380 " FROM object_data obj" .
381 " JOIN usr_portfolio prtf ON (prtf.id = obj.obj_id)" .
382 " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)" .
383 " WHERE " .
$ilDB->in(
"acl.object_id", $obj_ids,
"",
"integer") .
384 " AND obj.owner = " .
$ilDB->quote($a_owner_id,
"integer") .
385 " AND prtf.is_online = " .
$ilDB->quote(1,
"integer"));
386 while ($row =
$ilDB->fetchAssoc($set)) {
387 $res[$row[
"obj_id"]] = $row[
"obj_id"];
398 $obj_ids = self::getPossibleSharedTargets();
402 $set =
$ilDB->query(
"SELECT obj.obj_id, obj.owner, obj.title" .
403 " FROM object_data obj" .
404 " JOIN usr_portfolio prtf ON (prtf.id = obj.obj_id)" .
405 " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)" .
406 " WHERE " .
$ilDB->in(
"acl.object_id", $obj_ids,
"",
"integer") .
407 " AND " .
$ilDB->in(
"obj.owner", $a_owner_ids,
"",
"integer") .
408 " AND prtf.is_online = " .
$ilDB->quote(1,
"integer"));
409 while ($row =
$ilDB->fetchAssoc($set)) {
410 $res[$row[
"owner"]][$row[
"obj_id"]] = $row[
"title"];
417 array $a_filter = null,
418 array $a_crs_ids = null,
419 array $a_grp_ids = null
425 if (!($a_filter[
"acl_type"] ??
false)) {
426 $obj_ids = self::getPossibleSharedTargets();
428 switch ($a_filter[
"acl_type"]) {
442 $obj_ids = $a_crs_ids;
446 $obj_ids = $a_grp_ids;
450 $obj_ids = array(
$ilUser->getId());
457 $sql =
"SELECT obj.obj_id,obj.title,obj.owner" .
458 ",acl.object_id acl_type, acl.tstamp acl_date" .
459 " FROM object_data obj" .
460 " JOIN usr_portfolio prtf ON (prtf.id = obj.obj_id)" .
461 " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)" .
462 " WHERE " .
$ilDB->in(
"acl.object_id", $obj_ids,
"",
"integer") .
463 " AND obj.owner <> " .
$ilDB->quote(
$ilUser->getId(),
"integer") .
464 " AND obj.type = " .
$ilDB->quote(
"prtf",
"text") .
465 " AND prtf.is_online = " .
$ilDB->quote(1,
"integer");
467 if ($a_filter[
"title"] && strlen($a_filter[
"title"]) >= 3) {
468 $sql .=
" AND " .
$ilDB->like(
"obj.title",
"text",
"%" . $a_filter[
"title"] .
"%");
470 if ($a_filter[
"user"] && strlen($a_filter[
"user"]) >= 3) {
472 $set =
$ilDB->query(
"SELECT usr_id FROM usr_data" .
473 " WHERE (" .
$ilDB->like(
"login",
"text",
"%" . $a_filter[
"user"] .
"%") .
" " .
474 "OR " .
$ilDB->like(
"firstname",
"text",
"%" . $a_filter[
"user"] .
"%") .
" " .
475 "OR " .
$ilDB->like(
"lastname",
"text",
"%" . $a_filter[
"user"] .
"%") .
" " .
476 "OR " .
$ilDB->like(
"email",
"text",
"%" . $a_filter[
"user"] .
"%") .
")");
477 while ($row =
$ilDB->fetchAssoc($set)) {
478 $usr_ids[] = $row[
"usr_id"];
480 if (!count($usr_ids)) {
483 $sql .=
" AND " .
$ilDB->in(
"obj.owner", $usr_ids,
"",
"integer");
486 if ($a_filter[
"acl_date"] ??
false) {
489 $sql .=
" AND acl.tstamp > " .
$ilDB->quote($dt->get(
IL_CAL_UNIX),
"integer");
492 if ($a_filter[
"crsgrp"] ??
false) {
494 $part = $part->getParticipants();
498 $sql .=
" AND " .
$ilDB->in(
"obj.owner", $part,
"",
"integer");
502 $sql .=
" ORDER BY acl.tstamp";
504 $set =
$ilDB->query($sql);
505 while ($row =
$ilDB->fetchAssoc($set)) {
506 if (!isset(
$res[$row[
"obj_id"]])) {
507 $row[
"acl_type"] = array($row[
"acl_type"]);
508 $res[$row[
"obj_id"]] = $row;
510 $res[$row[
"obj_id"]][
"acl_type"][] = $row[
"acl_type"];
522 $ilDB = $DIC->database();
524 $set =
$ilDB->query(
"SELECT extended_data FROM usr_portf_acl" .
525 " WHERE node_id = " .
$ilDB->quote($a_node_id,
"integer") .
529 return $res[
"extended_data"];
539 $session_repo = $DIC->portfolio()
550 $session_repo = $DIC->portfolio()
568 if (!$has_registered && !$has_global) {
569 $ilUser->setPref(
"public_profile",
"n");
579 if (
$ilUser->getPref(
"public_profile") !== $new_pref) {
580 $ilUser->setPref(
"public_profile", $new_pref);
596 if (preg_match(
"/\\/prtf_([\\d]+)\\//uim", $ilWACPath->
getPath(),
$results)) {
607 foreach ($ref_ids as
$ref_id) {
608 if ($ilAccess->checkAccessOfUser(
$ilUser->getId(),
"read",
"view",
$ref_id,
"prtt", $obj_id)) {
623 return (
bool) $this->
settings->get(
'user_portfolios');
checkAccess(string $a_permission, string $a_cmd, int $a_node_id, string $a_type="")
check access for an object
static getSharedSessionPassword(int $a_node_id)
hasRegisteredPermission(int $a_node_id)
const PERMISSION_ALL_PASSWORD
hasGlobalPasswordPermission(int $a_node_id)
static _getAllReferences(int $id)
get all reference ids for object ID
static getInstanceByObjId(int $a_obj_id)
Get instance by obj type.
static getDefaultPortfolio(int $a_user_id)
Get default portfolio of user.
hasGlobalPermission(int $a_node_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getSharedSessionPassword(int $node_id)
loadLanguageModule(string $a_module)
Load language module.
const PERMISSION_REGISTERED
addPermission(int $a_node_id, int $a_object_id, string $a_extended_data=null)
Add permission to node for object.
checkAccessOfUser(int $a_user_id, string $a_permission, string $a_cmd, int $a_node_id, string $a_type="")
check access for an object
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static keepSharedSessionPassword(int $a_node_id, string $a_password)
syncProfile(int $a_node_id)
getSharedObjects(int $a_owner_id)
canBeDelivered(ilWACPath $ilWACPath)
WAC check.
setSharedSessionPassword(int $node_id, string $pw)
static _getInstanceByObjId(int $a_obj_id)
static _getPermissions(int $a_node_id)
Get all permissions to node.
static getSharedNodePassword(int $a_node_id)
isAssigned(int $a_usr_id, int $a_role_id)
check if a specific user is assigned to specific role
getPermissions(int $a_node_id)
Get all permissions to node.
static setUserDefault(int $a_user_id, ?int $a_portfolio_id=null)
Set the user default portfolio.
findSharedObjects(array $a_filter=null, array $a_crs_ids=null, array $a_grp_ids=null)
getObjectsIShare(bool $a_online_only=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setPermissions(int $a_parent_node_id, int $a_node_id)
Set permissions after creating node/object.
AccessSessionRepository $session_repo
getShardObjectsDataForUserIds(array $a_owner_ids)
static _getInstanceByObjId(int $a_obj_id)
Get singleton instance.
editPortfolios()
Is portfolio editing (general feature) enabled.
Access handler for portfolio NOTE: This file needs to stay in the classes directory, WAC will be confused otherwise.
static getPossibleSharedTargets()
Stores repository clipboard data.
static _getMembershipByType(int $a_usr_id, array $a_type, bool $a_only_member_role=false)
get membership by type Get course or group membership
static _lookupType(int $id, bool $reference=false)
removePermission(int $a_node_id, int $a_object_id=null)
Remove permission[s] (for object) to node.