$themedir) { $ALL_THEME_DIRS[]=$themedir; } // Extract form variables $form_action =safe_POST('form_action' ); $form_username =safe_POST('form_username', WT_REGEX_USERNAME); $form_realname =safe_POST('form_realname' ); $form_pass1 =safe_POST('form_pass1', WT_REGEX_PASSWORD); $form_pass2 =safe_POST('form_pass2', WT_REGEX_PASSWORD); $form_email =safe_POST('form_email', WT_REGEX_EMAIL, 'email@example.com'); $form_rootid =safe_POST('form_rootid', WT_REGEX_XREF, WT_USER_ROOT_ID ); $form_theme =safe_POST('form_theme', $ALL_THEME_DIRS); $form_language =safe_POST('form_language', array_keys(i18n::installed_languages()), WT_LOCALE ); $form_contact_method=safe_POST('form_contact_method'); $form_default_tab =safe_POST('form_default_tab', array_keys(WT_Module::getActiveTabs()), $GEDCOM_DEFAULT_TAB); $form_visible_online=safe_POST('form_visible_online', 'Y', 'N'); // Respond to form action if ($form_action=='update') { if ($form_username!=WT_USER_NAME && get_user_id($form_username)) { print_header(i18n::translate('User administration')); echo '', i18n::translate('Duplicate user name. A user with that user name already exists. Please choose another user name.'), '
'; } else { // Change password if (!empty($form_pass1)) { AddToLog('User changed password', 'auth'); set_user_password(WT_USER_ID, crypt($form_pass1)); } $old_realname =getUserFullName(WT_USER_ID); $old_email =getUserEmail(WT_USER_ID); // Change other settings setUserFullName(WT_USER_ID, $form_realname); setUserEmail (WT_USER_ID, $form_email); set_user_setting(WT_USER_ID, 'theme', $form_theme); set_user_setting(WT_USER_ID, 'language', $form_language); set_user_setting(WT_USER_ID, 'contactmethod', $form_contact_method); set_user_setting(WT_USER_ID, 'visibleonline', $form_visible_online); set_user_setting(WT_USER_ID, 'defaulttab', $form_default_tab); set_user_gedcom_setting(WT_USER_ID, WT_GED_ID, 'rootid', $form_rootid); // Change username if ($form_username!=WT_USER_NAME) { AddToLog('User renamed to ->'.$form_username.'<-', 'auth'); rename_user(WT_USER_ID, $form_username); $_SESSION['wt_user']=$form_username; } // Reload page to pick up changes such as theme and user_id header('Location: edituser.php'); exit; } } else { print_header(i18n::translate('User administration')); if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm'; } // Form validation ?> '; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; $person=Person::getInstance(WT_USER_GEDCOM_ID); if ($person) { echo ''; } $person=Person::getInstance(WT_USER_ROOT_ID); echo ''; echo ''; echo ''; echo ''; echo ''; if ($ALLOW_USER_THEMES) { echo ''; } echo ''; echo ''; echo ''; echo ''; echo '

', i18n::translate('My Account'), '

'; echo i18n::translate('User name'), help_link('edituser_username'), ''; echo ''; echo '
'; echo i18n::translate('Real name'), help_link('edituser_realname'), ''; echo ''; echo '
'; echo i18n::translate('GEDCOM INDI record ID'), help_link('edituser_gedcomid'), ''; echo $person->format_list('span'); echo '
'; echo i18n::translate('Pedigree Chart Root Person'), help_link('edituser_rootid'), ''; echo ''; echo print_findindi_link('rootid', '', true), '
'; if ($person) { echo $person->format_list('span'); } echo '
'; echo i18n::translate('Password'), ''; echo ' ', i18n::translate('Leave password blank if you want to keep the current password.'), help_link('edituser_password'), '
'; echo i18n::translate('Confirm Password'), help_link('edituser_conf_password'), ''; echo '
'; echo i18n::translate('Change Language'), help_link('edituser_change_lang'); echo ''; echo edit_field_language('form_language', get_user_setting(WT_USER_ID, 'language'), 'tabindex="'.(++$tab).'"'); echo '
'; echo i18n::translate('Email Address'), help_link('edituser_email'), ''; echo '
'; echo i18n::translate('My Theme'), help_link('edituser_user_theme'), ''; echo '
'; echo i18n::translate('Preferred Contact Method'), help_link('edituser_user_contact'); echo ''; echo edit_field_contact('form_contact_method', get_user_setting(WT_USER_ID, 'contactmethod'), 'tabindex="'.(++$tab).'"'); echo '
'; echo i18n::translate('Visible to other users when online'), help_link('useradmin_visibleonline'), ''; echo '
'; echo i18n::translate('Default Tab to show on Individual Information page'), help_link('edituser_user_default_tab'), ''; echo edit_field_default_tab('form_default_tab', get_user_setting(WT_USER_ID, 'defaulttab'), 'tabindex="'.(++$tab).'"'); echo '
'; print_footer(); ?>