ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
Parameters
ilWACPath$ilWACPath
Returns
bool
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 if object type does not support centralized offline handling. 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 26 of file class.ilObjUserAccess.php.

27  {
28  die();
29  }

◆ _checkGoto()

static ilObjUserAccess::_checkGoto (   $a_target)
static

check whether goto script will succeed

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

References $GLOBALS, IL_REG_DISABLED, and ilUtil\sendFailure().

36  {
37  $settings = isset($GLOBALS['DIC']) ? $GLOBALS['DIC']->settings() : $GLOBALS['DIC']['ilSetting'];
38 
39  if ('usr_registration' == $a_target) {
40  require_once 'Services/Registration/classes/class.ilRegistrationSettings.php';
41  $regSeetings = new ilRegistrationSettings();
42  if ($regSeetings->getRegistrationType() == IL_REG_DISABLED) {
43  $GLOBALS['DIC']->language()->loadLanguageModule('registration');
44  ilUtil::sendFailure(sprintf($GLOBALS['DIC']->language()->txt('registration_disabled_no_access'), $settings->get('admin_email')), true);
45  return false;
46  }
47  } elseif ('usr_nameassist' == $a_target) {
48  if (!$settings->get('password_assistance')) {
49  $GLOBALS['DIC']->language()->loadLanguageModule('pwassist');
50  ilUtil::sendFailure(sprintf($GLOBALS['DIC']->language()->txt('unassist_disabled_no_access'), $settings->get('admin_email')), true);
51  return false;
52  }
53  } elseif ('usr_pwassist' == $a_target) {
54  if (!$settings->get('password_assistance')) {
55  $GLOBALS['DIC']->language()->loadLanguageModule('pwassist');
56  ilUtil::sendFailure(sprintf($GLOBALS['DIC']->language()->txt('pwassist_disabled_no_access'), $settings->get('admin_email')), true);
57  return false;
58  }
59  }
60 
61  return true;
62  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ _getCommands()

static ilObjUserAccess::_getCommands ( )
static

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

21  {
22  die();
23  }

◆ canBeDelivered()

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

Implements ilWACCheckingClass.

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

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

71  {
72  global $DIC;
73 
74  $ilUser = $DIC['ilUser'];
75  $ilSetting = $DIC['ilSetting'];
76 
77  preg_match("/usr_(\\d*).*/ui", $ilWACPath->getFileName(), $matches);
78  $usr_id = $matches[1];
79 
80  // check if own image is viewed
81  if ($usr_id == $ilUser->getId()) {
82  return true;
83  }
84 
85  // check if image is in the public profile
86  $public_upload = ilObjUser::_lookupPref($usr_id, 'public_upload');
87  if ($public_upload != 'y') {
88  return false;
89  }
90 
91  // check the publication status of the profile
92  $public_profile = ilObjUser::_lookupPref($usr_id, 'public_profile');
93 
94  if ($public_profile == 'g' and $ilSetting->get('enable_global_profiles') and $ilSetting->get('pub_section')) {
95  // globally public
96  return true;
97  } elseif (($public_profile == 'y' or $public_profile == 'g') and $ilUser->getId() != ANONYMOUS_USER_ID && $ilUser->getId() != 0) {
98  // public for logged in users
99  return true;
100  } else {
101  // not public
102  return false;
103  }
104  }
global $DIC
Definition: saml.php:7
$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: