Skip to content

Commit

Permalink
fix: corrected check on missing super admin value, closes #2391
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Mar 27, 2023
1 parent 5d2a071 commit fd2cda1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions phpmyfaq/admin/ajax.user.php
Expand Up @@ -123,7 +123,7 @@
$automaticPassword = Filter::filterVar($postData['automaticPassword'], FILTER_VALIDATE_BOOLEAN);
$userPassword = Filter::filterVar($postData['password'], FILTER_UNSAFE_RAW);
$userPasswordConfirm = Filter::filterVar($postData['passwordConfirm'], FILTER_UNSAFE_RAW);
$userIsSuperAdmin = Filter::filterVar($postData['isSuperAdmin'], FILTER_VALIDATE_BOOLEAN);
$userIsSuperAdmin = Filter::filterVar($postData['isSuperAdmin'] ?? false, FILTER_VALIDATE_BOOLEAN);

$newUser = new User($faqConfig);

Expand Down Expand Up @@ -153,7 +153,7 @@
} else {
$newUser->userdata->set(['display_name', 'email', 'is_visible'], [$userRealName, $userEmail, 0]);
$newUser->setStatus('active');
$newUser->setSuperAdmin(!is_null($userIsSuperAdmin));
$newUser->setSuperAdmin($userIsSuperAdmin);
$mailHelper = new MailHelper($faqConfig);
try {
$mailHelper->sendMailToNewUser($newUser, $userPassword);
Expand Down

0 comments on commit fd2cda1

Please sign in to comment.