vncserver: refactor

This commit is contained in:
Dmitry Maksyoma 2021-08-10 21:19:07 +12:00
parent 13f4ce0fba
commit 06e9e92ee1

View File

@ -39,13 +39,12 @@ $desktopName = $opt{'-name'} || "$host:$displayNumber ($ENV{USER})";
$kasmAuthEnabled = 1; $kasmAuthEnabled = 1;
&DisableVncAuth(); &DisableVncAuth();
$kasmPasswdFile = "$ENV{HOME}/.kasmpasswd";
@kasmPasswdUsers = &LoadKasmPasswdUsers();
@kasmPasswdUsers = &LoadKasmPasswdUsers();
if ($kasmAuthEnabled && !&AtLeastOneUserConfigured()) { if ($kasmAuthEnabled && !&AtLeastOneUserConfigured()) {
&GuideUserToSetupKasmPasswdUser(); &GuideUserToSetupKasmPasswdUser();
@kasmPasswdUsers = &LoadKasmPasswdUsers();
} }
@kasmPasswdUsers = &LoadKasmPasswdUsers();
$desktopLog = "$vncUserDir/$host:$displayNumber.log"; $desktopLog = "$vncUserDir/$host:$displayNumber.log";
unlink($desktopLog); unlink($desktopLog);
@ -1002,6 +1001,7 @@ sub SetGlobalVariables {
$vncUserDir = "$ENV{HOME}/.vnc"; $vncUserDir = "$ENV{HOME}/.vnc";
$vncUserConfig = "$vncUserDir/config"; $vncUserConfig = "$vncUserDir/config";
$vncUserName = &DetectUserName(); $vncUserName = &DetectUserName();
$kasmPasswdFile = "$ENV{HOME}/.kasmpasswd";
$vncSystemConfigDir = "/etc/kasmvnc"; $vncSystemConfigDir = "/etc/kasmvnc";
$vncSystemConfigDefaultsFile = "$vncSystemConfigDir/vncserver-config-defaults"; $vncSystemConfigDefaultsFile = "$vncSystemConfigDir/vncserver-config-defaults";