require_api('gpc_api.php'); require_api('html_api.php'); require_api('lang_api.php'); require_api('profile_api.php'); require_api('string_api.php'); if (!config_get('enable_profiles')) { trigger_error(ERROR_ACCESS_DENIED, ERROR); } auth_ensure_user_authenticated(); current_user_ensure_unprotected(); $f_profile_id = gpc_get_int('profile_id'); if (profile_is_global($f_profile_id)) { access_ensure_global_level(config_get('manage_global_profile_threshold')); $row = profile_get_row(ALL_USERS, $f_profile_id); } else { $row = profile_get_row(auth_get_current_user_id(), $f_profile_id); } extract($row, EXTR_PREFIX_ALL, 'v'); html_page_top(); if (profile_is_global($f_profile_id)) { print_manage_menu(); } ?> <?php # Edit Profile Form BEGIN ?> <br /> <div> <form method="post" action="account_prof_update.php"> <?php
/** * Returns whether the specified profile is global * @param int $p_profile_id * @return bool */ function profile_is_global( $p_profile_id ) { $t_row = profile_get_row( ALL_USERS, $p_profile_id ); return( $t_row !== false ); }