function profile_create_unique($p_user_id, $p_platform, $p_os, $p_os_build, $p_description) { $t_profile_id = profile_exists($p_platform, $p_os, $p_os_build); if ($t_profile_id === false) { $t_profile_id = profile_create($p_user_id, $p_platform, $p_os, $p_os_build, $p_description); } return $t_profile_id; }
break; case 'add': $f_platform = gpc_get_string('platform'); $f_os = gpc_get_string('os'); $f_os_build = gpc_get_string('os_build'); $f_description = gpc_get_string('description'); $t_user_id = gpc_get_int('user_id'); if (ALL_USERS != $t_user_id) { $t_user_id = auth_get_current_user_id(); } if (ALL_USERS == $t_user_id) { access_ensure_global_level(config_get('manage_global_profile_threshold')); } else { access_ensure_global_level(config_get('add_profile_threshold')); } profile_create($t_user_id, $f_platform, $f_os, $f_os_build, $f_description); form_security_purge('profile_update'); if (ALL_USERS == $t_user_id) { print_header_redirect('manage_prof_menu_page.php'); } else { print_header_redirect('account_prof_menu_page.php'); } break; case 'update': $f_platform = gpc_get_string('platform'); $f_os = gpc_get_string('os'); $f_os_build = gpc_get_string('os_build'); $f_description = gpc_get_string('description'); if (profile_is_global($f_profile_id)) { access_ensure_global_level(config_get('manage_global_profile_threshold')); profile_update(ALL_USERS, $f_profile_id, $f_platform, $f_os, $f_os_build, $f_description);