Skip to content

Commit

Permalink
[B] input of non_required extra fields in signup form is ignored #2355
Browse files Browse the repository at this point in the history
  • Loading branch information
lianglee committed Mar 1, 2024
1 parent 9807392 commit 3baca59
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions actions/user/register.php
Expand Up @@ -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;
Expand Down
13 changes: 13 additions & 0 deletions classes/OssnUser.php
Expand Up @@ -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();
Expand Down

0 comments on commit 3baca59

Please sign in to comment.