瀏覽代碼

change username during reinstall

andre 4 年之前
父節點
當前提交
8656de6e26
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      app/UI/Reinstall/Providers/TemplateInstallProvider.php

+ 3 - 2
app/UI/Reinstall/Providers/TemplateInstallProvider.php

@@ -113,11 +113,12 @@ class TemplateInstallProvider extends BaseDataProvider implements ClientArea, Ad
             $this->configuration()->isAgentServicePassword() &&
             !$this->configuration()->isAgentTemplateUser() &&
             preg_match('/w/', $vm ->config()['ostype'])){
-            $ciuser =  $vm->config()['ciuser'];
+            $ciuser =  $this->formData['username'] ? $this->formData['username'] : $vm->config()['ciuser'];
             $this->hosting()->update(['username' => $ciuser ?: 'Administrator' ]);
         }
         elseif($this->configuration()->isQemu() && $this->configuration()->getCiuser()){
-            $this->hosting()->update(['username' => $this->formData['username'] ? $this->formData['username'] : $this->configuration()->getCiuser() ]);
+            $ciuser =  $this->formData['username'] ? $this->formData['username'] : $vm->config()['ciuser'];
+            $this->hosting()->update(['username' => $ciuser ?: 'root' ]]);
         }
         $arguments = [
             'hostingId'  => $this->getWhmcsParamByKey('serviceid'),