ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjUserAccess Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 _checkAccess (string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id=null)
 
 canBeDelivered (ilWACPath $ilWACPath)
 
- Public Member Functions inherited from ilObjectAccess
 _checkAccess (string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id=null)
 Checks whether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 

Static Public Member Functions

static _getCommands ()
 
static _checkGoto (string $target)
 
- Static Public Member Functions inherited from ilObjectAccess
static _getCommands ()
 get commands More...
 
static _checkGoto (string $target)
 check whether goto script will succeed More...
 
static _isOffline (int $obj_id)
 Type-specific implementation of general status, has to be overwritten if object type does not support centralized offline handling. More...
 
static _preloadData (array $obj_ids, array $ref_ids)
 Preload data. More...
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilObjUserAccess

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

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

Member Function Documentation

◆ _checkAccess()

ilObjUserAccess::_checkAccess ( string  $cmd,
string  $permission,
int  $ref_id,
int  $obj_id,
?int  $user_id = null 
)

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

31  : bool
32  {
33  throw new ilException("_checkAccess must not be called on user object.");
34  }

◆ _checkGoto()

static ilObjUserAccess::_checkGoto ( string  $target)
static

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

References $DIC, $GLOBALS, ilRegistrationSettings\IL_REG_DISABLED, and ILIAS\UI\examples\Symbol\Glyph\Language\language().

36  : bool
37  {
38  global $DIC;
39  $main_tpl = $DIC->ui()->mainTemplate();
40  $settings = isset($GLOBALS['DIC']) ? $GLOBALS['DIC']->settings() : $GLOBALS['DIC']['ilSetting'];
41 
42  if ('usr_registration' == $target) {
43  $regSeetings = new ilRegistrationSettings();
44  if ($regSeetings->getRegistrationType() == ilRegistrationSettings::IL_REG_DISABLED) {
45  $GLOBALS['DIC']->language()->loadLanguageModule('registration');
46  $main_tpl->setOnScreenMessage('failure', sprintf($GLOBALS['DIC']->language()->txt('registration_disabled_no_access'), $settings->get('admin_email')), true);
47  return false;
48  }
49  } elseif ('usr_nameassist' == $target) {
50  if (!$settings->get('password_assistance')) {
51  $GLOBALS['DIC']->language()->loadLanguageModule('pwassist');
52  $main_tpl->setOnScreenMessage('failure', sprintf($GLOBALS['DIC']->language()->txt('unassist_disabled_no_access'), $settings->get('admin_email')), true);
53  return false;
54  }
55  } elseif ('usr_pwassist' == $target) {
56  if (!$settings->get('password_assistance')) {
57  $GLOBALS['DIC']->language()->loadLanguageModule('pwassist');
58  $main_tpl->setOnScreenMessage('failure', sprintf($GLOBALS['DIC']->language()->txt('pwassist_disabled_no_access'), $settings->get('admin_email')), true);
59  return false;
60  }
61  }
62 
63  return true;
64  }
$GLOBALS["DIC"]
Definition: wac.php:53
global $DIC
Definition: shib_login.php:22
Class ilObjAuthSettingsGUI.
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:

◆ _getCommands()

static ilObjUserAccess::_getCommands ( )
static

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

26  : array
27  {
28  throw new ilException("_getCommands must not be called on user object.");
29  }

◆ canBeDelivered()

ilObjUserAccess::canBeDelivered ( ilWACPath  $ilWACPath)

Implements ilWACCheckingClass.

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

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

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

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