ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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="")
 Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 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)
 

Static Public Member Functions

static _getCommands ()
 get commands More...
 
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 = "" 
)

Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess)

Please do not check any preconditions handled by ilConditionHandler here. Also don't do any RBAC checks.

Parameters
string$a_cmdcommand (not permission!)
string$a_permissionpermission
int$a_ref_idreference id
int$a_obj_idobject id
int$a_user_iduser id (if not provided, current user is taken)
Returns
boolean true, if everything is ok

Reimplemented from ilObjectAccess.

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

Reimplemented from ilObjectAccess.

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

36 {
37 $settings = isset($GLOBALS['DIC']) ? $GLOBALS['DIC']->settings() : $GLOBALS['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 }
sprintf('%.4f', $callTime)
Class ilObjAuthSettingsGUI.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

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

+ Here is the call graph for this function:

◆ _getCommands()

static ilObjUserAccess::_getCommands ( )
static

get commands

this method returns an array of all possible commands/permission combinations

example: $commands = array ( array("permission" => "read", "cmd" => "view", "lang_var" => "show"), array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"), );

Reimplemented from ilObjectAccess.

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.

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

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

+ Here is the call graph for this function:

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