ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPersonalSettingsGUI Class Reference

GUI class for personal profile. More...

+ Collaboration diagram for ilPersonalSettingsGUI:

Public Member Functions

 __construct ()
 constructor
executeCommand ()
 execute command
 changeUserPassword ()
 change user password
 saveMailOptions ()
 Called if the user pushes the submit button of the mail options form.
 showMailOptions ()
 Called to display the mail options form.
 showjsMath ()
 savejsMath ()
 __initSubTabs ($a_cmd)
 saveChatOptions ()
 setHeader ()
 Set header.
 showChatOptions ($by_post=false)
 show Chat Settings
 showPassword ($a_no_init=false)
 Password form.
 initPasswordForm ()
 Init password form.
 allowPasswordChange ()
 Check, whether password change is allowed for user.
 savePassword ()
 Save password form.
 workWithUserSetting ($setting)
 Returns TRUE if working with the given user setting is allowed, FALSE otherwise.
 userSettingVisible ($setting)
 Returns TRUE if user setting is visible, FALSE otherwise.
 userSettingEnabled ($setting)
 Returns TRUE if user setting is enabled, FALSE otherwise.
 showGeneralSettings ($a_no_init=false)
 General settings form.
 initGeneralSettingsForm ()
 Init general settings form.
 saveGeneralSettings ()
 Save general settings.

Data Fields

 $tpl
 $lng
 $ilias
 $ctrl

Private Member Functions

 initMailOptionsForm ()
 Initialises the mail options form.
 setMailOptionsValuesByDB ()
 Fetches data from model and loads this data into form.
 getChatSettingsForm ()

Detailed Description

GUI class for personal profile.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$ ilPersonalSettingsGUI:

Definition at line 11 of file class.ilPersonalSettingsGUI.php.

Constructor & Destructor Documentation

ilPersonalSettingsGUI::__construct ( )

constructor

Definition at line 21 of file class.ilPersonalSettingsGUI.php.

References $ilCtrl, $ilias, $lng, $tpl, and ilUserDefinedFields\_getInstance().

{
global $ilias, $tpl, $lng, $rbacsystem, $ilCtrl;
include_once './Services/User/classes/class.ilUserDefinedFields.php';
$this->user_defined_fields =& ilUserDefinedFields::_getInstance();
$this->tpl =& $tpl;
$this->lng =& $lng;
$this->ilias =& $ilias;
$this->ctrl =& $ilCtrl;
$this->settings = $ilias->getAllSettings();
$lng->loadLanguageModule("jsmath");
$this->upload_error = "";
$this->password_error = "";
$lng->loadLanguageModule("user");
$ilCtrl->saveParameter($this, "user_page");
}

+ Here is the call graph for this function:

Member Function Documentation

ilPersonalSettingsGUI::__initSubTabs (   $a_cmd)

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

References $ilSetting, and allowPasswordChange().

Referenced by saveMailOptions(), showChatOptions(), showGeneralSettings(), showjsMath(), showMailOptions(), and showPassword().

{
global $ilTabs, $ilSetting;
$showPassword = ($a_cmd == 'showPassword') ? true : false;
$showGeneralSettings = ($a_cmd == 'showGeneralSettings') ? true : false;
$showMailOptions = ($a_cmd == 'showMailOptions') ? true : false;
$showjsMath = ($a_cmd == 'showjsMath') ? true : false;
$showChatOptions = ($a_cmd == 'showChatOptions') ? true : false;
// old profile
// general settings
$ilTabs->addTarget("general_settings", $this->ctrl->getLinkTarget($this, "showGeneralSettings"),
"", "", "", $showGeneralSettings);
// password
if ($this->allowPasswordChange())
{
$ilTabs->addTarget("password", $this->ctrl->getLinkTarget($this, "showPassword"),
"", "", "", $showPassword);
}
$ilTabs->addTarget("mail_settings", $this->ctrl->getLinkTarget($this, "showMailOptions"),
"", "", "", $showMailOptions);
if(((int)$ilSetting->get('chat_sound_status') &&
((int)$ilSetting->get('chat_new_invitation_sound_status') ||
(int)$ilSetting->get('chat_new_message_sound_status'))) ||
(int)$ilSetting->get('chat_message_notify_status') == 1)
{
$ilTabs->addTarget("chat_settings", $this->ctrl->getLinkTarget($this, "showChatOptions"),
"", "", "", $showChatOptions);
}
include_once "./Services/Administration/classes/class.ilSetting.php";
$jsMathSetting = new ilSetting("jsMath");
if ($jsMathSetting->get("enable"))
{
$ilTabs->addTarget("jsmath_extt_jsmath", $this->ctrl->getLinkTarget($this, "showjsMath"),
"", "", "", $showjsMath);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPersonalSettingsGUI::allowPasswordChange ( )

Check, whether password change is allowed for user.

Definition at line 676 of file class.ilPersonalSettingsGUI.php.

References $ilSetting, AUTH_CAS, AUTH_LOCAL, AUTH_OPENID, AUTH_SHIBBOLETH, AUTH_SOAP, ilAuthUtils\isPasswordModificationEnabled(), and userSettingVisible().

Referenced by __initSubTabs(), initPasswordForm(), and savePassword().

{
global $ilUser, $ilSetting;
return ilAuthUtils::isPasswordModificationEnabled($ilUser->getAuthMode(true));
// Moved to ilAuthUtils
// do nothing if auth mode is not local database
if ($ilUser->getAuthMode(true) != AUTH_LOCAL &&
($ilUser->getAuthMode(true) != AUTH_CAS || !$ilSetting->get("cas_allow_local")) &&
($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || !$ilSetting->get("shib_auth_allow_local")) &&
($ilUser->getAuthMode(true) != AUTH_SOAP || !$ilSetting->get("soap_auth_allow_local")) &&
($ilUser->getAuthMode(true) != AUTH_OPENID)
)
{
return false;
}
if (!$this->userSettingVisible('password') ||
$this->ilias->getSetting('usr_settings_disable_password'))
{
return false;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPersonalSettingsGUI::changeUserPassword ( )

change user password

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

References $_POST, $ilSetting, AUTH_CAS, AUTH_LOCAL, AUTH_SHIBBOLETH, AUTH_SOAP, ilUtil\isPassword(), and ilUtil\sendSuccess().

{
global $ilUser, $ilSetting;
// do nothing if auth mode is not local database
if ($ilUser->getAuthMode(true) != AUTH_LOCAL &&
($ilUser->getAuthMode(true) != AUTH_CAS || !$ilSetting->get("cas_allow_local")) &&
($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || !$ilSetting->get("shib_auth_allow_local")) &&
($ilUser->getAuthMode(true) != AUTH_SOAP || !$ilSetting->get("soap_auth_allow_local"))
)
{
$this->password_error = $this->lng->txt("not_changeable_for_non_local_auth");
}
// select password from auto generated passwords
if ($this->ilias->getSetting("passwd_auto_generate") == 1)
{
// The old password needs to be checked for verification
// unless the user uses Shibboleth authentication with additional
// local authentication for WebDAV.
if ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || ! $ilSetting->get("shib_auth_allow_local"))
{
// check old password
if (md5($_POST["current_password"]) != $ilUser->getPasswd())
{
$this->password_error = $this->lng->txt("passwd_wrong");
}
}
// validate transmitted password
if (!ilUtil::isPassword($_POST["new_passwd"]))
{
$this->password_error = $this->lng->txt("passwd_not_selected");
}
if (empty($this->password_error))
{
ilUtil::sendSuccess($this->lng->txt("saved_successfully"));
$ilUser->updatePassword($_POST["current_password"], $_POST["new_passwd"], $_POST["new_passwd"]);
}
}
else
{
// check old password
if (md5($_POST["current_password"]) != $ilUser->getPasswd())
{
$this->password_error = $this->lng->txt("passwd_wrong");
}
// check new password
else if ($_POST["desired_password"] != $_POST["retype_password"])
{
$this->password_error = $this->lng->txt("passwd_not_match");
}
// validate password
else if (!ilUtil::isPassword($_POST["desired_password"],$custom_error))
{
if( $custom_error != '' )
$this->password_error = $custom_error;
else $this->password_error = $this->lng->txt("passwd_invalid");
}
else if ($_POST["current_password"] != "" and empty($this->password_error))
{
if( $ilUser->isPasswordExpired() || $ilUser->isPasswordChangeDemanded() )
{
if( $_POST["current_password"] != $_POST["desired_password"] )
{
if( $ilUser->updatePassword($_POST["current_password"], $_POST["desired_password"], $_POST["retype_password"]) )
{
ilUtil::sendSuccess($this->lng->txt("saved_successfully"));
$ilUser->setLastPasswordChangeToNow();
}
}
else
{
$this->password_error = $this->lng->txt("new_pass_equals_old_pass");
}
}
else
{
ilUtil::sendSuccess($this->lng->txt("saved_successfully"));
$ilUser->updatePassword($_POST["current_password"], $_POST["desired_password"], $_POST["retype_password"]);
$ilUser->setLastPasswordChangeToNow();
}
}
}
$this->saveProfile();
}

+ Here is the call graph for this function:

& ilPersonalSettingsGUI::executeCommand ( )

execute command

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

References $cmd, $ilCtrl, $lng, $tpl, and ilUtil\sendInfo().

{
global $ilUser, $ilCtrl, $tpl, $ilTabs, $lng;
$next_class = $this->ctrl->getNextClass();
switch($next_class)
{
default:
$cmd = $this->ctrl->getCmd("showGeneralSettings");
// check whether password of user have to be changed
// due to first login or password of user is expired
if( $ilUser->isPasswordChangeDemanded() && $cmd != 'savePassword' )
{
$cmd = 'showPassword';
$this->lng->txt('password_change_on_first_login_demand'), true
);
}
elseif( $ilUser->isPasswordExpired() && $cmd != 'savePassword' )
{
$cmd = 'showPassword';
$msg = $this->lng->txt('password_expired');
$password_age = $ilUser->getPasswordAge();
ilUtil::sendInfo( sprintf($msg,$password_age), true );
}
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilPersonalSettingsGUI::getChatSettingsForm ( )
private

Definition at line 427 of file class.ilPersonalSettingsGUI.php.

References $ilCtrl, $ilSetting, and $lng.

Referenced by showChatOptions().

{
$lng->loadLanguageModule('chat');
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, 'saveChatOptions'));
$form->setTitle($lng->txt("chat_settings"));
if((int)$ilSetting->get('chat_message_notify_status'))
{
// chat message notification in ilias
//$rg_parent = new ilRadioGroupInputGUI($this->lng->txt('chat_message_notify'), 'chat_message_notify_status');
//$rg_parent->setValue(0);
$ro_parent = new ilCheckboxInputGUI($this->lng->txt('chat_message_notify_activate'), 'chat_message_notify_activate');
//$rg_parent->addOption($ro_parent);
#$ro_parent->setValue(0);
if((int)$ilSetting->get('chat_sound_status') &&
((int)$ilSetting->get('chat_new_invitation_sound_status') ||
(int)$ilSetting->get('chat_new_message_sound_status')))
{
// sound activation/deactivation for new chat invitations and messages
#$rg = new ilRadioGroupInputGUI($this->lng->txt('chat_sounds'), 'chat_sound_status');
#$rg->setValue(0);
#$ro = new ilCheckboxInputGUI($this->lng->txt('chat_sound_status_activate'), 1);
if((int)$ilSetting->get('chat_new_invitation_sound_status'))
{
$chb = new ilCheckboxInputGUI('', 'chat_new_invitation_sound_status');
$chb->setOptionTitle($this->lng->txt('chat_new_invitation_sound_status'));
$chb->setChecked(false);
$ro_parent->addSubItem($chb);
}
if((int)$ilSetting->get('chat_new_message_sound_status'))
{
$chb = new ilCheckBoxInputGUI('','chat_new_message_sound_status');
$chb->setOptionTitle($this->lng->txt('chat_new_message_sound_status'));
$chb->setChecked(false);
$ro_parent->addSubItem($chb);
}
#$rg->addOption($ro);
//$ro = new ilRadioOption($this->lng->txt('chat_sound_status_deactivate'), 0);
//$rg->addOption($ro);
#$ro_parent->addSubItem($rg);
//$form->addItem($rg);
}
#$ro_parent = new ilRadioOption($this->lng->txt('chat_message_notify_deactivate'), 0);
#$rg_parent->addOption($ro_parent);
$form->addItem($ro_parent);
}
$form->addCommandButton("saveChatOptions", $lng->txt("save"));
return $form;
}

+ Here is the caller graph for this function:

ilPersonalSettingsGUI::initGeneralSettingsForm ( )

Init general settings form.

Definition at line 862 of file class.ilPersonalSettingsGUI.php.

References $ilSetting, $lng, ilCalendarUserSettings\_getInstanceByUserId(), ilCalendarUtil\_getShortTimeZoneList(), ilObjStyleSettings\_lookupActivatedStyle(), ilLanguage\_lookupEntry(), ilFormat\_secondsToString(), ilCalendarSettings\DATE_FORMAT_DMY, ilCalendarSettings\DATE_FORMAT_MDY, ilCalendarSettings\DATE_FORMAT_YMD, ilSession\getSessionExpireValue(), ilCheckboxInputGUI\setChecked(), ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), ilCalendarSettings\TIME_FORMAT_12, ilCalendarSettings\TIME_FORMAT_24, and userSettingVisible().

Referenced by saveGeneralSettings(), and showGeneralSettings().

{
global $lng, $ilUser, $styleDefinition, $ilSetting;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
// language
if ($this->userSettingVisible("language"))
{
$languages = $this->lng->getInstalledLanguages();
$options = array();
foreach($languages as $lang_key)
{
$options[$lang_key] = ilLanguage::_lookupEntry($lang_key,"meta", "meta_l_".$lang_key);
}
$si = new ilSelectInputGUI($this->lng->txt("language"), "language");
$si->setOptions($options);
$si->setValue($ilUser->getLanguage());
$si->setDisabled($ilSetting->get("usr_settings_disable_language"));
$this->form->addItem($si);
}
// skin/style
include_once("./Services/Style/classes/class.ilObjStyleSettings.php");
if ($this->userSettingVisible("skin_style"))
{
$templates = $styleDefinition->getAllTemplates();
if (is_array($templates))
{
$si = new ilSelectInputGUI($this->lng->txt("skin_style"), "skin_style");
$options = array();
foreach($templates as $template)
{
// get styles information of template
$styleDef = new ilStyleDefinition($template["id"]);
$styleDef->startParsing();
$styles = $styleDef->getStyles();
foreach($styles as $style)
{
if (!ilObjStyleSettings::_lookupActivatedStyle($template["id"],$style["id"]))
{
continue;
}
$options[$template["id"].":".$style["id"]] =
$styleDef->getTemplateName()." / ".$style["name"];
}
}
$si->setOptions($options);
$si->setValue($ilUser->skin.":".$ilUser->prefs["style"]);
$si->setDisabled($ilSetting->get("usr_settings_disable_skin_style"));
$this->form->addItem($si);
}
}
// screen reader optimization
if ($this->userSettingVisible("screen_reader_optimization"))
{
$cb = new ilCheckboxInputGUI($this->lng->txt("user_screen_reader_optimization"), "screen_reader_optimization");
$cb->setChecked($ilUser->prefs["screen_reader_optimization"]);
$cb->setDisabled($ilSetting->get("usr_settings_disable_screen_reader_optimization"));
$cb->setInfo($this->lng->txt("user_screen_reader_optimization_info"));
$this->form->addItem($cb);
}
// hits per page
if ($this->userSettingVisible("hits_per_page"))
{
$si = new ilSelectInputGUI($this->lng->txt("hits_per_page"), "hits_per_page");
$hits_options = array(10,15,20,30,40,50,100,9999);
$options = array();
foreach($hits_options as $hits_option)
{
$hstr = ($hits_option == 9999)
? $this->lng->txt("no_limit")
: $hits_option;
$options[$hits_option] = $hstr;
}
$si->setOptions($options);
$si->setValue($ilUser->prefs["hits_per_page"]);
$si->setDisabled($ilSetting->get("usr_settings_disable_hits_per_page"));
$this->form->addItem($si);
}
// Users Online
if ($this->userSettingVisible("show_users_online"))
{
$si = new ilSelectInputGUI($this->lng->txt("show_users_online"), "show_users_online");
$options = array(
"y" => $this->lng->txt("users_online_show_y"),
"associated" => $this->lng->txt("users_online_show_associated"),
"n" => $this->lng->txt("users_online_show_n"));
$si->setOptions($options);
$si->setValue($ilUser->prefs["show_users_online"]);
$si->setDisabled($ilSetting->get("usr_settings_disable_show_users_online"));
$this->form->addItem($si);
}
// hide_own_online_status
if ($this->userSettingVisible("hide_own_online_status"))
{
$cb = new ilCheckboxInputGUI($this->lng->txt("hide_own_online_status"), "hide_own_online_status");
$cb->setChecked($ilUser->prefs["hide_own_online_status"] == "y");
$cb->setDisabled($ilSetting->get("usr_settings_disable_hide_own_online_status"));
$this->form->addItem($cb);
}
// session reminder
if((int)$ilSetting->get('session_handling_type') == 0 &&
(int)$ilSetting->get('session_reminder_enabled'))
{
$cb = new ilCheckboxInputGUI($this->lng->txt('session_reminder'), 'session_reminder_enabled');
$cb->setInfo($this->lng->txt('session_reminder_info'));
$cb->setValue(1);
$cb->setChecked((int)$ilUser->getPref('session_reminder_enabled'));
$lead_time_gui = new ilTextInputGUI($this->lng->txt('session_reminder_lead_time'), 'session_reminder_lead_time');
$lead_time_gui->setInfo(sprintf($this->lng->txt('session_reminder_lead_time_info'), ilFormat::_secondsToString($expires, true)));
$lead_time_gui->setValue($ilUser->getPref('session_reminder_lead_time'));
$lead_time_gui->setMaxLength(10);
$lead_time_gui->setSize(10);
$cb->addSubItem($lead_time_gui);
$this->form->addItem($cb);
}
// calendar settings (copied here to be reachable when calendar is inactive)
// they cannot be hidden/deactivated
include_once('Services/Calendar/classes/class.ilCalendarUserSettings.php');
include_once('Services/Calendar/classes/class.ilCalendarUtil.php');
$lng->loadLanguageModule("dateplaner");
$user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
$select = new ilSelectInputGUI($lng->txt('cal_user_timezone'),'timezone');
$select->setInfo($lng->txt('cal_timezone_info'));
$select->setValue($user_settings->getTimeZone());
$this->form->addItem($select);
$year = date("Y");
$select = new ilSelectInputGUI($lng->txt('cal_user_date_format'),'date_format');
$select->setOptions(array(
$select->setInfo($lng->txt('cal_date_format_info'));
$select->setValue($user_settings->getDateFormat());
$this->form->addItem($select);
$select = new ilSelectInputGUI($lng->txt('cal_user_time_format'),'time_format');
$select->setOptions(array(
$select->setInfo($lng->txt('cal_time_format_info'));
$select->setValue($user_settings->getTimeFormat());
$this->form->addItem($select);
$this->form->addCommandButton("saveGeneralSettings", $lng->txt("save"));
$this->form->setTitle($lng->txt("general_settings"));
$this->form->setFormAction($this->ctrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPersonalSettingsGUI::initMailOptionsForm ( )
private

Initialises the mail options form.

Definition at line 229 of file class.ilPersonalSettingsGUI.php.

References $ilCtrl, $ilSetting, $lng, ilObjUser\_lookupEmail(), IL_MAIL_BOTH, IL_MAIL_EMAIL, IL_MAIL_LOCAL, ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), and ilTextAreaInputGUI\setRows().

Referenced by saveMailOptions(), and showMailOptions().

{
global $ilCtrl, $ilSetting, $lng, $ilUser;
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($ilCtrl->getFormAction($this, 'saveMailOptions'));
$this->form->setTitle($lng->txt('mail_settings'));
// BEGIN INCOMING
include_once 'Services/Mail/classes/class.ilMailOptions.php';
if($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1')
{
$options = array(
IL_MAIL_LOCAL => $this->lng->txt('mail_incoming_local'),
IL_MAIL_EMAIL => $this->lng->txt('mail_incoming_smtp'),
IL_MAIL_BOTH => $this->lng->txt('mail_incoming_both')
);
$si = new ilSelectInputGUI($lng->txt('mail_incoming'), 'incoming_type');
$si->setOptions($options);
if(!strlen(ilObjUser::_lookupEmail($ilUser->getId())) ||
$ilSetting->get('usr_settings_disable_mail_incoming_mail') == '1')
{
$si->setDisabled(true);
}
$this->form->addItem($si);
}
// BEGIN LINEBREAK_OPTIONS
$options = array();
for($i = 50; $i <= 80; $i++)
{
$options[$i] = $i;
}
$si = new ilSelectInputGUI($lng->txt('linebreak'), 'linebreak');
$si->setOptions($options);
$this->form->addItem($si);
// BEGIN SIGNATURE
$ta = new ilTextAreaInputGUI($lng->txt('signature'), 'signature');
$ta->setRows(10);
$ta->setCols(60);
$this->form->addItem($ta);
// BEGIN CRONJOB NOTIFICATION
if($ilSetting->get('mail_notification'))
{
$cb = new ilCheckboxInputGUI($lng->txt('cron_mail_notification'), 'cronjob_notification');
$cb->setInfo($lng->txt('mail_cronjob_notification_info'));
$cb->setValue(1);
$this->form->addItem($cb);
}
$this->form->addCommandButton('saveMailOptions', $lng->txt('save'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPersonalSettingsGUI::initPasswordForm ( )

Init password form.

Parameters
int$a_modeEdit Mode

Definition at line 598 of file class.ilPersonalSettingsGUI.php.

References $ilSetting, $lng, ilDAVServer\_isActive(), allowPasswordChange(), AUTH_CAS, AUTH_LOCAL, AUTH_SHIBBOLETH, ilUtil\getPasswordRequirementsInfo(), ilFormPropertyGUI\setRequired(), and ilPasswordInputGUI\setRetype().

Referenced by savePassword(), and showPassword().

{
global $lng, $ilUser, $ilSetting;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
// Check whether password change is allowed
if ($this->allowPasswordChange())
{
// The current password needs to be checked for verification
// unless the user uses Shibboleth authentication with additional
// local authentication for WebDAV.
//if (
// ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || !$ilSetting->get("shib_auth_allow_local"))
//)
if($ilUser->getAuthMode(true) == AUTH_LOCAL)
{
// current password
$cpass = new ilPasswordInputGUI($lng->txt("current_password"), "current_password");
$cpass->setRetype(false);
$cpass->setSkipSyntaxCheck(true);
// only if a password exists.
if($ilUser->getPasswd())
{
$cpass->setRequired(true);
}
$this->form->addItem($cpass);
}
// new password
$ipass = new ilPasswordInputGUI($lng->txt("desired_password"), "new_password");
$ipass->setRequired(true);
if ($ilSetting->get("passwd_auto_generate") == 1) // auto generation list
{
$ipass->setPreSelection(true);
$this->form->addItem($ipass);
$this->form->addCommandButton("savePassword", $lng->txt("save"));
$this->form->addCommandButton("showPassword", $lng->txt("new_list_password"));
}
else // user enters password
{
$this->form->addItem($ipass);
$this->form->addCommandButton("savePassword", $lng->txt("save"));
}
switch ($ilUser->getAuthMode(true))
{
case AUTH_LOCAL :
$this->form->setTitle($lng->txt("chg_password"));
break;
case AUTH_CAS:
require_once 'Services/WebDAV/classes/class.ilDAVServer.php';
{
$this->form->setTitle($lng->txt("chg_ilias_and_webfolder_password"));
}
else
{
$this->form->setTitle($lng->txt("chg_ilias_password"));
}
break;
default :
$this->form->setTitle($lng->txt("chg_ilias_password"));
break;
}
$this->form->setFormAction($this->ctrl->getFormAction($this));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPersonalSettingsGUI::saveChatOptions ( )

Definition at line 491 of file class.ilPersonalSettingsGUI.php.

References $_POST, $ilSetting, $lng, ilUtil\sendSuccess(), and showChatOptions().

{
global $ilUser, $ilSetting, $lng;
if((int)$ilSetting->get('chat_message_notify_status'))
{
$ilUser->setPref('chat_message_notify_status', (int)$_POST['chat_message_notify_activate']);
}
if((int)$ilSetting->get('chat_sound_status') &&
((int)$ilSetting->get('chat_new_invitation_sound_status') ||
(int)$ilSetting->get('chat_new_message_sound_status')))
{
$ilUser->setPref('chat_sound_status', (int)$_POST['chat_sound_status']);
if((int)$ilSetting->get('chat_new_invitation_sound_status'))
{
$ilUser->setPref('chat_new_invitation_sound_status', (int)$_POST['chat_new_invitation_sound_status']);
}
if((int)$ilSetting->get('chat_new_message_sound_status'))
{
$ilUser->setPref('chat_new_message_sound_status', (int)$_POST['chat_new_message_sound_status']);
}
}
$ilUser->writePrefs();
ilUtil::sendSuccess($lng->txt('saved'));
$this->showChatOptions(true);
}

+ Here is the call graph for this function:

ilPersonalSettingsGUI::saveGeneralSettings ( )

Save general settings.

Definition at line 1040 of file class.ilPersonalSettingsGUI.php.

References $_POST, $ilCtrl, $ilSetting, $lng, $tpl, ilCalendarUserSettings\_getInstanceByUserId(), initGeneralSettingsForm(), ilUtil\sendSuccess(), and workWithUserSetting().

{
global $tpl, $lng, $ilCtrl, $ilUser;
if ($this->form->checkInput())
{
if ($this->workWithUserSetting("skin_style"))
{
//set user skin and style
if ($_POST["skin_style"] != "")
{
$sknst = explode(":", $_POST["skin_style"]);
if ($ilUser->getPref("style") != $sknst[1] ||
$ilUser->getPref("skin") != $sknst[0])
{
$ilUser->setPref("skin", $sknst[0]);
$ilUser->setPref("style", $sknst[1]);
}
}
}
// language
if ($this->workWithUserSetting("language"))
{
$ilUser->setLanguage($_POST["language"]);
}
// hits per page
if ($this->workWithUserSetting("hits_per_page"))
{
if ($_POST["hits_per_page"] != "")
{
$ilUser->setPref("hits_per_page",$_POST["hits_per_page"]);
}
}
// set show users online
if ($this->workWithUserSetting("show_users_online"))
{
$ilUser->setPref("show_users_online", $_POST["show_users_online"]);
}
// set hide own online_status
if ($this->workWithUserSetting("hide_own_online_status"))
{
if ($_POST["hide_own_online_status"] == 1)
{
$ilUser->setPref("hide_own_online_status","y");
}
else
{
$ilUser->setPref("hide_own_online_status","n");
}
}
// set show users online
if ($this->workWithUserSetting("screen_reader_optimization"))
{
$ilUser->setPref("screen_reader_optimization", $_POST["screen_reader_optimization"]);
}
// session reminder
global $ilSetting;
if((int)$ilSetting->get('session_handling_type') == 0 &&
(int)$ilSetting->get('session_reminder_enabled'))
{
$ilUser->setPref('session_reminder_enabled', (int)$_POST['session_reminder_enabled']);
if(!preg_match('/^([0]|([1-9][0-9]*))([\.][0-9][0-9]*)?$/', $_POST['session_reminder_lead_time']))
$_POST['session_reminder_lead_time'] = 0;
$ilUser->setPref('session_reminder_lead_time', $_POST['session_reminder_lead_time']);
}
$ilUser->update();
// calendar settings
include_once('Services/Calendar/classes/class.ilCalendarUserSettings.php');
$user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
$user_settings->setTimeZone($this->form->getInput("timezone"));
$user_settings->setDateFormat((int)$this->form->getInput("date_format"));
$user_settings->setTimeFormat((int)$this->form->getInput("time_format"));
$user_settings->save();
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "showGeneralSettings");
}
$this->form->setValuesByPost();
$tpl->showGeneralSettings(true);
}

+ Here is the call graph for this function:

ilPersonalSettingsGUI::savejsMath ( )

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

References $_POST, and $ilCtrl.

{
global $ilCtrl, $ilUser;
include_once "./Services/Administration/classes/class.ilSetting.php";
$jsMathSetting = new ilSetting("jsMath");
if ($jsMathSetting->get("enable"))
{
if ($_POST["enable"])
{
$ilUser->writePref("js_math", "1");
}
else
{
$ilUser->writePref("js_math", "0");
}
}
$ilCtrl->redirect($this, "showjsMath");
}
ilPersonalSettingsGUI::saveMailOptions ( )

Called if the user pushes the submit button of the mail options form.

Passes the post data to the mail options model instance to store them.

Definition at line 179 of file class.ilPersonalSettingsGUI.php.

References $_POST, $ilSetting, $lng, __initSubTabs(), initMailOptionsForm(), ilUtil\sendSuccess(), setHeader(), and ilUtil\stripSlashes().

{
global $ilUser, $lng, $ilTabs, $ilSetting;
$lng->loadLanguageModule('mail');
$this->__initSubTabs('showMailOptions');
$ilTabs->activateTab('mail_settings');
$this->setHeader();
require_once 'Services/Mail/classes/class.ilMailOptions.php';
$mailOptions = new ilMailOptions($ilUser->getId());
if($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1' &&
$ilSetting->get('usr_settings_disable_mail_incoming_mail') != '1')
{
$incoming_type = (int)$_POST['incoming_type'];
}
else
{
$incoming_type = $mailOptions->getIncomingType();
}
if($this->form->checkInput())
{
$mailOptions->updateOptions(
(int)$_POST['linebreak'],
$incoming_type,
(int)$_POST['cronjob_notification']
);
ilUtil::sendSuccess($lng->txt('mail_options_saved'));
}
if(!isset($_POST['incoming_type']))
{
$_POST['incoming_type'] = $mailOptions->getIncomingType();
}
$this->form->setValuesByPost();
$this->tpl->setContent($this->form->getHTML());
$this->tpl->show();
}

+ Here is the call graph for this function:

ilPersonalSettingsGUI::savePassword ( )

Save password form.

Definition at line 707 of file class.ilPersonalSettingsGUI.php.

References $_POST, $ilCtrl, $ilSetting, $lng, $tpl, allowPasswordChange(), AUTH_LOCAL, initPasswordForm(), ilUtil\isPassword(), ilUtil\sendSuccess(), and showPassword().

{
global $tpl, $lng, $ilCtrl, $ilUser, $ilSetting;
// normally we should not end up here
if (!$this->allowPasswordChange())
{
$ilCtrl->redirect($this, "showPersonalData");
return;
}
$this->initPasswordForm();
if ($this->form->checkInput())
{
$cp = $this->form->getItemByPostVar("current_password");
$np = $this->form->getItemByPostVar("new_password");
$error = false;
// The old password needs to be checked for verification
// unless the user uses Shibboleth authentication with additional
// local authentication for WebDAV.
#if ($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || ! $ilSetting->get("shib_auth_allow_local"))
if($ilUser->getAuthMode(true) == AUTH_LOCAL)
{
// check current password
if (md5($_POST["current_password"]) != $ilUser->getPasswd() and
$ilUser->getPasswd())
{
$error = true;
$cp->setAlert($this->lng->txt("passwd_wrong"));
}
}
// select password from auto generated passwords
if ($this->ilias->getSetting("passwd_auto_generate") == 1 &&
(!ilUtil::isPassword($_POST["new_password"])))
{
$error = true;
$np->setAlert($this->lng->txt("passwd_not_selected"));
}
if ($this->ilias->getSetting("passwd_auto_generate") != 1 &&
!ilUtil::isPassword($_POST["new_password"],$custom_error))
{
$error = true;
if ($custom_error != '')
{
$np->setAlert($custom_error);
}
else
{
$np->setAlert($this->lng->txt("passwd_invalid"));
}
}
if ($this->ilias->getSetting("passwd_auto_generate") != 1 &&
($ilUser->isPasswordExpired() || $ilUser->isPasswordChangeDemanded()) &&
($_POST["current_password"] == $_POST["new_password"]))
{
$error = true;
$np->setAlert($this->lng->txt("new_pass_equals_old_pass"));
}
if (!$error)
{
ilUtil::sendSuccess($this->lng->txt("saved_successfully"), true);
$ilUser->resetPassword($_POST["new_password"], $_POST["new_password"]);
if ($_POST["current_password"] != $_POST["new_password"])
{
$ilUser->setLastPasswordChangeToNow();
}
$ilCtrl->redirect($this, "showPassword");
}
}
$this->form->setValuesByPost();
$this->showPassword(true);
}

+ Here is the call graph for this function:

ilPersonalSettingsGUI::setHeader ( )

Set header.

Definition at line 525 of file class.ilPersonalSettingsGUI.php.

Referenced by saveMailOptions(), showChatOptions(), showGeneralSettings(), showjsMath(), showMailOptions(), and showPassword().

{
// $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_pd_b.gif"), "");
$this->tpl->setVariable('HEADER', $this->lng->txt('personal_settings'));
}

+ Here is the caller graph for this function:

ilPersonalSettingsGUI::setMailOptionsValuesByDB ( )
private

Fetches data from model and loads this data into form.

Definition at line 289 of file class.ilPersonalSettingsGUI.php.

References $data, $ilSetting, and ilMailOptions\getIncomingType().

Referenced by showMailOptions().

{
global $ilUser, $ilSetting;
require_once 'Services/Mail/classes/class.ilMailOptions.php';
$mailOptions = new ilMailOptions($ilUser->getId());
$data = array(
'linebreak' => $mailOptions->getLinebreak(),
'signature' => $mailOptions->getSignature(),
'cronjob_notification' => $mailOptions->getCronjobNotification()
);
if($ilSetting->get('usr_settings_hide_mail_incoming_mail') != '1')
{
$data['incoming_type'] = $mailOptions->getIncomingType();
}
$this->form->setValuesByArray($data);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPersonalSettingsGUI::showChatOptions (   $by_post = false)

show Chat Settings

Definition at line 534 of file class.ilPersonalSettingsGUI.php.

References $ilCtrl, $ilSetting, $lng, __initSubTabs(), getChatSettingsForm(), and setHeader().

Referenced by saveChatOptions().

{
global $ilCtrl, $ilSetting, $lng, $ilUser;
$this->__initSubTabs('showChatOptions');
$this->setHeader();
$form = false;
if($by_post)
{
$form = $this->getChatSettingsForm();
$form->setValuesByPost();
}
else
{
$values = array();
$values['chat_message_notify_status'] = $ilUser->getPref('chat_message_notify_status');
$values['chat_message_notify_activate'] = $ilUser->getPref('chat_message_notify_status');
$values['chat_sound_status'] = $ilUser->getPref('chat_sound_status');
$values['chat_new_invitation_sound_status'] = $ilUser->getPref('chat_new_invitation_sound_status');
$values['chat_new_message_sound_status'] = $ilUser->getPref('chat_new_message_sound_status');
$form = $this->getChatSettingsForm();
$form->setValuesByArray($values);
}
$this->tpl->setVariable('ADM_CONTENT', $form->getHTML());
$this->tpl->show();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPersonalSettingsGUI::showGeneralSettings (   $a_no_init = false)

General settings form.

Definition at line 841 of file class.ilPersonalSettingsGUI.php.

References __initSubTabs(), initGeneralSettingsForm(), and setHeader().

{
global $ilTabs;
$this->__initSubTabs("showPersonalData");
$ilTabs->activateTab("general_settings");
$this->setHeader();
if (!$a_no_init)
{
}
$this->tpl->setContent($this->form->getHTML());
$this->tpl->show();
}

+ Here is the call graph for this function:

ilPersonalSettingsGUI::showjsMath ( )

Definition at line 331 of file class.ilPersonalSettingsGUI.php.

References $ilCtrl, $lng, $tpl, __initSubTabs(), ilCheckboxInputGUI\setChecked(), and setHeader().

{
global $lng, $ilCtrl, $tpl, $ilUser;
$this->__initSubTabs("showjsMath");
$this->setHeader();
include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
$form = new ilPropertyFormGUI();
$form->setFormAction($ilCtrl->getFormAction($this));
$form->setTitle($lng->txt("jsmath_settings"));
// Enable jsMath
include_once "./Services/Administration/classes/class.ilSetting.php";
$jsMathSetting = new ilSetting("jsMath");
$enable = new ilCheckboxInputGUI($lng->txt("jsmath_enable_user"), "enable");
$checked = ($ilUser->getPref("js_math") === FALSE) ? $jsMathSetting->get("makedefault") : $ilUser->getPref("js_math");
$enable->setChecked($checked);
$enable->setInfo($lng->txt("jsmath_enable_user_desc"));
$form->addItem($enable);
$form->addCommandButton("savejsMath", $lng->txt("save"));
$form->addCommandButton("showjsMath", $lng->txt("cancel"));
$this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
$this->tpl->show();
}

+ Here is the call graph for this function:

ilPersonalSettingsGUI::showMailOptions ( )

Called to display the mail options form.

Definition at line 313 of file class.ilPersonalSettingsGUI.php.

References $lng, __initSubTabs(), initMailOptionsForm(), setHeader(), and setMailOptionsValuesByDB().

{
global $ilTabs, $lng;
$lng->loadLanguageModule('mail');
$this->__initSubTabs('showMailOptions');
$ilTabs->activateTab('mail_settings');
$this->setHeader();
$this->tpl->setContent($this->form->getHTML());
$this->tpl->show();
}

+ Here is the call graph for this function:

ilPersonalSettingsGUI::showPassword (   $a_no_init = false)

Password form.

Definition at line 576 of file class.ilPersonalSettingsGUI.php.

References __initSubTabs(), initPasswordForm(), and setHeader().

Referenced by savePassword().

{
global $ilTabs;
$this->__initSubTabs("showPersonalData");
$ilTabs->activateTab("password");
$this->setHeader();
if (!$a_no_init)
{
$this->initPasswordForm();
}
$this->tpl->setContent($this->form->getHTML());
$this->tpl->show();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPersonalSettingsGUI::userSettingEnabled (   $setting)

Returns TRUE if user setting is enabled, FALSE otherwise.

Definition at line 828 of file class.ilPersonalSettingsGUI.php.

References $result.

{
$result = TRUE;
if ($this->settings["usr_settings_disable_".$setting] == 1)
{
$result = FALSE;
}
return $result;
}
ilPersonalSettingsGUI::userSettingVisible (   $setting)

Returns TRUE if user setting is visible, FALSE otherwise.

Definition at line 813 of file class.ilPersonalSettingsGUI.php.

References $result.

Referenced by allowPasswordChange(), and initGeneralSettingsForm().

{
$result = TRUE;
if (isset($this->settings["usr_settings_hide_".$setting]) &&
$this->settings["usr_settings_hide_".$setting] == 1)
{
$result = FALSE;
}
return $result;
}

+ Here is the caller graph for this function:

ilPersonalSettingsGUI::workWithUserSetting (   $setting)

Returns TRUE if working with the given user setting is allowed, FALSE otherwise.

Definition at line 795 of file class.ilPersonalSettingsGUI.php.

References $result.

Referenced by saveGeneralSettings().

{
$result = TRUE;
if ($this->settings["usr_settings_hide_".$setting] == 1)
{
$result = FALSE;
}
if ($this->settings["usr_settings_disable_".$setting] == 1)
{
$result = FALSE;
}
return $result;
}

+ Here is the caller graph for this function:

Field Documentation

ilPersonalSettingsGUI::$ctrl

Definition at line 16 of file class.ilPersonalSettingsGUI.php.

ilPersonalSettingsGUI::$ilias

Definition at line 15 of file class.ilPersonalSettingsGUI.php.

Referenced by __construct().

ilPersonalSettingsGUI::$tpl

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