diff --git a/e107_handlers/user_extended_class.php b/e107_handlers/user_extended_class.php index 7969a160a..dcde00140 100644 --- a/e107_handlers/user_extended_class.php +++ b/e107_handlers/user_extended_class.php @@ -281,21 +281,23 @@ class e107_user_extended global $tp; $eufVals = array(); // 'Answer' array $hideFlags = array(); + foreach ($this->fieldDefinitions as $k => $defs) { $category = $defs['user_extended_struct_parent']; - if (($category == 0) || (check_class($this->catDefinitions[$category]['user_extended_struct_applicable']) && check_class($this->catDefinitions[$category]['user_extended_struct_write']))) + if (($category == 0) || ($isSignup && (int) $this->catDefinitions[$category]['user_extended_struct_applicable'] === (int) e_UC_MEMBER && (int) $this->catDefinitions[$category]['user_extended_struct_write'] === (int) e_UC_MEMBER) || (check_class($this->catDefinitions[$category]['user_extended_struct_applicable']) && check_class($this->catDefinitions[$category]['user_extended_struct_write']))) { // Category applicable to user - if (check_class($defs['user_extended_struct_applicable']) && check_class($defs['user_extended_struct_write'])) + + if (($isSignup && (int) $defs['user_extended_struct_applicable'] === (int) e_UC_MEMBER && (int) $defs['user_extended_struct_write'] === (int) e_UC_MEMBER) || (check_class($defs['user_extended_struct_applicable']) && check_class($defs['user_extended_struct_write']))) { // User can also update field $f = 'user_'.$defs['user_extended_struct_name']; if (isset($inArray[$f]) || ($isSignup && ($defs['user_extended_struct_required'] == 1))) { // Only allow valid keys $val = varset($inArray[$f], FALSE); - $err = $this->user_extended_validate_entry($val, $defs); + $err = $this->user_extended_validate_entry($val, $defs); if ($err === true) { // General error - usually empty field; could be unacceptable value, or regex fail and no error message defined - $eufVals['errortext'][$f] = str_replace('--SOMETHING--',$tp->toHtml($defs['user_extended_struct_text'],FALSE,'defs'),LAN_USER_75); + $eufVals['errortext'][$f] = str_replace('--SOMETHING--',$tp->toHtml(defset($defs['user_extended_struct_text'], $defs['user_extended_struct_text']),FALSE,'defs'),LAN_USER_75); $eufVals['errors'][$f] = ERR_GENERIC; } elseif ($err) diff --git a/e107_handlers/validator_class.php b/e107_handlers/validator_class.php index fee88ef0a..e0e611dd9 100644 --- a/e107_handlers/validator_class.php +++ b/e107_handlers/validator_class.php @@ -1376,6 +1376,10 @@ class validatorClass { $curLine = str_replace('%t', constant($constPrefix.$n), $curLine); // Standard messages } + if(empty($vars['failed'][$f])) + { + $vars['failed'][$f] = LAN_VALIDATE_191; + } $curLine = str_replace('%v', htmlentities($vars['failed'][$f]),$curLine); $curLine = str_replace('%f', $f, $curLine); if ($checkNice & isset($niceNames[$f]['niceName'])) diff --git a/signup.php b/signup.php index a2f18ee25..fdddf8fdb 100644 --- a/signup.php +++ b/signup.php @@ -468,15 +468,15 @@ if (isset($_POST['register'])) // Validate Extended User Fields. $eufVals = array(); - if (isset($_POST['ue'])) + //if (isset($_POST['ue'])) { - $eufVals = $usere->userExtendedValidateAll($_POST['ue'], varset($_POST['hide'],array()), TRUE); // Validate the extended user fields + $eufVals = $usere->userExtendedValidateAll(varset($_POST['ue'], array()), varset($_POST['hide'],array()), TRUE); // Validate the extended user fields } // Determine whether we have an error $error = ((isset($allData['errors']) && count($allData['errors'])) || (isset($eufVals['errors']) && count($eufVals['errors'])) || count($extraErrors)); - + // All validated here - handle any errors if ($error) { @@ -490,10 +490,11 @@ if (isset($_POST['register'])) { $temp[] = validatorClass::makeErrorList($allData,'USER_ERR_','%n - %x - %t: %v', '
', $userMethods->userVettingInfo); } - if (varsettrue($eufData['errors'])) + if (varsettrue($eufVals['errors'])) { - $temp[] = validatorClass::makeErrorList($eufData,'USER_ERR_','%n - %x - %t: %v', '
', $userMethods->userVettingInfo); + $temp[] = validatorClass::makeErrorList($eufVals,'USER_ERR_','%n - %t: %v', '
'); } + message_handler('P_ALERT', implode('
', $temp)); } } // End of data validation