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

Singleton class that stores all privacy settings. More...

+ Collaboration diagram for ilPrivacySettings:

Public Member Functions

 getPrivacySettingsRefId ()
 
 enabledCourseExport ()
 
 enabledGroupExport ()
 
 checkExportAccess ($a_ref_id, $a_user_id=0)
 Check if a user has the permission to access approved user profile fields, course related user data and custom user data. More...
 
 enableCourseExport ($a_status)
 
 enableGroupExport ($a_status)
 
 enableForaStatistics ($a_status)
 write access to property fora statitics More...
 
 enabledForaStatistics ()
 read access to property enable fora statistics More...
 
 enableAnonymousFora ($a_status)
 write access to property anonymous fora More...
 
 enabledAnonymousFora ()
 read access to property enable anonymous fora More...
 
 enableRbacLog ($a_status)
 write access to property rbac_log More...
 
 enabledRbacLog ()
 read access to property enable rbac log More...
 
 setRbacLogAge ($a_age)
 write access to property rbac log age More...
 
 getRbacLogAge ()
 read access to property rbac log age More...
 
 confirmationRequired ($a_type)
 
 courseConfirmationRequired ()
 
 groupConfirmationRequired ()
 
 setCourseConfirmationRequired ($a_status)
 
 setGroupConfirmationRequired ($a_status)
 
 showGroupAccessTimes ($a_status)
 Show group last access times. More...
 
 enabledGroupAccessTimes ()
 check if group access time are visible More...
 
 showCourseAccessTimes ($a_status)
 show course access times More...
 
 enabledCourseAccessTimes ()
 check if access time are enabled in courses More...
 
 enabledAccessTimesByType ($a_obj_type)
 Check if access time are enabled for a specific type. More...
 
 save ()
 Save settings. More...
 
 validate ()
 validate settings More...
 
 enabledSahsProtocolData ()
 
 enableSahsProtocolData ($status)
 
 enabledExportSCORM ()
 
 enableExportSCORM ($a_status)
 

Static Public Member Functions

static _getInstance ()
 Get instance of ilPrivacySettings. More...
 

Private Member Functions

 __construct ()
 Private constructor: use _getInstance() More...
 
 read ()
 read settings More...
 

Private Attributes

 $db
 
 $settings
 
 $export_course
 
 $export_group
 
 $export_confirm_course
 
 $export_confirm_group
 
 $fora_statistics
 
 $anonymous_fora
 
 $rbac_log
 
 $rbac_log_age
 
 $show_grp_access_times
 
 $show_crs_access_times
 
 $ref_id
 
 $sahs_protocol_data
 
 $export_scorm
 

Static Private Attributes

static $instance = null
 

Detailed Description

Singleton class that stores all privacy settings.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

/

Definition at line 34 of file class.ilPrivacySettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilPrivacySettings::__construct ( )
private

Private constructor: use _getInstance()

@access private

Parameters

Definition at line 61 of file class.ilPrivacySettings.php.

62 {
63 global $ilSetting,$ilDB;
64
65 $this->db = $ilDB;
66 $this->settings = $ilSetting;
67
68 $this->read();
69 }
global $ilSetting
Definition: privfeed.php:17
settings()
Definition: settings.php:2
global $ilDB

References $ilDB, $ilSetting, read(), and settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getInstance()

static ilPrivacySettings::_getInstance ( )
static

Get instance of ilPrivacySettings.

@access public

Returns
\ilPrivacySettings

Definition at line 77 of file class.ilPrivacySettings.php.

78 {
79 if (is_object(self::$instance)) {
80 return self::$instance;
81 }
82 return self::$instance = new ilPrivacySettings();
83 }
Singleton class that stores all privacy settings.

References $instance.

Referenced by ilCourseParticipantsTableGUI\__construct(), ilGroupParticipantsTableGUI\__construct(), ilRegistrationGUI\__construct(), ilSCORM2004TrackingItemsTableGUI\__construct(), ilSCORMTrackingItemsTableGUI\__construct(), ilCourseEditParticipantsTableGUI\__construct(), ilGroupEditParticipantsTableGUI\__construct(), ilMemberAgreementGUI\__construct(), ilMemberExport\__construct(), ilMemberAgreement\__construct(), ilObjLearningResourcesSettingsGUI\addToExternalSettingsForm(), ilObjRoleFolderGUI\addToExternalSettingsForm(), ilObjPrivacySecurityGUI\addToExternalSettingsForm(), ilObjCourseGUI\checkAgreement(), ilObjGroupGUI\checkAgreement(), ilObjLearningResourcesSettingsGUI\editSettings(), ilMemberExportGUI\executeCommand(), ilObjSCORMLearningModule\exportSelected(), ilRbacLog\garbageCollection(), ilTrObjectUsersPropsTableGUI\getItems(), ilTrMatrixTableGUI\getItems(), ilMemberExport\getOrderedExportableFields(), ilCourseMembershipGUI\getPrintMemberData(), ilLPTableBaseGUI\getSelectableUserColumns(), ilObjSAHSLearningModuleGUI\getTabs(), ilSoapUserAdministration\getUserForRole(), ilObjCourseGUI\infoScreen(), ilObjGroupGUI\infoScreen(), ilMemberExportSettingsGUI\initForm(), ilParticipantTableGUI\initSettings(), ilObjRoleFolderGUI\initSettingsForm(), ilRbacLog\isActive(), ilObjSCORMLearningModuleGUI\modifyTrackingItems(), ilSCORM2004TrackingItemsPerUserFilterGUI\parse(), ilSCORMTrackingItemsPerUserFilterGUI\parse(), ilCourseParticipantsTableGUI\parse(), ilGroupParticipantsTableGUI\parse(), ilSCORMTrackingUsersTableGUI\parse(), ilObjCourseGUI\readMemberData(), ilObjGroupGUI\readMemberData(), ilSubscriberTableGUI\readSubscriberData(), ilWaitingListTableGUI\readUserData(), ilObjPrivacySecurityGUI\save_privacy(), ilObjUserFolderGUI\saveGlobalUserSettingsObject(), ilObjLearningResourcesSettingsGUI\saveSettings(), ilObjRoleFolderGUI\saveSettingsObject(), ilSAHSPresentationGUI\setInfoTabs(), ilObjCourseGUI\setSubTabs(), ilObjGroupGUI\setSubTabs(), ilMembershipGUI\setSubTabs(), ilObjPrivacySecurityGUI\showPrivacy(), and ilSCORMTrackingItems\userDataHeaderForExport().

+ Here is the caller graph for this function:

◆ checkExportAccess()

ilPrivacySettings::checkExportAccess (   $a_ref_id,
  $a_user_id = 0 
)

Check if a user has the permission to access approved user profile fields, course related user data and custom user data.

Todo:
rename
Parameters
object$a_ref_id
Returns

Definition at line 106 of file class.ilPrivacySettings.php.

107 {
108 global $ilUser,$ilAccess,$rbacsystem;
109
110 $user_id = $a_user_id ? $a_user_id : $ilUser->getId();
111
112 if (ilObject::_lookupType($a_ref_id, true) == 'crs') {
113 return $this->enabledCourseExport() and $ilAccess->checkAccessOfUser($user_id, 'manage_members', '', $a_ref_id) and $rbacsystem->checkAccessOfUser($user_id, 'export_member_data', $this->getPrivacySettingsRefId());
114 } else {
115 return $this->enabledGroupExport() and $ilAccess->checkAccessOfUser($user_id, 'manage_members', '', $a_ref_id) and $rbacsystem->checkAccessOfUser($user_id, 'export_member_data', $this->getPrivacySettingsRefId());
116 }
117 }
if($out) else
static _lookupType($a_id, $a_reference=false)
lookup object type
$ilUser
Definition: imgupload.php:18

References $ilUser, ilObject\_lookupType(), enabledCourseExport(), enabledGroupExport(), and getPrivacySettingsRefId().

+ Here is the call graph for this function:

◆ confirmationRequired()

ilPrivacySettings::confirmationRequired (   $a_type)

Definition at line 201 of file class.ilPrivacySettings.php.

202 {
203 switch ($a_type) {
204 case 'crs':
205 return $this->courseConfirmationRequired();
206
207 case 'grp':
208 return $this->groupConfirmationRequired();
209 }
210 return false;
211 }
$a_type
Definition: workflow.php:92

References $a_type, courseConfirmationRequired(), and groupConfirmationRequired().

+ Here is the call graph for this function:

◆ courseConfirmationRequired()

ilPrivacySettings::courseConfirmationRequired ( )

Definition at line 213 of file class.ilPrivacySettings.php.

References $export_confirm_course.

Referenced by confirmationRequired(), and save().

+ Here is the caller graph for this function:

◆ enableAnonymousFora()

ilPrivacySettings::enableAnonymousFora (   $a_status)

write access to property anonymous fora

Parameters
bool$a_statusvalue to set property

Definition at line 151 of file class.ilPrivacySettings.php.

152 {
153 $this->anonymous_fora = (bool) $a_status;
154 }

◆ enableCourseExport()

ilPrivacySettings::enableCourseExport (   $a_status)

Definition at line 119 of file class.ilPrivacySettings.php.

120 {
121 $this->export_course = (bool) $a_status;
122 }

◆ enabledAccessTimesByType()

ilPrivacySettings::enabledAccessTimesByType (   $a_obj_type)

Check if access time are enabled for a specific type.

Parameters
type$a_obj_type
Returns
type

Definition at line 284 of file class.ilPrivacySettings.php.

285 {
286 switch ($a_obj_type) {
287 case 'crs':
288 return $this->enabledCourseAccessTimes();
289
290 case 'grp':
291 return $this->enabledGroupAccessTimes();
292 }
293 }
enabledGroupAccessTimes()
check if group access time are visible
enabledCourseAccessTimes()
check if access time are enabled in courses

References enabledCourseAccessTimes(), and enabledGroupAccessTimes().

+ Here is the call graph for this function:

◆ enabledAnonymousFora()

ilPrivacySettings::enabledAnonymousFora ( )

read access to property enable anonymous fora

Returns
bool true if enabled, false otherwise

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

References $anonymous_fora.

Referenced by save().

+ Here is the caller graph for this function:

◆ enabledCourseAccessTimes()

ilPrivacySettings::enabledCourseAccessTimes ( )

check if access time are enabled in courses

@access public

Returns

Definition at line 274 of file class.ilPrivacySettings.php.

275 {
276 return (bool) $this->show_crs_access_times;
277 }

References $show_crs_access_times.

Referenced by enabledAccessTimesByType(), and save().

+ Here is the caller graph for this function:

◆ enabledCourseExport()

ilPrivacySettings::enabledCourseExport ( )

Definition at line 90 of file class.ilPrivacySettings.php.

References $export_course.

Referenced by checkExportAccess(), and save().

+ Here is the caller graph for this function:

◆ enabledExportSCORM()

ilPrivacySettings::enabledExportSCORM ( )

Definition at line 369 of file class.ilPrivacySettings.php.

References $export_scorm.

Referenced by save().

+ Here is the caller graph for this function:

◆ enabledForaStatistics()

ilPrivacySettings::enabledForaStatistics ( )

read access to property enable fora statistics

Returns
bool true if enabled, false otherwise

Definition at line 142 of file class.ilPrivacySettings.php.

References $fora_statistics.

Referenced by save().

+ Here is the caller graph for this function:

◆ enabledGroupAccessTimes()

ilPrivacySettings::enabledGroupAccessTimes ( )

check if group access time are visible

@access public

Definition at line 251 of file class.ilPrivacySettings.php.

252 {
253 return (bool) $this->show_grp_access_times;
254 }

References $show_grp_access_times.

Referenced by enabledAccessTimesByType(), and save().

+ Here is the caller graph for this function:

◆ enabledGroupExport()

ilPrivacySettings::enabledGroupExport ( )

Definition at line 95 of file class.ilPrivacySettings.php.

References $export_group.

Referenced by checkExportAccess(), and save().

+ Here is the caller graph for this function:

◆ enabledRbacLog()

ilPrivacySettings::enabledRbacLog ( )

read access to property enable rbac log

Returns
bool true if enabled, false otherwise

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

179 {
180 return $this->rbac_log;
181 }

References $rbac_log.

Referenced by save().

+ Here is the caller graph for this function:

◆ enabledSahsProtocolData()

ilPrivacySettings::enabledSahsProtocolData ( )

Definition at line 359 of file class.ilPrivacySettings.php.

360 {
361 return (int) $this->sahs_protocol_data;
362 }

References $sahs_protocol_data.

Referenced by save().

+ Here is the caller graph for this function:

◆ enableExportSCORM()

ilPrivacySettings::enableExportSCORM (   $a_status)

Definition at line 373 of file class.ilPrivacySettings.php.

374 {
375 $this->export_scorm = (bool) $a_status;
376 }

◆ enableForaStatistics()

ilPrivacySettings::enableForaStatistics (   $a_status)

write access to property fora statitics

Parameters
bool$a_statusvalue to set property

Definition at line 133 of file class.ilPrivacySettings.php.

134 {
135 $this->fora_statistics = (bool) $a_status;
136 }

◆ enableGroupExport()

ilPrivacySettings::enableGroupExport (   $a_status)

Definition at line 124 of file class.ilPrivacySettings.php.

125 {
126 $this->export_group = (bool) $a_status;
127 }

◆ enableRbacLog()

ilPrivacySettings::enableRbacLog (   $a_status)

write access to property rbac_log

Parameters
bool$a_statusvalue to set property

Definition at line 169 of file class.ilPrivacySettings.php.

170 {
171 $this->rbac_log = (bool) $a_status;
172 }

◆ enableSahsProtocolData()

ilPrivacySettings::enableSahsProtocolData (   $status)

Definition at line 363 of file class.ilPrivacySettings.php.

364 {
365 $this->sahs_protocol_data = (int) $status;
366 }

◆ getPrivacySettingsRefId()

ilPrivacySettings::getPrivacySettingsRefId ( )

Definition at line 85 of file class.ilPrivacySettings.php.

References $ref_id.

Referenced by checkExportAccess().

+ Here is the caller graph for this function:

◆ getRbacLogAge()

ilPrivacySettings::getRbacLogAge ( )

read access to property rbac log age

Returns
int

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

References $rbac_log_age.

Referenced by save().

+ Here is the caller graph for this function:

◆ groupConfirmationRequired()

ilPrivacySettings::groupConfirmationRequired ( )

Definition at line 218 of file class.ilPrivacySettings.php.

References $export_confirm_group.

Referenced by confirmationRequired(), and save().

+ Here is the caller graph for this function:

◆ read()

ilPrivacySettings::read ( )
private

read settings

@access private

Parameters

Definition at line 322 of file class.ilPrivacySettings.php.

323 {
324 global $ilDB;
325
326 $query = "SELECT object_reference.ref_id FROM object_reference,tree,object_data " .
327 "WHERE tree.parent = " . $ilDB->quote(SYSTEM_FOLDER_ID, 'integer') . " " .
328 "AND object_data.type = 'ps' " .
329 "AND object_reference.ref_id = tree.child " .
330 "AND object_reference.obj_id = object_data.obj_id";
331 $res = $this->db->query($query);
333 $this->ref_id = $row["ref_id"];
334
335 $this->export_course = (bool) $this->settings->get('ps_export_course', false);
336 $this->export_group = (bool) $this->settings->get('ps_export_group', false);
337 $this->export_confirm_course = (bool) $this->settings->get('ps_export_confirm', false);
338 $this->export_confirm_group = (bool) $this->settings->get('ps_export_confirm_group', false);
339 $this->fora_statistics = (bool) $this->settings->get('enable_fora_statistics', false);
340 $this->anonymous_fora = (bool) $this->settings->get('enable_anonymous_fora', false);
341 $this->show_grp_access_times = (bool) $this->settings->get('ps_access_times', false);
342 $this->show_crs_access_times = (bool) $this->settings->get('ps_crs_access_times', false);
343 $this->rbac_log = (bool) $this->settings->get('rbac_log', false);
344 $this->rbac_log_age = (int) $this->settings->get('rbac_log_age', 6);
345 $this->sahs_protocol_data = (int) $this->settings->get('enable_sahs_pd', 0);
346 $this->export_scorm = (bool) $this->settings->get('ps_export_scorm', false);
347 }
$query
foreach($_POST as $key=> $value) $res

References $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_ASSOC, and settings().

Referenced by __construct().

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

◆ save()

ilPrivacySettings::save ( )

Save settings.

Definition at line 300 of file class.ilPrivacySettings.php.

301 {
302 $this->settings->set('ps_export_confirm', (bool) $this->courseConfirmationRequired());
303 $this->settings->set('ps_export_confirm_group', (bool) $this->groupConfirmationRequired());
304 $this->settings->set('ps_export_course', (bool) $this->enabledCourseExport());
305 $this->settings->set('ps_export_group', (bool) $this->enabledGroupExport());
306 $this->settings->set('enable_fora_statistics', (bool) $this->enabledForaStatistics());
307 $this->settings->set('enable_anonymous_fora', (bool) $this->enabledAnonymousFora());
308 $this->settings->set('ps_access_times', (bool) $this->enabledGroupAccessTimes());
309 $this->settings->set('ps_crs_access_times', (bool) $this->enabledCourseAccessTimes());
310 $this->settings->set('rbac_log', (bool) $this->enabledRbacLog());
311 $this->settings->set('rbac_log_age', (int) $this->getRbacLogAge());
312 $this->settings->set('enable_sahs_pd', (int) $this->enabledSahsProtocolData());
313 $this->settings->set('ps_export_scorm', (bool) $this->enabledExportSCORM());
314 }
enabledRbacLog()
read access to property enable rbac log
enabledForaStatistics()
read access to property enable fora statistics
enabledAnonymousFora()
read access to property enable anonymous fora
getRbacLogAge()
read access to property rbac log age

References courseConfirmationRequired(), enabledAnonymousFora(), enabledCourseAccessTimes(), enabledCourseExport(), enabledExportSCORM(), enabledForaStatistics(), enabledGroupAccessTimes(), enabledGroupExport(), enabledRbacLog(), enabledSahsProtocolData(), getRbacLogAge(), groupConfirmationRequired(), and settings().

+ Here is the call graph for this function:

◆ setCourseConfirmationRequired()

ilPrivacySettings::setCourseConfirmationRequired (   $a_status)

Definition at line 223 of file class.ilPrivacySettings.php.

224 {
225 $this->export_confirm_course = (bool) $a_status;
226 }

◆ setGroupConfirmationRequired()

ilPrivacySettings::setGroupConfirmationRequired (   $a_status)

Definition at line 228 of file class.ilPrivacySettings.php.

229 {
230 $this->export_confirm_group = (bool) $a_status;
231 }

◆ setRbacLogAge()

ilPrivacySettings::setRbacLogAge (   $a_age)

write access to property rbac log age

Parameters
int$a_agevalue to set property

Definition at line 187 of file class.ilPrivacySettings.php.

188 {
189 $this->rbac_log_age = (int) $a_age;
190 }

◆ showCourseAccessTimes()

ilPrivacySettings::showCourseAccessTimes (   $a_status)

show course access times

@access public

Parameters
boolstatus
Returns

Definition at line 263 of file class.ilPrivacySettings.php.

264 {
265 $this->show_crs_access_times = $a_status;
266 }

◆ showGroupAccessTimes()

ilPrivacySettings::showGroupAccessTimes (   $a_status)

Show group last access times.

@access public

Parameters

Definition at line 240 of file class.ilPrivacySettings.php.

241 {
242 $this->show_grp_access_times = $a_status;
243 }

◆ validate()

ilPrivacySettings::validate ( )

validate settings

Returns
0, if everything is ok, an error code otherwise

Definition at line 354 of file class.ilPrivacySettings.php.

355 {
356 return 0;
357 }

Field Documentation

◆ $anonymous_fora

ilPrivacySettings::$anonymous_fora
private

Definition at line 45 of file class.ilPrivacySettings.php.

Referenced by enabledAnonymousFora().

◆ $db

ilPrivacySettings::$db
private

Definition at line 37 of file class.ilPrivacySettings.php.

◆ $export_confirm_course

ilPrivacySettings::$export_confirm_course
private

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

Referenced by courseConfirmationRequired().

◆ $export_confirm_group

ilPrivacySettings::$export_confirm_group
private

Definition at line 43 of file class.ilPrivacySettings.php.

Referenced by groupConfirmationRequired().

◆ $export_course

ilPrivacySettings::$export_course
private

Definition at line 40 of file class.ilPrivacySettings.php.

Referenced by enabledCourseExport().

◆ $export_group

ilPrivacySettings::$export_group
private

Definition at line 41 of file class.ilPrivacySettings.php.

Referenced by enabledGroupExport().

◆ $export_scorm

ilPrivacySettings::$export_scorm
private

Definition at line 52 of file class.ilPrivacySettings.php.

Referenced by enabledExportSCORM().

◆ $fora_statistics

ilPrivacySettings::$fora_statistics
private

Definition at line 44 of file class.ilPrivacySettings.php.

Referenced by enabledForaStatistics().

◆ $instance

ilPrivacySettings::$instance = null
staticprivate

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

Referenced by _getInstance().

◆ $rbac_log

ilPrivacySettings::$rbac_log
private

Definition at line 46 of file class.ilPrivacySettings.php.

Referenced by enabledRbacLog().

◆ $rbac_log_age

ilPrivacySettings::$rbac_log_age
private

Definition at line 47 of file class.ilPrivacySettings.php.

Referenced by getRbacLogAge().

◆ $ref_id

ilPrivacySettings::$ref_id
private

Definition at line 50 of file class.ilPrivacySettings.php.

Referenced by getPrivacySettingsRefId().

◆ $sahs_protocol_data

ilPrivacySettings::$sahs_protocol_data
private

Definition at line 51 of file class.ilPrivacySettings.php.

Referenced by enabledSahsProtocolData().

◆ $settings

ilPrivacySettings::$settings
private

Definition at line 38 of file class.ilPrivacySettings.php.

◆ $show_crs_access_times

ilPrivacySettings::$show_crs_access_times
private

Definition at line 49 of file class.ilPrivacySettings.php.

Referenced by enabledCourseAccessTimes().

◆ $show_grp_access_times

ilPrivacySettings::$show_grp_access_times
private

Definition at line 48 of file class.ilPrivacySettings.php.

Referenced by enabledGroupAccessTimes().


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