ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilObjUserAccess.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Object/classes/class.ilObjectAccess.php");
5 require_once('./Services/WebAccessChecker/interfaces/interface.ilWACCheckingClass.php');
6 
19 
20  static function _getCommands() {
21  die();
22  }
23 
24 
25  function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = "") {
26  die();
27  }
28 
29 
33  static function _checkGoto($a_target) {
34  return true;
35  }
36 
37 
43  public function canBeDelivered(ilWACPath $ilWACPath) {
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  }
74 }
static _checkGoto($a_target)
check whether goto script will succeed
canBeDelivered(ilWACPath $ilWACPath)
Class ilWACPath.
Class ilObjUserAccess.
$ilUser
Definition: imgupload.php:18
Class ilWACCheckingClass.
_checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
Class ilObjectAccess.
global $ilSetting
Definition: privfeed.php:17
static _lookupPref($a_usr_id, $a_keyword)