ILIAS  Release_5_0_x_branch Revision 61816
 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
 setHeader ()
 Set header.
 showPassword ($a_no_init=false, $hide_form=false)
 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

Protected Member Functions

 deleteOwnAccount1 ()
 Delete own account dialog - 1st confirmation.
 deleteOwnAccount2 ()
 Delete own account dialog - login redirect.
 abortDeleteOwnAccount ()
 deleteOwnAccountLogout ()
 deleteOwnAccount3 ()
 Delete own account dialog - final confirmation.
 deleteOwnAccount4 ()
 Delete own account dialog - action incl.

Private Member Functions

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

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");
$lng->loadLanguageModule('chatroom');
$lng->loadLanguageModule('chatroom_adm');
$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::abortDeleteOwnAccount ( )
protected

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

References $ilCtrl, $ilUser, and ilUtil\sendInfo().

{
global $ilCtrl, $ilUser;
$ilUser->removeDeletionFlag();
ilUtil::sendInfo($this->lng->txt("user_delete_own_account_aborted"), true);
$ilCtrl->redirect($this, "showGeneralSettings");
}

+ Here is the call graph for this function:

ilPersonalSettingsGUI::allowPasswordChange ( )

Check, whether password change is allowed for user.

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

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

Referenced by initPasswordForm(), and savePassword().

{
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::deleteOwnAccount1 ( )
protected

Delete own account dialog - 1st confirmation.

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

References $ilSetting, $ilUser, ilUtil\sendInfo(), and setHeader().

{
global $ilTabs, $ilToolbar, $ilUser, $ilSetting;
if(!(bool)$ilSetting->get('user_delete_own_account') ||
$ilUser->getId() == SYSTEM_USER_ID)
{
$this->ctrl->redirect($this, "showGeneralSettings");
}
// too make sure
$ilUser->removeDeletionFlag();
$this->setHeader();
$this->__initSubTabs("deleteOwnAccount");
$ilTabs->activateTab("delacc");
ilUtil::sendInfo($this->lng->txt('user_delete_own_account_info'));
$ilToolbar->addButton($this->lng->txt('btn_next'),
$this->ctrl->getLinkTarget($this, 'deleteOwnAccount2'));
$this->tpl->show();
}

+ Here is the call graph for this function:

ilPersonalSettingsGUI::deleteOwnAccount2 ( )
protected

Delete own account dialog - login redirect.

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

References $ilSetting, $ilUser, and setHeader().

{
global $ilTabs, $ilUser, $ilSetting;
if(!(bool)$ilSetting->get('user_delete_own_account') ||
$ilUser->getId() == SYSTEM_USER_ID)
{
$this->ctrl->redirect($this, "showGeneralSettings");
}
$this->setHeader();
$this->__initSubTabs("deleteOwnAccount");
$ilTabs->activateTab("delacc");
include_once "Services/Utilities/classes/class.ilConfirmationGUI.php";
$cgui = new ilConfirmationGUI();
$cgui->setHeaderText($this->lng->txt('user_delete_own_account_logout_confirmation'));
$cgui->setFormAction($this->ctrl->getFormAction($this));
$cgui->setCancel($this->lng->txt("cancel"), "abortDeleteOwnAccount");
$cgui->setConfirm($this->lng->txt("user_delete_own_account_logout_button"), "deleteOwnAccountLogout");
$this->tpl->setContent($cgui->getHTML());
$this->tpl->show();
}

+ Here is the call graph for this function:

ilPersonalSettingsGUI::deleteOwnAccount3 ( )
protected

Delete own account dialog - final confirmation.

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

References $ilSetting, $ilUser, and setHeader().

{
global $ilTabs, $ilUser, $ilSetting;
if(!(bool)$ilSetting->get('user_delete_own_account') ||
$ilUser->getId() == SYSTEM_USER_ID ||
!$ilUser->hasDeletionFlag())
{
$this->ctrl->redirect($this, "showGeneralSettings");
}
$this->setHeader();
$this->__initSubTabs("deleteOwnAccount");
$ilTabs->activateTab("delacc");
include_once "Services/Utilities/classes/class.ilConfirmationGUI.php";
$cgui = new ilConfirmationGUI();
$cgui->setHeaderText($this->lng->txt('user_delete_own_account_final_confirmation'));
$cgui->setFormAction($this->ctrl->getFormAction($this));
$cgui->setCancel($this->lng->txt("cancel"), "abortDeleteOwnAccount");
$cgui->setConfirm($this->lng->txt("confirm"), "deleteOwnAccount4");
$this->tpl->setContent($cgui->getHTML());
$this->tpl->show();
}

+ Here is the call graph for this function:

ilPersonalSettingsGUI::deleteOwnAccount4 ( )
protected

Delete own account dialog - action incl.

notification email

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

References $ilLog, $ilSetting, $ilUser, ilDatePresentation\formatDate(), IL_CAL_UNIX, ilUtil\redirect(), and ilDatePresentation\setUseRelativeDates().

{
global $ilUser, $ilAuth, $ilSetting, $ilLog;
if(!(bool)$ilSetting->get('user_delete_own_account') ||
$ilUser->getId() == SYSTEM_USER_ID ||
!$ilUser->hasDeletionFlag())
{
$this->ctrl->redirect($this, "showGeneralSettings");
}
// build notification
include_once "./Services/Notification/classes/class.ilSystemNotification.php";
$ntf = new ilSystemNotification();
$ntf->setLangModules(array("user"));
$ntf->addAdditionalInfo("profile", $ilUser->getProfileAsString($this->lng), true);
// mail message
$ntf->setIntroductionDirect(
sprintf($this->lng->txt("user_delete_own_account_email_body"),
$ilUser->getLogin(),
ILIAS_HTTP_PATH,
$message = $ntf->composeAndGetMessage($ilUser->getId(), null, null, true);
$subject = $this->lng->txt("user_delete_own_account_email_subject");
// send notification
include_once "Services/Mail/classes/class.ilMail.php";
$mail = new ilMail(ANONYMOUS_USER_ID);
$user_email = $ilUser->getEmail();
$admin_mail = $ilSetting->get("user_delete_own_account_email");
// to user, admin as bcc
if($user_email)
{
$mail->sendMimeMail($user_email, null, $admin_mail, $subject, $message, null, true);
}
// admin only
else if($admin_mail)
{
$mail->sendMimeMail($admin_mail, null, null, $subject, $message, null, true);
}
$ilLog->write("Account deleted: ".$ilUser->getLogin()." (".$ilUser->getId().")");
$ilUser->delete();
// terminate session
$ilAuth->logout();
session_destroy();
ilUtil::redirect("login.php?accdel=1");
}

+ Here is the call graph for this function:

ilPersonalSettingsGUI::deleteOwnAccountLogout ( )
protected

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

References $ilUser, ilUtil\redirect(), ilSession\SESSION_CLOSE_USER, and ilSession\setClosingContext().

{
global $ilAuth, $ilUser;
// we are setting the flag and ending the session in the same step
$ilUser->activateDeletionFlag();
// see ilStartupGUI::showLogout()
$ilAuth->logout();
session_destroy();
ilUtil::redirect("login.php?target=usr_".md5("usrdelown"));
}

+ Here is the call graph for this function:

& ilPersonalSettingsGUI::executeCommand ( )

execute command

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

References $cmd, $ilCtrl, $ilUser, $lng, and $tpl.

{
global $ilUser, $ilCtrl, $tpl, $ilTabs, $lng;
$next_class = $this->ctrl->getNextClass();
switch($next_class)
{
default:
$cmd = $this->ctrl->getCmd("showGeneralSettings");
$this->$cmd();
break;
}
return true;
}
ilPersonalSettingsGUI::initGeneralSettingsForm ( )

Init general settings form.

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

References $ilSetting, $ilUser, $lng, $options, $si, ilCalendarUserSettings\_getInstanceByUserId(), ilCalendarUtil\_getShortTimeZoneList(), ilObjStyleSettings\_lookupActivatedStyle(), ilLanguage\_lookupEntry(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilFormat\_secondsToString(), ilCharSelectorConfig\CONTEXT_USER, ilCalendarSettings\DATE_FORMAT_DMY, ilCalendarSettings\DATE_FORMAT_MDY, ilCalendarSettings\DATE_FORMAT_YMD, ilUserUtil\getPersonalStartingObject(), ilUserUtil\getPersonalStartingPoint(), ilUserUtil\getPossibleStartingPoints(), ilSession\getSessionExpireValue(), ilUserUtil\hasPersonalStartingPoint(), ilUserUtil\hasPersonalStartPointPref(), ilSessionReminder\MIN_LEAD_TIME, ilCheckboxInputGUI\setChecked(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), ilRadioOption\setValue(), ilUserUtil\START_REPOSITORY_OBJ, ilSessionReminder\SUGGESTED_LEAD_TIME, 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);
}
// Store last visited
$lv = new ilSelectInputGUI($this->lng->txt("user_store_last_visited"), "store_last_visited");
$options = array(
0 => $this->lng->txt("user_lv_keep_entries"),
1 => $this->lng->txt("user_lv_keep_only_for_session"),
2 => $this->lng->txt("user_lv_do_not_store"));
$lv->setOptions($options);
$lv->setValue((int) $ilUser->prefs["store_last_visited"]);
$this->form->addItem($lv);
// 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);
}
include_once 'Services/Authentication/classes/class.ilSessionReminder.php';
if(ilSessionReminder::isGloballyActivated())
{
$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 ilNumberInputGUI($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)));
$max_value = max($min_value, ((int)$expires / 60) - 1);
$current_user_value = $ilUser->getPref('session_reminder_lead_time');
if($current_user_value < $min_value ||
$current_user_value > $max_value)
{
}
$value = min(
max(
$min_value, $current_user_value
),
$max_value
);
$lead_time_gui->setValue($value);
$lead_time_gui->setSize(3);
$lead_time_gui->setMinValue($min_value);
$lead_time_gui->setMaxValue($max_value);
$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);
// starting point
include_once "Services/User/classes/class.ilUserUtil.php";
{
$this->lng->loadLanguageModule("administration");
$si = new ilRadioGroupInputGUI($this->lng->txt("adm_user_starting_point"), "usr_start");
$si->setRequired(true);
$si->setInfo($this->lng->txt("adm_user_starting_point_info"));
$def_opt = new ilRadioOption($this->lng->txt("adm_user_starting_point_inherit"), 0);
$def_opt->setInfo($this->lng->txt("adm_user_starting_point_inherit_info"));
$si->addOption($def_opt);
foreach(ilUserUtil::getPossibleStartingPoints() as $value => $caption)
{
$si->addOption(new ilRadioOption($caption, $value));
}
: 0);
$this->form->addItem($si);
// starting point: repository object
$repobj = new ilRadioOption($lng->txt("adm_user_starting_point_object"), ilUserUtil::START_REPOSITORY_OBJ);
$repobj_id = new ilTextInputGUI($lng->txt("adm_user_starting_point_ref_id"), "usr_start_ref_id");
$repobj_id->setRequired(true);
$repobj_id->setSize(5);
{
$repobj_id->setValue($start_ref_id);
if($start_ref_id)
{
$start_obj_id = ilObject::_lookupObjId($start_ref_id);
if($start_obj_id)
{
$repobj_id->setInfo($lng->txt("obj_".ilObject::_lookupType($start_obj_id)).
": ".ilObject::_lookupTitle($start_obj_id));
}
}
}
$repobj->addSubItem($repobj_id);
$si->addOption($repobj);
}
// selector for unicode characters
global $ilSetting;
if ($ilSetting->get('char_selector_availability') > 0)
{
require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
$char_selector->getConfig()->setAvailability($ilUser->getPref('char_selector_availability'));
$char_selector->getConfig()->setDefinition($ilUser->getPref('char_selector_definition'));
$char_selector->addFormProperties($this->form);
$char_selector->setFormValues($this->form);
}
$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 129 of file class.ilPersonalSettingsGUI.php.

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

{
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');
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');
$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:

ilPersonalSettingsGUI::initPasswordForm ( )

Init password form.

Parameters
int$a_modeEdit Mode

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

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

Referenced by savePassword(), and showPassword().

{
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::saveGeneralSettings ( )

Save general settings.

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

References $ilCtrl, $ilSetting, $ilUser, $lng, $tpl, ilCalendarUserSettings\_getInstanceByUserId(), ilCharSelectorConfig\CONTEXT_USER, ilUserUtil\hasPersonalStartingPoint(), initGeneralSettingsForm(), ilUtil\sendSuccess(), ilUserUtil\setPersonalStartingPoint(), showGeneralSettings(), 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"]);
}
// store last visited?
global $ilNavigationHistory;
$ilUser->setPref("store_last_visited", (int) $_POST["store_last_visited"]);
if ((int) $_POST["store_last_visited"] > 0)
{
$ilNavigationHistory->deleteDBEntries();
if ((int) $_POST["store_last_visited"] == 2)
{
$ilNavigationHistory->deleteSessionEntries();
}
}
// 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
include_once 'Services/Authentication/classes/class.ilSessionReminder.php';
if(ilSessionReminder::isGloballyActivated())
{
$ilUser->setPref('session_reminder_enabled', (int)$this->form->getInput('session_reminder_enabled'));
$ilUser->setPref('session_reminder_lead_time', $this->form->getInput('session_reminder_lead_time'));
}
// starting point
include_once "Services/User/classes/class.ilUserUtil.php";
{
ilUserUtil::setPersonalStartingPoint($this->form->getInput('usr_start'),
$this->form->getInput('usr_start_ref_id'));
}
// selector for unicode characters
global $ilSetting;
if ($ilSetting->get('char_selector_availability') > 0)
{
require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
$char_selector->getFormValues($this->form);
$ilUser->setPref('char_selector_availability', $char_selector->getConfig()->getAvailability());
$ilUser->setPref('char_selector_definition', $char_selector->getConfig()->getDefinition());
}
$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();
$this->showGeneralSettings(true);
}

+ Here is the call graph for this function:

ilPersonalSettingsGUI::savePassword ( )

Save password form.

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

References $ilCtrl, $ilSetting, $ilUser, $lng, $tpl, allowPasswordChange(), AUTH_LOCAL, ilSession\get(), initPasswordForm(), ilUtil\isPassword(), ilUtil\isPasswordValidForUserContext(), ilUtil\redirect(), ilUtil\sendFailure(), ilUtil\sendSuccess(), ilSession\set(), showPassword(), and ilUtil\stripSlashes().

{
// 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)
{
require_once 'Services/User/classes/class.ilUserPasswordManager.php';
if(!ilUserPasswordManager::getInstance()->verifyPassword($ilUser, ilUtil::stripSlashes($_POST['current_password'])))
{
$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"));
}
}
$error_lng_var = '';
if(
$this->ilias->getSetting("passwd_auto_generate") != 1 &&
!ilUtil::isPasswordValidForUserContext($_POST["new_password"], $ilUser, $error_lng_var)
)
{
ilUtil::sendFailure($this->lng->txt('form_input_not_valid'));
$np->setAlert($this->lng->txt($error_lng_var));
$error = true;
}
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)
{
$ilUser->resetPassword($_POST["new_password"], $_POST["new_password"]);
if ($_POST["current_password"] != $_POST["new_password"])
{
$ilUser->setLastPasswordChangeToNow();
}
if(ilSession::get('orig_request_target'))
{
ilUtil::sendSuccess($this->lng->txt('saved_successfully'), true);
$target = ilSession::get('orig_request_target');
ilSession::set('orig_request_target', '');
ilUtil::redirect($target);
}
else
{
ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
$this->showPassword(true, true);
return;
}
}
}
$this->form->setValuesByPost();
$this->showPassword(true);
}

+ Here is the call graph for this function:

ilPersonalSettingsGUI::setHeader ( )

Set header.

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

Referenced by deleteOwnAccount1(), deleteOwnAccount2(), deleteOwnAccount3(), showGeneralSettings(), and showPassword().

{
$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 189 of file class.ilPersonalSettingsGUI.php.

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

{
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:

ilPersonalSettingsGUI::showGeneralSettings (   $a_no_init = false)

General settings form.

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

References $ilCtrl, initGeneralSettingsForm(), and setHeader().

Referenced by saveGeneralSettings().

{
global $ilTabs, $ilToolbar, $ilCtrl;
// test to other base class
// $ilToolbar->addButton("test",
// $ilCtrl->getLinkTargetByClass(array("ilmailgui","ilmailformgui"), "mailUser"));
$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:

+ Here is the caller graph for this function:

ilPersonalSettingsGUI::showPassword (   $a_no_init = false,
  $hide_form = false 
)
Parameters
bool$a_no_init
bool$hide_form

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

References $ilUser, initPasswordForm(), ilUtil\sendInfo(), and setHeader().

Referenced by savePassword().

{
global $ilTabs, $ilUser;
$this->__initSubTabs("showPersonalData");
$ilTabs->activateTab("password");
$this->setHeader();
// check whether password of user have to be changed
// due to first login or password of user is expired
if($ilUser->isPasswordChangeDemanded())
{
$this->lng->txt('password_change_on_first_login_demand')
);
}
else if($ilUser->isPasswordExpired())
{
$msg = $this->lng->txt('password_expired');
$password_age = $ilUser->getPasswordAge();
ilUtil::sendInfo(sprintf($msg, $password_age));
}
if (!$a_no_init && !$hide_form)
{
$this->initPasswordForm();
}
$this->tpl->setContent(!$hide_form ? $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 764 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 749 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 731 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: