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()

private

Parameters

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

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

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

Member Function Documentation

◆ _getInstance()

static ilPrivacySettings::_getInstance ( )
static

Get instance of ilPrivacySettings.

public

Returns

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

Referenced by ilSCORMTrackingItemsTableGUI\__construct(), ilGroupParticipantsTableGUI\__construct(), ilCourseParticipantsTableGUI\__construct(), ilSCORM2004TrackingItemsTableGUI\__construct(), ilMemberAgreementGUI\__construct(), ilGroupEditParticipantsTableGUI\__construct(), ilMemberAgreement\__construct(), ilCourseEditParticipantsTableGUI\__construct(), ilRegistrationGUI\__construct(), ilMemberExport\__construct(), ilObjLearningResourcesSettingsGUI\addToExternalSettingsForm(), ilObjPrivacySecurityGUI\addToExternalSettingsForm(), ilObjRoleFolderGUI\addToExternalSettingsForm(), ilObjGroupGUI\checkAgreement(), ilObjCourseGUI\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(), ilMembershipGUI\jump2UsersGallery(), ilObjSCORMLearningModuleGUI\modifyTrackingItems(), ilSCORMTrackingItemsPerUserFilterGUI\parse(), ilSCORM2004TrackingItemsPerUserFilterGUI\parse(), ilSCORMTrackingUsersTableGUI\parse(), ilGroupParticipantsTableGUI\parse(), ilCourseParticipantsTableGUI\parse(), ilObjGroupGUI\readMemberData(), ilObjCourseGUI\readMemberData(), ilSubscriberTableGUI\readSubscriberData(), ilWaitingListTableGUI\readUserData(), ilObjPrivacySecurityGUI\save_privacy(), ilObjUserFolderGUI\saveGlobalUserSettingsObject(), ilObjLearningResourcesSettingsGUI\saveSettings(), ilObjRoleFolderGUI\saveSettingsObject(), ilSAHSPresentationGUI\setInfoTabs(), ilMembershipGUI\setSubTabs(), ilObjCourseGUI\setSubTabs(), ilObjGroupGUI\setSubTabs(), ilObjPrivacySecurityGUI\showPrivacy(), and ilSCORMTrackingItems\userDataHeaderForExport().

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.
+ 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.

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

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
$ilUser
Definition: imgupload.php:18
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:

◆ confirmationRequired()

ilPrivacySettings::confirmationRequired (   $a_type)

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

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

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
+ 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().

214  {
216  }
+ 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.

References enabledCourseAccessTimes(), and enabledGroupAccessTimes().

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
+ 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().

161  {
162  return $this->anonymous_fora;
163  }
+ Here is the caller graph for this function:

◆ enabledCourseAccessTimes()

ilPrivacySettings::enabledCourseAccessTimes ( )

check if access time are enabled in courses

public

Returns

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

References $show_crs_access_times.

Referenced by enabledAccessTimesByType(), and save().

275  {
276  return (bool) $this->show_crs_access_times;
277  }
+ 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().

91  {
92  return $this->export_course;
93  }
+ 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().

370  {
371  return $this->export_scorm;
372  }
+ 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().

143  {
144  return $this->fora_statistics;
145  }
+ Here is the caller graph for this function:

◆ enabledGroupAccessTimes()

ilPrivacySettings::enabledGroupAccessTimes ( )

check if group access time are visible

public

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

References $show_grp_access_times.

Referenced by enabledAccessTimesByType(), and save().

252  {
253  return (bool) $this->show_grp_access_times;
254  }
+ 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().

96  {
97  return $this->export_group;
98  }
+ 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.

References $rbac_log.

Referenced by save().

179  {
180  return $this->rbac_log;
181  }
+ Here is the caller graph for this function:

◆ enabledSahsProtocolData()

ilPrivacySettings::enabledSahsProtocolData ( )

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

References $sahs_protocol_data.

Referenced by save().

360  {
361  return (int) $this->sahs_protocol_data;
362  }
+ 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().

86  {
87  return $this->ref_id;
88  }
+ 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().

197  {
198  return $this->rbac_log_age;
199  }
+ 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().

219  {
221  }
+ Here is the caller graph for this function:

◆ read()

ilPrivacySettings::read ( )
private

read settings

private

Parameters

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

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

Referenced by __construct().

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  }
foreach($_POST as $key=> $value) $res
$query
settings()
Definition: settings.php:2
global $ilDB
+ 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.

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

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  }
enabledGroupAccessTimes()
check if group access time are visible
enabledCourseAccessTimes()
check if access time are enabled in courses
enabledForaStatistics()
read access to property enable fora statistics
enabledRbacLog()
read access to property enable rbac log
settings()
Definition: settings.php:2
enabledAnonymousFora()
read access to property enable anonymous fora
getRbacLogAge()
read access to property rbac log age
+ 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

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.

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.

◆ $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: