5include_once 
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
 
    6include_once 
"Modules/Group/classes/class.ilGroupParticipants.php";
 
    7include_once 
"Modules/Course/classes/class.ilCourseParticipants.php";
 
    8include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
 
    9require_once(
'./Services/WebAccessChecker/interfaces/interface.ilWACCheckingClass.php');
 
   55        $this->lng = 
$DIC->language();
 
   56        $this->
user = $DIC->user();
 
   57        $this->rbacreview = 
$DIC->rbac()->review();
 
   59        $this->db = 
$DIC->database();
 
   60        $this->access = 
$DIC->access();
 
   62        $lng->loadLanguageModule(
"wsp");
 
   98        if (!
$ilSetting->get(
"enable_global_profiles") && 
$ilUser->getId() == ANONYMOUS_USER_ID) {
 
  115        if ($pf->getOwner() == $a_user_id) {
 
  120        if (!$pf->isOnline()) {
 
  125        if ($a_permission == 
"read" || $a_permission == 
"visible") {
 
  129                include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
 
  132                foreach ($objects as $obj_id) {
 
  139                            if (self::getSharedNodePassword($a_node_id) == self::getSharedSessionPassword($a_node_id) ||
 
  140                                $a_permission == 
"visible") {
 
  146                            if (
$ilUser->getId() != ANONYMOUS_USER_ID) {
 
  169                                    if (
$rbacreview->isAssigned($a_user_id, $obj_id)) {
 
  176                                    if ($a_user_id == $obj_id) {
 
  208    public function addPermission($a_node_id, $a_object_id, $a_extended_data = 
null)
 
  214        if ($a_object_id == 
$ilUser->getId()) {
 
  218        $ilDB->manipulate(
"INSERT INTO usr_portf_acl (node_id, object_id, extended_data, tstamp)" .
 
  219            " VALUES (" . 
$ilDB->quote($a_node_id, 
"integer") . 
", " .
 
  220            $ilDB->quote($a_object_id, 
"integer") . 
"," .
 
  221            $ilDB->quote($a_extended_data, 
"text") . 
"," .
 
  222            $ilDB->quote(time(), 
"integer") . 
")");
 
  238        $query = 
"DELETE FROM usr_portf_acl" .
 
  239            " WHERE node_id = " . 
$ilDB->quote($a_node_id, 
"integer");
 
  242            $query .= 
" AND object_id = " . 
$ilDB->quote($a_object_id, 
"integer");
 
  274        $set = 
$ilDB->query(
"SELECT object_id FROM usr_portf_acl" .
 
  275            " WHERE node_id = " . 
$ilDB->quote($a_node_id, 
"integer"));
 
  287        $set = 
$ilDB->query(
"SELECT object_id FROM usr_portf_acl" .
 
  288            " WHERE node_id = " . 
$ilDB->quote($a_node_id, 
"integer") .
 
  290        return (
bool) 
$ilDB->numRows($set);
 
  297        $set = 
$ilDB->query(
"SELECT object_id FROM usr_portf_acl" .
 
  298            " WHERE node_id = " . 
$ilDB->quote($a_node_id, 
"integer") .
 
  300        return (
bool) 
$ilDB->numRows($set);
 
  307        $set = 
$ilDB->query(
"SELECT object_id FROM usr_portf_acl" .
 
  308            " WHERE node_id = " . 
$ilDB->quote($a_node_id, 
"integer") .
 
  310        return (
bool) 
$ilDB->numRows($set);
 
  320        $sql = 
"SELECT obj.obj_id" .
 
  321            " FROM object_data obj" .
 
  322            " JOIN usr_portfolio prtf ON (prtf.id = obj.obj_id)" .
 
  323            " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)" .
 
  324            " WHERE obj.owner = " . 
$ilDB->quote(
$ilUser->getId(), 
"integer");
 
  326        if ($a_online_only) {
 
  327            $sql .= 
" AND prtf.is_online = " . 
$ilDB->quote(1, 
"integer");
 
  330        $set = 
$ilDB->query($sql);
 
  344        include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
 
  345        include_once 
"Services/Membership/classes/class.ilParticipants.php";
 
  349        $obj_ids = array_merge($grp_ids, $crs_ids);
 
  366        $set = 
$ilDB->query(
"SELECT DISTINCT(obj.owner), u.lastname, u.firstname, u.title" .
 
  367            " FROM object_data obj" .
 
  368            " JOIN usr_portfolio prtf ON (prtf.id = obj.obj_id)" .
 
  369            " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)" .
 
  370            " JOIN usr_data u on (u.usr_id = obj.owner)" .
 
  371            " WHERE " . 
$ilDB->in(
"acl.object_id", $obj_ids, 
"", 
"integer") .
 
  372            " AND obj.owner <> " . 
$ilDB->quote(
$ilUser->getId(), 
"integer") .
 
  373            " AND prtf.is_online = " . 
$ilDB->quote(1, 
"integer") .
 
  374            " ORDER BY u.lastname, u.firstname, u.title");
 
  376            $user_ids[
$row[
"owner"]] = 
$row[
"lastname"] . 
", " . 
$row[
"firstname"];
 
  378                $user_ids[
$row[
"owner"]] .= 
", " . 
$row[
"title"];
 
  392        $set = 
$ilDB->query(
"SELECT obj.obj_id, obj.owner" .
 
  393            " FROM object_data obj" .
 
  394            " JOIN usr_portfolio prtf ON (prtf.id = obj.obj_id)" .
 
  395            " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)" .
 
  396            " WHERE " . 
$ilDB->in(
"acl.object_id", $obj_ids, 
"", 
"integer") .
 
  397            " AND obj.owner = " . 
$ilDB->quote($a_owner_id, 
"integer") .
 
  398            " AND prtf.is_online = " . 
$ilDB->quote(1, 
"integer"));
 
  414        $set = 
$ilDB->query(
"SELECT obj.obj_id, obj.owner, obj.title" .
 
  415            " FROM object_data obj" .
 
  416            " JOIN usr_portfolio prtf ON (prtf.id = obj.obj_id)" .
 
  417            " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)" .
 
  418            " WHERE " . 
$ilDB->in(
"acl.object_id", $obj_ids, 
"", 
"integer") .
 
  419            " AND " . 
$ilDB->in(
"obj.owner", $a_owner_ids, 
"", 
"integer") .
 
  420            " AND prtf.is_online = " . 
$ilDB->quote(1, 
"integer"));
 
  428    public function findSharedObjects(array $a_filter = 
null, array $a_crs_ids = 
null, array $a_grp_ids = 
null)
 
  432        if (!$a_filter[
"acl_type"]) {
 
  435            include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
 
  437            switch ($a_filter[
"acl_type"]) {
 
  451                    $obj_ids = $a_crs_ids;
 
  455                    $obj_ids = $a_grp_ids;
 
  459                    $obj_ids = array(
$ilUser->getId());
 
  466        $sql = 
"SELECT obj.obj_id,obj.title,obj.owner" .
 
  467            ",acl.object_id acl_type, acl.tstamp acl_date" .
 
  468            " FROM object_data obj" .
 
  469            " JOIN usr_portfolio prtf ON (prtf.id = obj.obj_id)" .
 
  470            " JOIN usr_portf_acl acl ON (acl.node_id = obj.obj_id)" .
 
  471            " WHERE " . 
$ilDB->in(
"acl.object_id", $obj_ids, 
"", 
"integer") .
 
  472            " AND obj.owner <> " . 
$ilDB->quote(
$ilUser->getId(), 
"integer") .
 
  473            " AND obj.type = " . 
$ilDB->quote(
"prtf", 
"text") .
 
  474            " AND prtf.is_online = " . 
$ilDB->quote(1, 
"integer");
 
  476        if ($a_filter[
"title"] && strlen($a_filter[
"title"]) >= 3) {
 
  477            $sql .= 
" AND " . 
$ilDB->like(
"obj.title", 
"text", 
"%" . $a_filter[
"title"] . 
"%");
 
  479        if ($a_filter[
"user"] && strlen($a_filter[
"user"]) >= 3) {
 
  481            $set = 
$ilDB->query(
"SELECT usr_id FROM usr_data" .
 
  482                " WHERE (" . 
$ilDB->like(
"login", 
"text", 
"%" . $a_filter[
"user"] . 
"%") . 
" " .
 
  483                "OR " . 
$ilDB->like(
"firstname", 
"text", 
"%" . $a_filter[
"user"] . 
"%") . 
" " .
 
  484                "OR " . 
$ilDB->like(
"lastname", 
"text", 
"%" . $a_filter[
"user"] . 
"%") . 
" " .
 
  485                "OR " . 
$ilDB->like(
"email", 
"text", 
"%" . $a_filter[
"user"] . 
"%") . 
")");
 
  487                $usr_ids[] = 
$row[
"usr_id"];
 
  489            if (!
sizeof($usr_ids)) {
 
  492            $sql .= 
" AND " . 
$ilDB->in(
"obj.owner", $usr_ids, 
"", 
"integer");
 
  495        if ($a_filter[
"acl_date"]) {
 
  498            $sql .= 
" AND acl.tstamp > " . 
$ilDB->quote($dt->get(
IL_CAL_UNIX), 
"integer");
 
  501        if ($a_filter[
"crsgrp"]) {
 
  502            include_once 
"Services/Membership/classes/class.ilParticipants.php";
 
  504            $part = $part->getParticipants();
 
  505            if (!
sizeof($part)) {
 
  508            $sql .= 
" AND " . 
$ilDB->in(
"obj.owner", $part, 
"", 
"integer");
 
  512        $sql .= 
" ORDER BY acl.tstamp";
 
  514        $set = 
$ilDB->query($sql);
 
  517                $row[
"acl_type"] = array(
$row[
"acl_type"]);
 
  533        include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
 
  535        $set = 
$ilDB->query(
"SELECT extended_data FROM usr_portf_acl" .
 
  536            " WHERE node_id = " . 
$ilDB->quote($a_node_id, 
"integer") .
 
  540            return $res[
"extended_data"];
 
  546        $_SESSION[
"ilshpw_" . $a_node_id] = $a_password;
 
  551        return $_SESSION[
"ilshpw_" . $a_node_id];
 
  559        include_once 
"Modules/Portfolio/classes/class.ilObjPortfolio.php";
 
  565            if (!$has_registered && !$has_global) {
 
  566                $ilUser->setPref(
"public_profile", 
"n");
 
  576                if (
$ilUser->getPref(
"public_profile") != $new_pref) {
 
  577                    $ilUser->setPref(
"public_profile", $new_pref);
 
  595        if (preg_match(
"/\\/prtf_([\\d]*)\\//uism", $ilWACPath->
getPath(), 
$results)) {
 
  606                foreach ($ref_ids as $ref_id) {
 
  607                    if ($ilAccess->checkAccessOfUser(
$ilUser->getId(), 
"read", 
"view", $ref_id, 
"prtt", $obj_id)) {
 
An exception for terminatinating execution or to throw for unit testing.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
@classDescription Date and time handling
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static setUserDefault($a_user_id, $a_portfolio_id=null)
Set the user default portfolio.
static getDefaultPortfolio($a_user_id)
Get default portfolio of user.
static _getAllReferences($a_id)
get all reference ids of object
static _lookupType($a_id, $a_reference=false)
lookup object type
static getInstanceByObjId($a_obj_id)
Get instance by obj type.
static _getMembershipByType($a_usr_id, $a_type, $a_only_member_role=false)
get membership by type Get course or group membership
Access handler for portfolio.
addPermission($a_node_id, $a_object_id, $a_extended_data=null)
Add permission to node for object.
findSharedObjects(array $a_filter=null, array $a_crs_ids=null, array $a_grp_ids=null)
getSharedObjects($a_owner_id)
static getSharedSessionPassword($a_node_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.
hasGlobalPasswordPermission($a_node_id)
hasRegisteredPermission($a_node_id)
checkAccess($a_permission, $a_cmd, $a_node_id, $a_type="")
check access for an object
getShardObjectsDataForUserIds(array $a_owner_ids)
static _getPermissions($a_node_id)
Get all permissions to node.
static getPossibleSharedTargets()
removePermission($a_node_id, $a_object_id=null)
Remove permission[s] (for object) to node.
static keepSharedSessionPassword($a_node_id, $a_password)
canBeDelivered(ilWACPath $ilWACPath)
getPermissions($a_node_id)
Get all permissions to node.
getObjectsIShare($a_online_only=true)
hasGlobalPermission($a_node_id)
const PERMISSION_REGISTERED
const PERMISSION_ALL_PASSWORD
Class ilWACCheckingClass.
foreach($_POST as $key=> $value) $res