ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjMediaCastAccess Class Reference

Class ilObjMediaCastAccess. More...

+ Inheritance diagram for ilObjMediaCastAccess:
+ Collaboration diagram for ilObjMediaCastAccess:

Public Member Functions

 __construct ()
 Constructor. More...
 
 _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...
 
- 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...
 

Static Public Member Functions

static _getCommands ()
 get commands More...
 
static _checkGoto ($a_target)
 check whether goto script will succeed More...
 
static _lookupOnline ($a_id)
 Check wether media cast is online. More...
 
static _lookupPublicFiles ($a_id)
 Check wether files should be public. More...
 
static _lookupDiskUsage ($a_id)
 Returns the number of bytes used on the harddisk by the file object with the specified object id. 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...
 

Protected Attributes

 $user
 
 $lng
 
 $rbacsystem
 
 $access
 

Detailed Description

Class ilObjMediaCastAccess.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id
class.ilObjMediaCastAccess.php 12772 2006-12-07 09:34:01Z akill

Definition at line 16 of file class.ilObjMediaCastAccess.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjMediaCastAccess::__construct ( )

Constructor.

Definition at line 42 of file class.ilObjMediaCastAccess.php.

43 {
44 global $DIC;
45
46 $this->user = $DIC->user();
47 $this->lng = $DIC->language();
48 $this->rbacsystem = $DIC->rbac()->system();
49 $this->access = $DIC->access();
50 }
user()
Definition: user.php:4
global $DIC
Definition: saml.php:7

References $DIC, and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _checkAccess()

ilObjMediaCastAccess::_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)

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 89 of file class.ilObjMediaCastAccess.php.

90 {
94 $ilAccess = $this->access;
95
96 if ($a_user_id == "") {
97 $a_user_id = $ilUser->getId();
98 }
99
100 switch ($a_cmd) {
101 case "listItems":
102
104 && !$rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id)) {
105 $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
106 return false;
107 }
108 break;
109
110 // for permission query feature
111 case "infoScreen":
112 if (!ilObjMediaCastAccess::_lookupOnline($a_obj_id)) {
113 $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
114 } else {
115 $ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt("online"));
116 }
117 break;
118
119 }
120 switch ($a_permission) {
121 case "read":
122 case "visible":
123 if (!ilObjMediaCastAccess::_lookupOnline($a_obj_id) &&
124 (!$rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id))) {
125 $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
126 return false;
127 }
128 break;
129 }
130
131 return true;
132 }
const IL_STATUS_MESSAGE
const IL_NO_OBJECT_ACCESS
static _lookupOnline($a_id)
Check wether media cast is online.
$ilUser
Definition: imgupload.php:18

References $access, $ilUser, $lng, $rbacsystem, $user, _lookupOnline(), IL_NO_OBJECT_ACCESS, and IL_STATUS_MESSAGE.

+ Here is the call graph for this function:

◆ _checkGoto()

static ilObjMediaCastAccess::_checkGoto (   $a_target)
static

check whether goto script will succeed

Reimplemented from ilObjectAccess.

Definition at line 137 of file class.ilObjMediaCastAccess.php.

138 {
139 global $DIC;
140
141 $ilAccess = $DIC->access();
142
143 $t_arr = explode("_", $a_target);
144
145 if ($t_arr[0] != "mcst" || ((int) $t_arr[1]) <= 0) {
146 return false;
147 }
148
149 if ($ilAccess->checkAccess("read", "", $t_arr[1])) {
150 return true;
151 }
152 return false;
153 }

References $DIC.

◆ _getCommands()

static ilObjMediaCastAccess::_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 65 of file class.ilObjMediaCastAccess.php.

66 {
67 $commands = array(
68 array("permission" => "read", "cmd" => "showContent", "lang_var" => "show",
69 "default" => true),
70 array("permission" => "write", "cmd" => "listItems", "lang_var" => "edit_content"),
71 array("permission" => "write", "cmd" => "editSettings", "lang_var" => "settings")
72 );
73
74 return $commands;
75 }

Referenced by ilObjMediaCastListGUI\init().

+ Here is the caller graph for this function:

◆ _lookupDiskUsage()

static ilObjMediaCastAccess::_lookupDiskUsage (   $a_id)
static

Returns the number of bytes used on the harddisk by the file object with the specified object id.

Parameters
intobject id of a file object.

Definition at line 196 of file class.ilObjMediaCastAccess.php.

197 {
198 require_once('Modules/MediaCast/classes/class.ilObjMediaCast.php');
199 require_once("./Services/News/classes/class.ilNewsItem.php");
200 require_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
201 $obj = new ilObjMediaCast($a_id, false);
202 $obj->read();
203 $items = $obj->getItemsArray();
204 $size = 0;
205 foreach ($items as $item) {
206 $news_item = new ilNewsItem($item["id"]);
207 $news_item->read();
208 $mobId = $news_item->getMobId();
210 }
211 return $size;
212 }
$size
Definition: RandomTest.php:84
Class ilObjMediaCast.
static _getDirectory($a_mob_id)
get directory for files of media object (static)
static dirsize($directory)
get size of a directory or a file.

References $size, ilObjMediaObject\_getDirectory(), and ilUtil\dirsize().

Referenced by ilObjMediaCast\getDiskUsage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookupOnline()

static ilObjMediaCastAccess::_lookupOnline (   $a_id)
static

Check wether media cast is online.

Parameters
int$a_idmedia cast id

Definition at line 160 of file class.ilObjMediaCastAccess.php.

161 {
162 global $DIC;
163
164 $ilDB = $DIC->database();
165
166 $q = "SELECT * FROM il_media_cast_data WHERE id = " . $ilDB->quote($a_id);
167 $mc_set = $ilDB->query($q);
168 $mc_rec = $mc_set->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
169
170 return $mc_rec["is_online"];
171 }
global $ilDB

References $DIC, $ilDB, and ilDBConstants\FETCHMODE_ASSOC.

Referenced by ilObjectFeedWriter\__construct(), ilUserFeedWriter\__construct(), _checkAccess(), and ilObjMediaCastListGUI\getProperties().

+ Here is the caller graph for this function:

◆ _lookupPublicFiles()

static ilObjMediaCastAccess::_lookupPublicFiles (   $a_id)
static

Check wether files should be public.

Parameters
int$a_idmedia cast id

Definition at line 178 of file class.ilObjMediaCastAccess.php.

179 {
180 global $DIC;
181
182 $ilDB = $DIC->database();
183
184 $q = "SELECT * FROM il_media_cast_data WHERE id = " . $ilDB->quote($a_id);
185 $mc_set = $ilDB->query($q);
186 $mc_rec = $mc_set->fetchRow(ilDBConstants::FETCHMODE_ASSOC);
187
188 return $mc_rec["public_files"];
189 }

References $DIC, $ilDB, and ilDBConstants\FETCHMODE_ASSOC.

Referenced by ilObjectFeedWriter\__construct().

+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilObjMediaCastAccess::$access
protected

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

Referenced by _checkAccess().

◆ $lng

ilObjMediaCastAccess::$lng
protected

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

Referenced by _checkAccess().

◆ $rbacsystem

ilObjMediaCastAccess::$rbacsystem
protected

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

Referenced by _checkAccess().

◆ $user

ilObjMediaCastAccess::$user
protected

Definition at line 21 of file class.ilObjMediaCastAccess.php.

Referenced by _checkAccess().


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