ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilObjUserAccess Class Reference

Class ilObjUserAccess. More...

+ Inheritance diagram for ilObjUserAccess:
+ Collaboration diagram for ilObjUserAccess:

Public Member Functions

 _checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
 
 canBeDelivered (ilWACPath $ilWACPath)
 
- Public Member Functions inherited from ilObjectAccess
 _checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
 Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 _checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id)
 check condition More...
 

Static Public Member Functions

static _getCommands ()
 
static _checkGoto ($a_target)
 check whether goto script will succeed More...
 
- Static Public Member Functions inherited from ilObjectAccess
static _getCommands ()
 get commands More...
 
static _checkGoto ($a_target)
 check whether goto script will succeed More...
 
static _isOffline ($a_obj_id)
 Type-specific implementation of general status, has to be overwritten. More...
 
static _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data. More...
 

Detailed Description

Member Function Documentation

◆ _checkAccess()

ilObjUserAccess::_checkAccess (   $a_cmd,
  $a_permission,
  $a_ref_id,
  $a_obj_id,
  $a_user_id = "" 
)

Definition at line 25 of file class.ilObjUserAccess.php.

25  {
26  die();
27  }

◆ _checkGoto()

static ilObjUserAccess::_checkGoto (   $a_target)
static

check whether goto script will succeed

Definition at line 33 of file class.ilObjUserAccess.php.

33  {
34  return true;
35  }

◆ _getCommands()

static ilObjUserAccess::_getCommands ( )
static

Definition at line 20 of file class.ilObjUserAccess.php.

20  {
21  die();
22  }

◆ canBeDelivered()

ilObjUserAccess::canBeDelivered ( ilWACPath  $ilWACPath)
Parameters
ilWACPath$ilWACPath
Returns
bool

Implements ilWACCheckingClass.

Definition at line 43 of file class.ilObjUserAccess.php.

References $ilSetting, $ilUser, ilObjUser\_lookupPref(), and ilWACPath\getFileName().

43  {
44  global $ilUser, $ilSetting;
45 
46  preg_match("/usr_(\\d*).*/ui", $ilWACPath->getFileName(), $matches);
47  $usr_id = $matches[1];
48 
49  // check if own image is viewed
50  if ($usr_id == $ilUser->getId()) {
51  return true;
52  }
53 
54  // check if image is in the public profile
55  $public_upload = ilObjUser::_lookupPref($usr_id, 'public_upload');
56  if ($public_upload != 'y') {
57  return false;
58  }
59 
60  // check the publication status of the profile
61  $public_profile = ilObjUser::_lookupPref($usr_id, 'public_profile');
62 
63  if ($public_profile == 'g' and $ilSetting->get('enable_global_profiles') and $ilSetting->get('pub_section')) {
64  // globally public
65  return true;
66  } elseif (($public_profile == 'y' or $public_profile == 'g') and $ilUser->getId() != ANONYMOUS_USER_ID && $ilUser->getId() != 0) {
67  // public for logged in users
68  return true;
69  } else {
70  // not public
71  return false;
72  }
73  }
$ilUser
Definition: imgupload.php:18
global $ilSetting
Definition: privfeed.php:17
static _lookupPref($a_usr_id, $a_keyword)
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: