|
|
|
@ -17,6 +17,10 @@ $language_file = array('registration', 'messages', 'userInfo'); |
|
|
|
|
$cidReset = true; |
|
|
|
|
require_once '../inc/global.inc.php'; |
|
|
|
|
|
|
|
|
|
if (api_is_profile_readable() == false) { |
|
|
|
|
api_not_allowed(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (api_get_setting('allow_social_tool') == 'true') { |
|
|
|
|
$this_section = SECTION_SOCIAL; |
|
|
|
|
} else { |
|
|
|
@ -72,7 +76,6 @@ function show_icon_edit(element_html) { |
|
|
|
|
} |
|
|
|
|
</script>'; |
|
|
|
|
|
|
|
|
|
//$interbreadcrumb[] = array('url' => '../auth/profile.php', 'name' => get_lang('ModifyProfile')); |
|
|
|
|
if (!empty ($_GET['coursePath'])) { |
|
|
|
|
$course_url = api_get_path(WEB_COURSE_PATH).htmlentities(strip_tags($_GET['coursePath'])).'/index.php'; |
|
|
|
|
$interbreadcrumb[] = array('url' => $course_url, 'name' => Security::remove_XSS($_GET['courseCode'])); |
|
|
|
@ -87,15 +90,15 @@ if (!empty($_GET['fe'])) { |
|
|
|
|
$jquery_ready_content = ''; |
|
|
|
|
if (api_get_setting('allow_message_tool') == 'true') { |
|
|
|
|
$jquery_ready_content = <<<EOF |
|
|
|
|
$(".message-content .message-delete").click(function(){ |
|
|
|
|
$(this).parents(".message-content").animate({ opacity: "hide" }, "slow"); |
|
|
|
|
$(".message-view").animate({ opacity: "show" }, "slow"); |
|
|
|
|
}); |
|
|
|
|
$(".message-content .message-delete").click(function(){ |
|
|
|
|
$(this).parents(".message-content").animate({ opacity: "hide" }, "slow"); |
|
|
|
|
$(".message-view").animate({ opacity: "show" }, "slow"); |
|
|
|
|
}); |
|
|
|
|
EOF; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Libraries |
|
|
|
|
$tool_name = is_profile_editable() ? get_lang('ModifProfile') : get_lang('ViewProfile'); |
|
|
|
|
$tool_name = api_is_profile_editable() ? get_lang('ModifProfile') : get_lang('ViewProfile'); |
|
|
|
|
$table_user = Database :: get_main_table(TABLE_MAIN_USER); |
|
|
|
|
|
|
|
|
|
/* Form */ |
|
|
|
@ -188,7 +191,7 @@ if (api_get_setting('registration', 'email') == 'true' && api_get_setting('profi |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// OPENID URL |
|
|
|
|
if (is_profile_editable() && api_get_setting('openid_authentication') == 'true') { |
|
|
|
|
if (api_is_profile_editable() && api_get_setting('openid_authentication') == 'true') { |
|
|
|
|
$form->addElement('text', 'openid', get_lang('OpenIDURL'), array('size' => 40)); |
|
|
|
|
if (api_get_setting('profile', 'openid') !== 'true') { |
|
|
|
|
$form->freeze('openid'); |
|
|
|
@ -212,7 +215,7 @@ $form->applyFilter('phone', 'trim'); |
|
|
|
|
$form->addRule('phone', get_lang('EmailWrong'), 'email');*/ |
|
|
|
|
|
|
|
|
|
// PICTURE |
|
|
|
|
if (is_profile_editable() && api_get_setting('profile', 'picture') == 'true') { |
|
|
|
|
if (api_is_profile_editable() && api_get_setting('profile', 'picture') == 'true') { |
|
|
|
|
$form->addElement( |
|
|
|
|
'file', |
|
|
|
|
'picture', |
|
|
|
@ -238,7 +241,7 @@ if (api_get_setting('profile', 'language') !== 'true') { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//THEME |
|
|
|
|
if (is_profile_editable() && api_get_setting('user_selected_theme') == 'true') { |
|
|
|
|
if (api_is_profile_editable() && api_get_setting('user_selected_theme') == 'true') { |
|
|
|
|
$form->addElement('select_theme', 'theme', get_lang('Theme')); |
|
|
|
|
if (api_get_setting('profile', 'theme') !== 'true') { |
|
|
|
|
$form->freeze('theme'); |
|
|
|
@ -298,7 +301,7 @@ if (api_get_setting('extended_profile') == 'true') { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// PASSWORD, if auth_source is platform |
|
|
|
|
if (is_platform_authentication() && is_profile_editable() && api_get_setting('profile', 'password') == 'true') { |
|
|
|
|
if (is_platform_authentication() && api_is_profile_editable() && api_get_setting('profile', 'password') == 'true') { |
|
|
|
|
$form->addElement( |
|
|
|
|
'password', |
|
|
|
|
'password0', |
|
|
|
@ -344,7 +347,7 @@ if (api_get_setting('profile', 'apikeys') == 'true') { |
|
|
|
|
); //generate_open_id_form() |
|
|
|
|
} |
|
|
|
|
// SUBMIT |
|
|
|
|
if (is_profile_editable()) { |
|
|
|
|
if (api_is_profile_editable()) { |
|
|
|
|
$form->addElement('style_submit_button', 'apply_change', get_lang('SaveSettings'), 'class="save"'); |
|
|
|
|
} else { |
|
|
|
|
$form->freeze(); |
|
|
|
@ -368,17 +371,6 @@ function is_platform_authentication() |
|
|
|
|
return $tab_user_info['auth_source'] == PLATFORM_AUTH_SOURCE; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns whether a user can edit his/her profile. Defaults to false if |
|
|
|
|
* profileIsEditable is not set in $GLOBALS. |
|
|
|
|
* |
|
|
|
|
* @return boolean Editability of the profile |
|
|
|
|
*/ |
|
|
|
|
function is_profile_editable() |
|
|
|
|
{ |
|
|
|
|
return isset($GLOBALS['profileIsEditable']) ? $GLOBALS['profileIsEditable'] : false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
PRODUCTIONS FUNCTIONS |
|
|
|
|
*/ |
|
|
|
|