include_once get_path('incRepositorySys') . '/lib/sendmail.lib.php'; include_once get_path('incRepositorySys') . '/lib/fileManage.lib.php'; include_once get_path('incRepositorySys') . '/lib/fileUpload.lib.php'; include_once get_path('incRepositorySys') . '/lib/image.lib.php'; include_once get_path('incRepositorySys') . '/lib/display/dialogBox.lib.php'; $nameTools = get_lang('My user account'); // define display define('DISP_PROFILE_FORM', __LINE__); define('DISP_MOREINFO_FORM', __LINE__); define('DISP_REQUEST_COURSE_CREATOR_STATUS', __LINE__); define('DISP_REQUEST_REVOQUATION', __LINE__); $display = DISP_PROFILE_FORM; /*===================================================================== CONTROLER Section =====================================================================*/ $extraInfoDefList = get_userInfoExtraDefinitionList(); $userId = claro_get_current_user_id(); $userData = user_get_properties($userId); $acceptedCmdList = array('exCCstatus', 'exRevoquation', 'reqCCstatus', 'reqRevoquation', 'editExtraInfo', 'exMoreInfo'); if (isset($_REQUEST['cmd']) && in_array($_REQUEST['cmd'], $acceptedCmdList)) { $cmd = $_REQUEST['cmd']; } else { $cmd = ''; } if (isset($_REQUEST['applyChange'])) { // Get params form the form $userData = user_initialise(); if (get_conf('allow_profile_picture', true)) { // Handle user picture $pictureUpdated = user_handle_profile_picture($userData); if ($pictureUpdated['success']) {
function user_get_extra_data($userId) { $extraInfo = array(); $extraInfoDefList = get_userInfoExtraDefinitionList(); $userInfo = get_user_property_list($userId); /** $extraInfo['user_id']['label'] = get_lang('User id'); $extraInfo['user_id']['value'] = $userId; */ foreach ($extraInfoDefList as $extraInfoDef) { $currentValue = array_key_exists($extraInfoDef['propertyId'], $userInfo) ? $userInfo[$extraInfoDef['propertyId']] : $extraInfoDef['defaultValue']; // propertyId, label, type, defaultValue, required $extraInfo[$extraInfoDef['propertyId']]['label'] = $extraInfoDef['label']; $extraInfo[$extraInfoDef['propertyId']]['value'] = $currentValue; } return $extraInfo; }