ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
4include_once("./Services/Object/classes/class.ilObjectAccess.php");
5require_once('./Services/WebAccessChecker/interfaces/interface.ilWACCheckingClass.php');
6
19
20 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 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}
Class ilObjUserAccess.
canBeDelivered(ilWACPath $ilWACPath)
_checkGoto($a_target)
check whether goto script will succeed
_getCommands()
get commands
_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::checkAcce...
_lookupPref($a_usr_id, $a_keyword)
Class ilObjectAccess.
Class ilWACPath.
Class ilWACCheckingClass.
global $ilSetting
Definition: privfeed.php:40
global $ilUser
Definition: imgupload.php:15