diff --git a/modules/profile.module b/modules/profile.module index c5d04429096..61736654884 100644 --- a/modules/profile.module +++ b/modules/profile.module @@ -52,11 +52,11 @@ function profile_settings() { $profile_register_fields = variable_get("profile_register_fields", array()); $output = "\n"; - $output .= "\n"; + $output .= "\n"; foreach ($profile_fields as $key => $field) { $output .= ""; - $output .= ""; $output .= ""; + $output .= ""; $output .= ""; $output .= ""; $output .= "\n"; @@ -135,15 +135,16 @@ function _profile_form($edit, $mode) { } function _profile_validate($edit, $mode) { + global $profile_fields, $user, $HTTP_POST_VARS; - $req_fields = _profile_active_fields($mode); + $enabled_fields = _profile_active_fields($mode); - if (in_array("birthday", $req_fields) && ($birth_error = _profile_validate_birth($edit))) { + if (in_array("birthday", $enabled_fields) && ($birth_error = _profile_validate_birth($edit))) { $error .= $birth_error."
"; } - if (in_array("avatar", $req_fields) && ($avatar_error = _profile_validate_avatar($edit))) { + if (in_array("avatar", $enabled_fields) && ($avatar_error = _profile_validate_avatar($edit))) { $error .= $avatar_error."
"; } @@ -156,7 +157,7 @@ function _profile_validate($edit, $mode) { // now check for required fields foreach(_profile_active_fields("required") as $required) { - if (in_array($required, $req_fields)) { + if (in_array($required, $enabled_fields)) { if (!$edit["profile_".$required]) { $error .= t("This required field is missing: %a", array("%a" => $profile_fields[$required][1]))."
"; } diff --git a/modules/profile/profile.module b/modules/profile/profile.module index c5d04429096..61736654884 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -52,11 +52,11 @@ function profile_settings() { $profile_register_fields = variable_get("profile_register_fields", array()); $output = "
fieldpublicprivaterequiredshow in registration form
fieldenablepublicrequiredshow in registration form
$field[1]". form_checkbox("", "profile_public_fields][", $key, in_array($key, $profile_public_fields)) ."". form_checkbox("", "profile_private_fields][", $key, in_array($key, $profile_private_fields)) ."". form_checkbox("", "profile_public_fields][", $key, in_array($key, $profile_public_fields)) ."". form_checkbox("", "profile_required_fields][", $key, in_array($key, $profile_required_fields)) ."". form_checkbox("", "profile_register_fields][", $key, in_array($key, $profile_register_fields)) ."
\n"; - $output .= "\n"; + $output .= "\n"; foreach ($profile_fields as $key => $field) { $output .= ""; - $output .= ""; $output .= ""; + $output .= ""; $output .= ""; $output .= ""; $output .= "\n"; @@ -135,15 +135,16 @@ function _profile_form($edit, $mode) { } function _profile_validate($edit, $mode) { + global $profile_fields, $user, $HTTP_POST_VARS; - $req_fields = _profile_active_fields($mode); + $enabled_fields = _profile_active_fields($mode); - if (in_array("birthday", $req_fields) && ($birth_error = _profile_validate_birth($edit))) { + if (in_array("birthday", $enabled_fields) && ($birth_error = _profile_validate_birth($edit))) { $error .= $birth_error."
"; } - if (in_array("avatar", $req_fields) && ($avatar_error = _profile_validate_avatar($edit))) { + if (in_array("avatar", $enabled_fields) && ($avatar_error = _profile_validate_avatar($edit))) { $error .= $avatar_error."
"; } @@ -156,7 +157,7 @@ function _profile_validate($edit, $mode) { // now check for required fields foreach(_profile_active_fields("required") as $required) { - if (in_array($required, $req_fields)) { + if (in_array($required, $enabled_fields)) { if (!$edit["profile_".$required]) { $error .= t("This required field is missing: %a", array("%a" => $profile_fields[$required][1]))."
"; }
fieldpublicprivaterequiredshow in registration form
fieldenablepublicrequiredshow in registration form
$field[1]". form_checkbox("", "profile_public_fields][", $key, in_array($key, $profile_public_fields)) ."". form_checkbox("", "profile_private_fields][", $key, in_array($key, $profile_private_fields)) ."". form_checkbox("", "profile_public_fields][", $key, in_array($key, $profile_public_fields)) ."". form_checkbox("", "profile_required_fields][", $key, in_array($key, $profile_required_fields)) ."". form_checkbox("", "profile_register_fields][", $key, in_array($key, $profile_register_fields)) ."