mirror of
https://github.com/unraid/webgui.git
synced 2026-01-08 10:39:56 -06:00
Merge pull request #1387 from SimonFair/VNC-Password
Retain VNC password during update.
This commit is contained in:
@@ -1944,6 +1944,20 @@
|
||||
return $var;
|
||||
}
|
||||
|
||||
function domain_get_vnc_password($domain) {
|
||||
$domain_name = $this->domain_get_name($domain) ;
|
||||
$password = shell_exec("cat /etc/libvirt/qemu/'{$domain_name}.xml' | grep 'passwd'") ;
|
||||
|
||||
if (!$password)
|
||||
return '';
|
||||
|
||||
$strpos = strpos($password, "passwd=") +8 ;
|
||||
$endpos = strpos($password, "'",$strpos) ;
|
||||
$password = substr($password,$strpos, $endpos-$strpos) ;
|
||||
|
||||
return $password ;
|
||||
}
|
||||
|
||||
function domain_get_ws_port($domain) {
|
||||
$tmp = $this->get_xpath($domain, '//domain/devices/graphics/@websocket', false);
|
||||
$var = (int)$tmp[0];
|
||||
|
||||
@@ -1149,6 +1149,7 @@ private static $encoding = 'UTF-8';
|
||||
'protocol' => $lv->domain_get_vmrc_protocol($res),
|
||||
'model' => $lv->domain_get_vnc_model($res),
|
||||
'keymap' => $lv->domain_get_vnc_keymap($res),
|
||||
'password' => $lv->domain_get_vnc_password($res),
|
||||
'port' => $vmrcport,
|
||||
'wsport' => $lv->domain_get_ws_port($res),
|
||||
'autoport' => $autoport,
|
||||
|
||||
@@ -1044,7 +1044,7 @@
|
||||
|
||||
<tr class="vncpassword">
|
||||
<td>_(VM Console Password)_:</td>
|
||||
<td><input type="password" name="domain[password]" autocomplete='new-password' title="_(password for VNC)_" placeholder="_(password for VNC)_ (_(optional)_)" /></td>
|
||||
<td><input type="password" name="domain[password]" autocomplete='new-password' value="<?=$arrGPU['password']?>" title="_(password for VNC)_" placeholder="_(password for VNC)_ (_(optional)_)" /></td>
|
||||
</tr>
|
||||
<tr class="<?if ($arrGPU['id'] != 'virtual') echo 'was';?>advanced vnckeymap">
|
||||
<td>_(VM Console Keyboard)_:</td>
|
||||
|
||||
Reference in New Issue
Block a user