ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLicenseAccess Class Reference
+ Collaboration diagram for ilLicenseAccess:

Static Public Member Functions

static _isEnabled ()
 Check, if licencing is enabled This check is called from the ilAccessHandler class.
static _checkAccess ($a_usr_id, $a_obj_id)
 Check, if a user can access an object by license.

Detailed Description

Definition at line 14 of file class.ilLicenseAccess.php.

Member Function Documentation

static ilLicenseAccess::_checkAccess (   $a_usr_id,
  $a_obj_id 
)
static

Check, if a user can access an object by license.

The user can access, if he/she already accessed the object or if a license is available for the object. This check is called from the ilAccessHandler class.

static

Parameters
intuser id
intobject id (not reference)
Returns
boolean access is possible (true/false)

Definition at line 57 of file class.ilLicenseAccess.php.

References $ilUser, $query, $result, and $row.

Referenced by ilAccessHandler\doLicenseCheck().

{
global $ilDB, $ilUser;
// check the object license
$query = 'SELECT licenses, used FROM license_data WHERE obj_id = %s';
$result = $ilDB->queryF($query, array('integer'), array($a_obj_id));
if ($row = $ilDB->fetchObject($result))
{
// no licenses set or at least one free => grant access
if ($row->licenses == 0
or $row->used < $row->licenses)
{
return true;
}
}
else
{
// no license data available => access granted
return true;
}
// check if user has already accessed
$query = 'SELECT read_count FROM read_event '
.'WHERE usr_id = %s AND obj_id = %s';
$result = $ilDB->queryF($query,
array('integer','integer'),
array($a_usr_id, $a_obj_id));
if ($row = $ilDB->fetchObject($result))
{
return true;
}
// all failed
return false;
}

+ Here is the caller graph for this function:

static ilLicenseAccess::_isEnabled ( )
static

Check, if licencing is enabled This check is called from the ilAccessHandler class.

Returns
boolean licensing enabled (true/false)

Definition at line 22 of file class.ilLicenseAccess.php.

Referenced by ilLicense\_noteAccess(), ilObjCourseGUI\checkLicenses(), ilAccessHandler\doLicenseCheck(), ilObjLearningResourcesSettingsGUI\getAdminTabs(), ilObjSAHSLearningModuleGUI\getTabs(), ilObjFileBasedLMGUI\getTabs(), and ilObjCourseGUI\getTabs().

{
static $enabled;
if (isset($enabled))
{
return $enabled;
}
$lic_set = new ilSetting("license");
if ($lic_set->get("license_counter"))
{
$enabled = true;
return true;
}
else
{
$enabled = false;
return false;
}
}

+ Here is the caller graph for this function:


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