Public Member Functions | Static Private Member Functions | Static Private Attributes

ilObjPrivacySecurityGUI Class Reference

Inheritance diagram for ilObjPrivacySecurityGUI:
Collaboration diagram for ilObjPrivacySecurityGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 Contructor.
 executeCommand ()
 Execute command.
 getAdminTabs ()
 Get tabs.
 showPrivacy ()
 Show Privacy settings.
 showSecurity ()
 Show Privacy settings.
 save_privacy ()
 Save privacy settings.

Static Private Member Functions

static getErrorMessage ($code)
 return error message for error code

Static Private Attributes

static $ERROR_MESSAGE

Detailed Description

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


Constructor & Destructor Documentation

ilObjPrivacySecurityGUI::__construct ( a_data,
a_id,
a_call_by_reference = true,
a_prepare_output = true 
)

Contructor.

public

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

References $ERROR_MESSAGE, ilSecuritySettings::$SECURITY_SETTINGS_ERR_CODE_AUTO_HTTPS, ilSecuritySettings::$SECURITY_SETTINGS_ERR_CODE_HTTP_NOT_AVAILABLE, ilSecuritySettings::$SECURITY_SETTINGS_ERR_CODE_HTTPS_NOT_AVAILABLE, and ilObjectGUI::ilObjectGUI().

        {
                $this->type = 'ps';
                parent::ilObjectGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output);

                $this->lng->loadLanguageModule('ps');

                ilObjPrivacySecurityGUI::$ERROR_MESSAGE = array (
                   ilSecuritySettings::$SECURITY_SETTINGS_ERR_CODE_AUTO_HTTPS => $this->lng->txt("ps_error_message_https_header_missing"),
                   ilSecuritySettings::$SECURITY_SETTINGS_ERR_CODE_HTTPS_NOT_AVAILABLE => $this->lng->txt('https_not_possible'),
               ilSecuritySettings::$SECURITY_SETTINGS_ERR_CODE_HTTP_NOT_AVAILABLE => $this->lng->txt('http_not_possible')
                );
        }

Here is the call graph for this function:


Member Function Documentation

ilObjPrivacySecurityGUI::executeCommand (  ) 

Execute command.

public

Reimplemented from ilObjectGUI.

Definition at line 66 of file class.ilObjPrivacySecurityGUI.php.

References $cmd, $ilErr, $ret, and ilObjectGUI::prepareOutput().

        {
                global $rbacsystem,$ilErr,$ilAccess;

                $next_class = $this->ctrl->getNextClass($this);
                $cmd = $this->ctrl->getCmd();

                $this->prepareOutput();

                if(!$ilAccess->checkAccess('read','',$this->object->getRefId()))
                {
                        $ilErr->raiseError($this->lng->txt('no_permission'),$ilErr->WARNING);
                }

                switch($next_class)
                {
                        case 'ilpermissiongui':
                                $this->tabs_gui->setTabActive('perm_settings');
                                include_once("./classes/class.ilPermissionGUI.php");
                                $perm_gui =& new ilPermissionGUI($this);
                                $ret =& $this->ctrl->forwardCommand($perm_gui);
                                break;

                        default:
                                if(!$cmd || $cmd == 'view')
                                {
                                        $cmd = "showPrivacy";
                                }

                                $this->$cmd();
                                break;
                }
                return true;
        }

Here is the call graph for this function:

ilObjPrivacySecurityGUI::getAdminTabs (  ) 

Get tabs.

public

Definition at line 107 of file class.ilObjPrivacySecurityGUI.php.

        {
                global $rbacsystem;

                if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
                {
                        $this->tabs_gui->addTarget("show_privacy",
                                $this->ctrl->getLinkTarget($this, "showPrivacy"),
                                'showPrivacy');
            $this->tabs_gui->addTarget("show_security",
                                $this->ctrl->getLinkTarget($this, "showSecurity"),
                                'showSecurity');

                }

                if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
                {
                        $this->tabs_gui->addTarget("perm_settings",
                                $this->ctrl->getLinkTargetByClass('ilpermissiongui',"perm"),
                                array(),'ilpermissiongui');
                }
        }

static ilObjPrivacySecurityGUI::getErrorMessage ( code  )  [static, private]

return error message for error code

Parameters:
int $code
Returns:
string

Definition at line 314 of file class.ilObjPrivacySecurityGUI.php.

References $ERROR_MESSAGE.

Referenced by save_privacy().

Here is the caller graph for this function:

ilObjPrivacySecurityGUI::save_privacy (  ) 

Save privacy settings.

public

Definition at line 225 of file class.ilObjPrivacySecurityGUI.php.

References $ilErr, ilPrivacySettings::_getInstance(), ilCourseAgreement::_reset(), getErrorMessage(), ilUtil::sendInfo(), and showPrivacy().

        {
                global $ilErr,$ilAccess;

                if(!$ilAccess->checkAccess('write','',$this->object->getRefId()))
                {
                        $ilErr->raiseError($this->lng->txt('no_permission'),$ilErr->WARNING);
                }


                $privacy = ilPrivacySettings::_getInstance();
                $privacy->enableExport((int) $_POST['export_course']);
                $privacy->setConfirmationRequired((int) $_POST['export_confirm']);
                $privacy->enableForaStatistics ((int) $_POST['fora_statistics']);
                $privacy->showAccessTimes((int) $_POST['access_times']);

        // validate settings
        $code = $privacy->validate();

        // if error code != 0, display error and do not save
        if ($code != 0)
        {
            $msg = $this->getErrorMessage ($code);
            ilUtil::sendInfo($msg);
        } 
        else
        {
            $privacy->save();
                    include_once('Modules/Course/classes/class.ilCourseAgreement.php');
                    ilCourseAgreement::_reset();
                    ilUtil::sendInfo($this->lng->txt('settings_saved'));
        }

                $this->showPrivacy();
        }

Here is the call graph for this function:

ilObjPrivacySecurityGUI::showPrivacy (  ) 

Show Privacy settings.

public

Definition at line 135 of file class.ilObjPrivacySecurityGUI.php.

References ilPrivacySettings::_getInstance(), ilCourseAgreement::_hasAgreements(), and ilUtil::formCheckbox().

Referenced by save_privacy().

        {
                $privacy = ilPrivacySettings::_getInstance();

                $this->tabs_gui->setTabActive('show_privacy');
                $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.show_privacy.html','Services/PrivacySecurity');

                include_once('Modules/Course/classes/class.ilCourseAgreement.php');
                if(ilCourseAgreement::_hasAgreements())
                {
                        $this->tpl->setCurrentBlock('warning_modify');
                        $this->tpl->setVariable('TXT_WARNING',$this->lng->txt('ps_warning_modify'));
                        $this->tpl->parseCurrentBlock();
                }

                $this->tpl->setVariable('FORMACTION',$this->ctrl->getFormAction($this));
                $this->tpl->setVariable('TXT_PRIVACY_PROTECTION',$this->lng->txt('ps_privacy_protection'));
                $this->tpl->setVariable('TXT_PROFILE_EXPORT',$this->lng->txt('ps_profile_export'));
                $this->tpl->setVariable('TXT_EXPORT_COURSE',$this->lng->txt('ps_export_course'));
                $this->tpl->setVariable('TXT_EXPORT_CONFIRM',$this->lng->txt('ps_export_confirm'));
                $this->tpl->setVariable('TXT_GRP_ACCESS',$this->lng->txt('ps_show_grp_access'));

                // Check export
                $this->tpl->setVariable('CHECK_EXPORT_COURSE',ilUtil::formCheckbox($privacy->enabledExport() ? 1 : 0,'export_course',1));
                $this->tpl->setVariable('CHECK_EXPORT_CONFIRM',ilUtil::formCheckbox($privacy->confirmationRequired() ? 1 : 0,'export_confirm',1));
                $this->tpl->setVariable('CHECK_GRP_ACCESS',ilUtil::formCheckbox($privacy->enabledAccessTimes() ? 1 : 0,'access_times',1));

                // Fora statistics
                $this->tpl->setVariable('TXT_STATISTICS',$this->lng->txt('enable_fora_statistics'));
                $this->tpl->setVariable('TXT_FORA_STATISTICS',$this->lng->txt('enable_fora_statistics_desc'));
                $this->tpl->setVariable('CHECK_FORA_STATISTICS',ilUtil::formCheckbox($privacy->enabledForaStatistics() ? 1 : 0,'fora_statistics',1));
                

                $this->tpl->setVariable('TXT_SAVE',$this->lng->txt('save'));
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjPrivacySecurityGUI::showSecurity (  ) 

Show Privacy settings.

public

Definition at line 177 of file class.ilObjPrivacySecurityGUI.php.

References ilSecuritySettings::_getInstance().

        {
                include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
                
                $privacy = ilSecuritySettings::_getInstance();
                $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.show_security.html','Services/PrivacySecurity');

                $this->tabs_gui->setTabActive('show_security');

                $form = new ilPropertyFormGUI();
                $form->setFormAction($this->ctrl->getFormAction($this));
                $form->setTitle($this->lng->txt('ps_security_protection'));
                
                // Form checkbox
                $check = new ilCheckboxInputGUI($this->lng->txt('ps_auto_https'),'auto_https_detect_enabled');
                $check->setOptionTitle($this->lng->txt('ps_auto_https_description'));
                $check->setChecked($privacy->isAutomaticHTTPSEnabled() ? 1 : 0);
                $check->setValue(1);
                
                        $text = new ilTextInputGUI($this->lng->txt('ps_auto_https_header_name'),'auto_https_detect_header_name');
                        $text->setValue($privacy->getAutomaticHTTPSHeaderName());
                        $text->setSize(24);
                        $text->setMaxLength(64);
                $check->addSubItem($text);
                        
                        $text = new ilTextInputGUI($this->lng->txt('ps_auto_https_header_value'),'auto_https_detect_header_value');
                        $text->setValue($privacy->getAutomaticHTTPSHeaderValue());
                        $text->setSize(24);
                        $text->setMaxLength(64);
                
                $check->addSubItem($text);
                $form->addItem($check);

                $check2 = new ilCheckboxInputGUI($this->lng->txt('activate_https'),'https_enabled');
                $check2->setChecked($privacy->isHTTPSEnabled() ? 1 : 0);
                $check2->setValue(1);
                $form->addItem($check2);

                $form->addCommandButton('save_security',$this->lng->txt('save'));
                $this->tpl->setVariable('NEW_FORM',$form->getHTML());
        }

Here is the call graph for this function:


Field Documentation

ilObjPrivacySecurityGUI::$ERROR_MESSAGE [static, private]

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

Referenced by __construct(), and getErrorMessage().


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