ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 ilSCORM2004TrackingItemsTableGUI\__construct(), ilSCORMTrackingItemsTableGUI\__construct(), ilCourseParticipantsTableGUI\__construct(), ilGroupParticipantsTableGUI\__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(), ilObjSCORMLearningModuleGUI\modifyTrackingItems(), ilSCORM2004TrackingItemsPerUserFilterGUI\parse(), ilSCORMTrackingItemsPerUserFilterGUI\parse(), ilSCORMTrackingUsersTableGUI\parse(), ilGroupParticipantsTableGUI\parse(), ilCourseParticipantsTableGUI\parse(), ilMembershipGUI\printMembersOutput(), 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(), ilObjAICCLearningModuleGUI\showTrackingItems(), and ilSCORMTrackingItems\userDataHeaderForExport().

78  {
79  if(is_object(self::$instance))
80  {
81  return self::$instance;
82  }
83  return self::$instance = new ilPrivacySettings();
84  }
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 107 of file class.ilPrivacySettings.php.

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

108  {
109  global $ilUser,$ilAccess,$rbacsystem;
110 
111  $user_id = $a_user_id ? $a_user_id : $ilUser->getId();
112 
113  if(ilObject::_lookupType($a_ref_id, true) == 'crs')
114  {
115  return $this->enabledCourseExport() and $ilAccess->checkAccessOfUser($user_id,'manage_members','',$a_ref_id) and $rbacsystem->checkAccessOfUser($user_id,'export_member_data',$this->getPrivacySettingsRefId());
116  }
117  else
118  {
119  return $this->enabledGroupExport() and $ilAccess->checkAccessOfUser($user_id,'manage_members','',$a_ref_id) and $rbacsystem->checkAccessOfUser($user_id,'export_member_data',$this->getPrivacySettingsRefId());
120  }
121  }
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 205 of file class.ilPrivacySettings.php.

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

206  {
207  switch($a_type)
208  {
209  case 'crs':
210  return $this->courseConfirmationRequired();
211 
212  case 'grp':
213  return $this->groupConfirmationRequired();
214  }
215  return false;
216  }
$a_type
Definition: workflow.php:93
+ Here is the call graph for this function:

◆ courseConfirmationRequired()

ilPrivacySettings::courseConfirmationRequired ( )

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

References $export_confirm_course.

Referenced by confirmationRequired(), and save().

219  {
221  }
+ 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 155 of file class.ilPrivacySettings.php.

156  {
157  $this->anonymous_fora = (bool) $a_status;
158  }

◆ enableCourseExport()

ilPrivacySettings::enableCourseExport (   $a_status)

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

124  {
125  $this->export_course = (bool) $a_status;
126  }

◆ 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 289 of file class.ilPrivacySettings.php.

References enabledCourseAccessTimes(), and enabledGroupAccessTimes().

290  {
291  switch($a_obj_type)
292  {
293  case 'crs':
294  return $this->enabledCourseAccessTimes();
295 
296  case 'grp':
297  return $this->enabledGroupAccessTimes();
298  }
299 
300  }
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 164 of file class.ilPrivacySettings.php.

References $anonymous_fora.

Referenced by save().

165  {
166  return $this->anonymous_fora;
167  }
+ Here is the caller graph for this function:

◆ enabledCourseAccessTimes()

ilPrivacySettings::enabledCourseAccessTimes ( )

check if access time are enabled in courses

public

Returns

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

References $show_crs_access_times.

Referenced by enabledAccessTimesByType(), and save().

280  {
281  return (bool) $this->show_crs_access_times;
282  }
+ Here is the caller graph for this function:

◆ enabledCourseExport()

ilPrivacySettings::enabledCourseExport ( )

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

References $export_course.

Referenced by checkExportAccess(), and save().

92  {
93  return $this->export_course;
94  }
+ Here is the caller graph for this function:

◆ enabledExportSCORM()

ilPrivacySettings::enabledExportSCORM ( )

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

References $export_scorm.

Referenced by save().

377  {
378  return $this->export_scorm;
379  }
+ 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 146 of file class.ilPrivacySettings.php.

References $fora_statistics.

Referenced by save().

147  {
148  return $this->fora_statistics;
149  }
+ Here is the caller graph for this function:

◆ enabledGroupAccessTimes()

ilPrivacySettings::enabledGroupAccessTimes ( )

check if group access time are visible

public

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

References $show_grp_access_times.

Referenced by enabledAccessTimesByType(), and save().

257  {
258  return (bool) $this->show_grp_access_times;
259  }
+ Here is the caller graph for this function:

◆ enabledGroupExport()

ilPrivacySettings::enabledGroupExport ( )

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

References $export_group.

Referenced by checkExportAccess(), and save().

97  {
98  return $this->export_group;
99  }
+ 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 182 of file class.ilPrivacySettings.php.

References $rbac_log.

Referenced by save().

183  {
184  return $this->rbac_log;
185  }
+ Here is the caller graph for this function:

◆ enabledSahsProtocolData()

ilPrivacySettings::enabledSahsProtocolData ( )

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

References $sahs_protocol_data.

Referenced by save().

367  {
368  return (int) $this->sahs_protocol_data;
369  }
+ Here is the caller graph for this function:

◆ enableExportSCORM()

ilPrivacySettings::enableExportSCORM (   $a_status)

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

381  {
382  $this->export_scorm = (bool) $a_status;
383  }

◆ enableForaStatistics()

ilPrivacySettings::enableForaStatistics (   $a_status)

write access to property fora statitics

Parameters
bool$a_statusvalue to set property

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

138  {
139  $this->fora_statistics = (bool) $a_status;
140  }

◆ enableGroupExport()

ilPrivacySettings::enableGroupExport (   $a_status)

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

129  {
130  $this->export_group = (bool) $a_status;
131  }

◆ enableRbacLog()

ilPrivacySettings::enableRbacLog (   $a_status)

write access to property rbac_log

Parameters
bool$a_statusvalue to set property

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

174  {
175  $this->rbac_log = (bool) $a_status;
176  }

◆ enableSahsProtocolData()

ilPrivacySettings::enableSahsProtocolData (   $status)

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

371  {
372  $this->sahs_protocol_data = (int) $status;
373  }

◆ getPrivacySettingsRefId()

ilPrivacySettings::getPrivacySettingsRefId ( )

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

References $ref_id.

Referenced by checkExportAccess().

87  {
88  return $this->ref_id;
89  }
+ Here is the caller graph for this function:

◆ getRbacLogAge()

ilPrivacySettings::getRbacLogAge ( )

read access to property rbac log age

Returns
int

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

References $rbac_log_age.

Referenced by save().

201  {
202  return $this->rbac_log_age;
203  }
+ Here is the caller graph for this function:

◆ groupConfirmationRequired()

ilPrivacySettings::groupConfirmationRequired ( )

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

References $export_confirm_group.

Referenced by confirmationRequired(), and save().

224  {
226  }
+ Here is the caller graph for this function:

◆ read()

ilPrivacySettings::read ( )
private

read settings

private

Parameters

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

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

Referenced by __construct().

330  {
331  global $ilDB;
332 
333  $query = "SELECT object_reference.ref_id FROM object_reference,tree,object_data ".
334  "WHERE tree.parent = ".$ilDB->quote(SYSTEM_FOLDER_ID,'integer')." ".
335  "AND object_data.type = 'ps' ".
336  "AND object_reference.ref_id = tree.child ".
337  "AND object_reference.obj_id = object_data.obj_id";
338  $res = $this->db->query($query);
340  $this->ref_id = $row["ref_id"];
341 
342  $this->export_course = (bool) $this->settings->get('ps_export_course',false);
343  $this->export_group = (bool) $this->settings->get('ps_export_group',false);
344  $this->export_confirm_course = (bool) $this->settings->get('ps_export_confirm',false);
345  $this->export_confirm_group = (bool) $this->settings->get('ps_export_confirm_group',false);
346  $this->fora_statistics = (bool) $this->settings->get('enable_fora_statistics',false);
347  $this->anonymous_fora = (bool) $this->settings->get('enable_anonymous_fora',false);
348  $this->show_grp_access_times = (bool) $this->settings->get('ps_access_times',false);
349  $this->show_crs_access_times = (bool) $this->settings->get('ps_crs_access_times',false);
350  $this->rbac_log = (bool) $this->settings->get('rbac_log',false);
351  $this->rbac_log_age = (int) $this->settings->get('rbac_log_age',6);
352  $this->sahs_protocol_data = (int) $this->settings->get('enable_sahs_pd', 0);
353  $this->export_scorm = (bool) $this->settings->get('ps_export_scorm',false);
354  }
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 307 of file class.ilPrivacySettings.php.

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

308  {
309  $this->settings->set('ps_export_confirm',(bool) $this->courseConfirmationRequired());
310  $this->settings->set('ps_export_confirm_group',(bool) $this->groupConfirmationRequired());
311  $this->settings->set('ps_export_course',(bool) $this->enabledCourseExport());
312  $this->settings->set('ps_export_group',(bool) $this->enabledGroupExport());
313  $this->settings->set('enable_fora_statistics',(bool) $this->enabledForaStatistics());
314  $this->settings->set('enable_anonymous_fora',(bool) $this->enabledAnonymousFora());
315  $this->settings->set('ps_access_times',(bool) $this->enabledGroupAccessTimes());
316  $this->settings->set('ps_crs_access_times',(bool) $this->enabledCourseAccessTimes());
317  $this->settings->set('rbac_log',(bool) $this->enabledRbacLog());
318  $this->settings->set('rbac_log_age',(int) $this->getRbacLogAge());
319  $this->settings->set('enable_sahs_pd',(int) $this->enabledSahsProtocolData());
320  $this->settings->set('ps_export_scorm',(bool) $this->enabledExportSCORM());
321  }
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 228 of file class.ilPrivacySettings.php.

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

◆ setGroupConfirmationRequired()

ilPrivacySettings::setGroupConfirmationRequired (   $a_status)

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

234  {
235  $this->export_confirm_group = (bool) $a_status;
236  }

◆ setRbacLogAge()

ilPrivacySettings::setRbacLogAge (   $a_age)

write access to property rbac log age

Parameters
int$a_agevalue to set property

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

192  {
193  $this->rbac_log_age = (int) $a_age;
194  }

◆ showCourseAccessTimes()

ilPrivacySettings::showCourseAccessTimes (   $a_status)

show course access times

public

Parameters
boolstatus
Returns

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

269  {
270  $this->show_crs_access_times = $a_status;
271  }

◆ showGroupAccessTimes()

ilPrivacySettings::showGroupAccessTimes (   $a_status)

Show group last access times.

public

Parameters

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

246  {
247  $this->show_grp_access_times = $a_status;
248  }

◆ validate()

ilPrivacySettings::validate ( )

validate settings

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

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

362  {
363  return 0;
364  }

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: