diff --git a/actions/user/register.php b/actions/user/register.php index 5cd134697..90d22b784 100644 --- a/actions/user/register.php +++ b/actions/user/register.php @@ -33,6 +33,14 @@ } } } + +//[B] input of non_required extra fields in signup form is ignored #2355 +if($fields && isset($fields['non_required'])) { + foreach($fields['non_required'] as $field){ + $user[$field] = input($field); + } +} + if (isset($json['error']) && !empty($json['error'])) { echo json_encode($json); exit; diff --git a/classes/OssnUser.php b/classes/OssnUser.php index 88418e21c..8ca98a661 100644 --- a/classes/OssnUser.php +++ b/classes/OssnUser.php @@ -115,6 +115,19 @@ public function addUser() { } } } + //[B] input of non_required extra fields in signup form is ignored #2355 + if(!empty($extra_fields['non_required'])) { + foreach ($extra_fields['non_required'] as $type) { + foreach ($type as $field) { + if(isset($this->{$field['name']})) { + $this->subtype = $field['name']; + $this->value = $this->{$field['name']}; + //add entity + $this->add(); + } + } + } + } //v5.1 allow a specific password algorithm for each user $this->subtype = 'password_algorithm'; $this->value = $this->getPassAlog();