ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
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.
 enableCourseExport ($a_status)
 enableGroupExport ($a_status)
 enableForaStatistics ($a_status)
 write access to property fora statitics
 enabledForaStatistics ()
 read access to property enable fora statistics
 enableAnonymousFora ($a_status)
 write access to property anonymous fora
 enabledAnonymousFora ()
 read access to property enable anonymous fora
 enableRbacLog ($a_status)
 write access to property rbac_log
 enabledRbacLog ()
 read access to property enable rbac log
 setRbacLogAge ($a_age)
 write access to property rbac log age
 getRbacLogAge ()
 read access to property rbac log age
 confirmationRequired ($a_type)
 courseConfirmationRequired ()
 groupConfirmationRequired ()
 setCourseConfirmationRequired ($a_status)
 setGroupConfirmationRequired ($a_status)
 showGroupAccessTimes ($a_status)
 Show group last access times.
 enabledGroupAccessTimes ()
 check if group access time are visible
 showCourseAccessTimes ($a_status)
 show course access times
 enabledCourseAccessTimes ()
 check if access time are enabled in courses
 save ()
 Save settings.
 validate ()
 validate settings

Static Public Member Functions

static _getInstance ()
 Get instance of ilPrivacySettings.

Private Member Functions

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

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

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

ilPrivacySettings::__construct ( )
private

Private constructor: use _getInstance()

private

Parameters

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

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

{
global $ilSetting,$ilDB;
$this->db = $ilDB;
$this->settings = $ilSetting;
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

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 ilObject\_lookupObjId(), ilObject\_lookupType(), enabledCourseExport(), enabledGroupExport(), and getPrivacySettingsRefId().

{
global $ilUser,$ilAccess,$rbacsystem;
$user_id = $a_user_id ? $a_user_id : $ilUser->getId();
{
return $this->enabledCourseExport() and $ilAccess->checkAccessOfUser($user_id,'write','',$a_ref_id) and $rbacsystem->checkAccessOfUser($user_id,'export_member_data',$this->getPrivacySettingsRefId());
}
else
{
return $this->enabledGroupExport() and $ilAccess->checkAccessOfUser($user_id,'write','',$a_ref_id) and $rbacsystem->checkAccessOfUser($user_id,'export_member_data',$this->getPrivacySettingsRefId());
}
}

+ Here is the call graph for this function:

ilPrivacySettings::confirmationRequired (   $a_type)

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

References courseConfirmationRequired(), and groupConfirmationRequired().

{
switch($a_type)
{
case 'crs':
return $this->courseConfirmationRequired();
case 'grp':
return $this->groupConfirmationRequired();
}
return false;
}

+ Here is the call graph for this function:

ilPrivacySettings::courseConfirmationRequired ( )

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

References $export_confirm_course.

Referenced by confirmationRequired(), and save().

+ Here is the caller graph for this function:

ilPrivacySettings::enableAnonymousFora (   $a_status)

write access to property anonymous fora

Parameters
bool$a_statusvalue to set property

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

{
$this->anonymous_fora = (bool) $a_status;
}
ilPrivacySettings::enableCourseExport (   $a_status)

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

{
$this->export_course = (bool) $a_status;
}
ilPrivacySettings::enabledAnonymousFora ( )

read access to property enable anonymous fora

Returns
bool true if enabled, false otherwise

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

References $anonymous_fora.

Referenced by save().

{
}

+ Here is the caller graph for this function:

ilPrivacySettings::enabledCourseAccessTimes ( )

check if access time are enabled in courses

public

Returns

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

References $show_crs_access_times.

Referenced by save().

{
}

+ Here is the caller graph for this function:

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:

ilPrivacySettings::enabledForaStatistics ( )

read access to property enable fora statistics

Returns
bool true if enabled, false otherwise

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

References $fora_statistics.

Referenced by save().

+ Here is the caller graph for this function:

ilPrivacySettings::enabledGroupAccessTimes ( )

check if group access time are visible

public

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

References $show_grp_access_times.

Referenced by save().

{
}

+ Here is the caller graph for this function:

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:

ilPrivacySettings::enabledRbacLog ( )

read access to property enable rbac log

Returns
bool true if enabled, false otherwise

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

References $rbac_log.

Referenced by save().

{
}

+ Here is the caller graph for this function:

ilPrivacySettings::enableForaStatistics (   $a_status)

write access to property fora statitics

Parameters
bool$a_statusvalue to set property

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

{
$this->fora_statistics = (bool) $a_status;
}
ilPrivacySettings::enableGroupExport (   $a_status)

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

{
$this->export_group = (bool) $a_status;
}
ilPrivacySettings::enableRbacLog (   $a_status)

write access to property rbac_log

Parameters
bool$a_statusvalue to set property

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

{
$this->rbac_log = (bool) $a_status;
}
ilPrivacySettings::getPrivacySettingsRefId ( )

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

References $ref_id.

Referenced by checkExportAccess().

{
return $this->ref_id;
}

+ Here is the caller graph for this function:

ilPrivacySettings::getRbacLogAge ( )

read access to property rbac log age

Returns
int

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

References $rbac_log_age.

Referenced by save().

{
}

+ Here is the caller graph for this function:

ilPrivacySettings::groupConfirmationRequired ( )

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

References $export_confirm_group.

Referenced by confirmationRequired(), and save().

+ Here is the caller graph for this function:

ilPrivacySettings::read ( )
private

read settings

private

Parameters

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

References $ilDB, $query, $res, $row, and DB_FETCHMODE_ASSOC.

Referenced by __construct().

{
global $ilDB;
$query = "SELECT object_reference.ref_id FROM object_reference,tree,object_data ".
"WHERE tree.parent = ".$ilDB->quote(SYSTEM_FOLDER_ID,'integer')." ".
"AND object_data.type = 'ps' ".
"AND object_reference.ref_id = tree.child ".
"AND object_reference.obj_id = object_data.obj_id";
$res = $this->db->query($query);
$this->ref_id = $row["ref_id"];
$this->export_course = (bool) $this->settings->get('ps_export_course',false);
$this->export_group = (bool) $this->settings->get('ps_export_group',false);
$this->export_confirm_course = (bool) $this->settings->get('ps_export_confirm',false);
$this->export_confirm_group = (bool) $this->settings->get('ps_export_confirm_group',false);
$this->fora_statistics = (bool) $this->settings->get('enable_fora_statistics',false);
$this->anonymous_fora = (bool) $this->settings->get('enable_anonymous_fora',false);
$this->show_grp_access_times = (bool) $this->settings->get('ps_access_times',false);
$this->show_crs_access_times = (bool) $this->settings->get('ps_crs_access_times',false);
$this->rbac_log = (bool) $this->settings->get('rbac_log',false);
$this->rbac_log_age = (int) $this->settings->get('rbac_log_age',6);
}

+ Here is the caller graph for this function:

ilPrivacySettings::save ( )

Save settings.

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

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

{
$this->settings->set('ps_export_confirm',(bool) $this->courseConfirmationRequired());
$this->settings->set('ps_export_confirm_group',(bool) $this->groupConfirmationRequired());
$this->settings->set('ps_export_course',(bool) $this->enabledCourseExport());
$this->settings->set('ps_export_group',(bool) $this->enabledGroupExport());
$this->settings->set('enable_fora_statistics',(bool) $this->enabledForaStatistics());
$this->settings->set('enable_anonymous_fora',(bool) $this->enabledAnonymousFora());
$this->settings->set('ps_access_times',(bool) $this->enabledGroupAccessTimes());
$this->settings->set('ps_crs_access_times',(bool) $this->enabledCourseAccessTimes());
$this->settings->set('rbac_log',(bool) $this->enabledRbacLog());
$this->settings->set('rbac_log_age',(int) $this->getRbacLogAge());
}

+ Here is the call graph for this function:

ilPrivacySettings::setCourseConfirmationRequired (   $a_status)

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

{
$this->export_confirm_course = (bool) $a_status;
}
ilPrivacySettings::setGroupConfirmationRequired (   $a_status)

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

{
$this->export_confirm_group = (bool) $a_status;
}
ilPrivacySettings::setRbacLogAge (   $a_age)

write access to property rbac log age

Parameters
int$a_agevalue to set property

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

{
$this->rbac_log_age = (int) $a_age;
}
ilPrivacySettings::showCourseAccessTimes (   $a_status)

show course access times

public

Parameters
boolstatus
Returns

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

{
$this->show_crs_access_times = $a_status;
}
ilPrivacySettings::showGroupAccessTimes (   $a_status)

Show group last access times.

public

Parameters

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

{
$this->show_grp_access_times = $a_status;
}
ilPrivacySettings::validate ( )

validate settings

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

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

{
return 0;
}

Field Documentation

ilPrivacySettings::$anonymous_fora
private

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

Referenced by enabledAnonymousFora().

ilPrivacySettings::$db
private

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

ilPrivacySettings::$export_confirm_course
private

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

Referenced by courseConfirmationRequired().

ilPrivacySettings::$export_confirm_group
private

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

Referenced by groupConfirmationRequired().

ilPrivacySettings::$export_course
private

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

Referenced by enabledCourseExport().

ilPrivacySettings::$export_group
private

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

Referenced by enabledGroupExport().

ilPrivacySettings::$fora_statistics
private

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

Referenced by enabledForaStatistics().

ilPrivacySettings::$instance = null
staticprivate

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

Referenced by _getInstance().

ilPrivacySettings::$rbac_log
private

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

Referenced by enabledRbacLog().

ilPrivacySettings::$rbac_log_age
private

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

Referenced by getRbacLogAge().

ilPrivacySettings::$ref_id
private

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

Referenced by getPrivacySettingsRefId().

ilPrivacySettings::$settings
private

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

ilPrivacySettings::$show_crs_access_times
private

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

Referenced by enabledCourseAccessTimes().

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: