vncserver: extract EnsureAtLeastOneKasmUserExists()

This commit is contained in:
Dmitry Maksyoma 2021-08-10 21:45:41 +12:00
parent 65f957695e
commit 2b4f01f5ae

View File

@ -42,10 +42,8 @@ $pidFile = "$vncUserDir/$host:$displayNumber.pid";
$kasmAuthEnabled = 1;
&DisableVncAuth();
@kasmPasswdUsers = &LoadKasmPasswdUsers();
if ($kasmAuthEnabled && !&AtLeastOneUserConfigured()) {
&GuideUserToSetupKasmPasswdUser();
@kasmPasswdUsers = &LoadKasmPasswdUsers();
if ($kasmAuthEnabled) {
&EnsureAtLeastOneKasmUserExists();
}
&SetupXauthorityFile();
@ -1048,3 +1046,11 @@ sub PrepareDefaultsForPassingToXvnc {
&SetReasonabeDefaults();
&LoadSystemThenUserThenMandatoryConfigs();
}
sub EnsureAtLeastOneKasmUserExists {
@kasmPasswdUsers = &LoadKasmPasswdUsers();
if (!&AtLeastOneUserConfigured()) {
&GuideUserToSetupKasmPasswdUser();
@kasmPasswdUsers = &LoadKasmPasswdUsers();
}
}