AdminAccountPage: Fix `Variable '$groups, $users' are probably undefined`

This commit is contained in:
Sukhwinder Dhillon 2023-08-16 11:02:57 +02:00 committed by raviks789
parent d1bfde0dc5
commit 01352cf6c2
1 changed files with 2 additions and 0 deletions

View File

@ -101,6 +101,7 @@ class AdminAccountPage extends Form
public function createElements(array $formData)
{
$choices = array();
$groups = [];
if ($this->backendConfig['backend'] !== 'db') {
$choices['by_name'] = $this->translate('By Name', 'setup.admin');
$choice = isset($formData['user_type']) ? $formData['user_type'] : 'by_name';
@ -116,6 +117,7 @@ class AdminAccountPage extends Form
$choice = isset($formData['user_type']) ? $formData['user_type'] : 'new_user';
}
$users = [];
if (in_array($this->backendConfig['backend'], array('db', 'ldap', 'msldap'))) {
$users = $this->fetchUsers();
if (! empty($users)) {