ILIAS
Release_4_3_x_branch Revision 61807
◀ ilDoc Overview
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
ILIAS
Todo List
Deprecated List
Modules
Namespaces
Data Structures
Files
File List
cron
include
Modules
Services
AccessControl
Accessibility
Accordion
Administration
AdvancedEditing
AdvancedMetaData
AuthApache
Authentication
AuthShibboleth
Block
Booking
Bookmarks
Cache
Calendar
Captcha
CAS
Certificate
Chart
Clipboard
Component
Contact
Container
ContainerReference
Context
COPage
CopyWizard
Database
DataSet
DidacticTemplate
Dom
EventHandling
Excel
Exceptions
Export
Feedback
Feeds
FileSystem
Form
Frameset
GoogleMaps
Help
History
Html
Http
Imprint
InfoScreen
Init
jQuery
JSON
Language
LDAP
License
classes
class.ilLicense.php
class.ilLicenseAccess.php
class.ilLicenseGUI.php
class.ilLicenseOverviewGUI.php
Link
LinkChecker
LoadTest
Locator
Logging
Mail
MainMenu
Math
MediaObjects
Membership
MetaData
Migration
Navigation
News
Notes
Notification
Notifications
Object
OpenId
OrgUnit
Payment
PEAR
PermanentLink
PersonalDesktop
PersonalWorkspace
PHPUnit
Portfolio
PrivacySecurity
QTI
Radius
Rating
Registration
Repository
RTE
Search
Skill
SOAPAuth
Style
Survey
Table
Tagging
Taxonomy
Tracking
Transformation
Tree
UIComponent
UICore
User
Utilities
Verification
VirusScanner
WebAccessChecker
WebDAV
WebServices
Workflow
XHTMLPage
XHTMLValidator
Xml
YUI
setup
sso
webservice
calendar.php
confirmReg.php
error.php
feed.php
goto.php
ilias.php
index.php
login.php
logout.php
payment.php
privfeed.php
pwassist.php
register.php
rootindex.php
sessioncheck.php
shib_login.php
shib_logout.php
start.php
studip_referrer.php
webdav.php
Globals
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Groups
Pages
class.ilLicenseAccess.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
14
class
ilLicenseAccess
15
{
22
static
function
_isEnabled
()
23
{
24
static
$enabled;
25
26
if
(isset($enabled))
27
{
28
return
$enabled;
29
}
30
31
$lic_set =
new
ilSetting
(
"license"
);
32
if
($lic_set->get(
"license_counter"
))
33
{
34
$enabled =
true
;
35
return
true
;
36
}
37
else
38
{
39
$enabled =
false
;
40
return
false
;
41
}
42
}
43
44
57
static
function
_checkAccess
($a_usr_id, $a_obj_id)
58
{
59
global $ilDB,
$ilUser
;
60
61
// check the object license
62
$query
=
'SELECT licenses, used FROM license_data WHERE obj_id = %s'
;
63
$result
= $ilDB->queryF(
$query
, array(
'integer'
), array($a_obj_id));
64
65
if
(
$row
= $ilDB->fetchObject(
$result
))
66
{
67
// no licenses set or at least one free => grant access
68
if
(
$row
->licenses == 0
69
or
$row
->used <
$row
->licenses)
70
{
71
return
true
;
72
}
73
}
74
else
75
{
76
// no license data available => access granted
77
return
true
;
78
}
79
80
// check if user has already accessed
81
$query
=
'SELECT read_count FROM read_event '
82
.
'WHERE usr_id = %s AND obj_id = %s'
;
83
84
$result
= $ilDB->queryF(
$query
,
85
array(
'integer'
,
'integer'
),
86
array($a_usr_id, $a_obj_id));
87
88
if
(
$row
= $ilDB->fetchObject(
$result
))
89
{
90
return
true
;
91
}
92
93
// all failed
94
return
false
;
95
}
96
}
97
98
?>
Services
License
classes
class.ilLicenseAccess.php
Generated on Sat Apr 23 2016 19:02:17 for ILIAS by
1.8.1.2 (using
Doxyfile
)