Переглянути джерело

change username during reinstall

andre 4 роки тому
батько
коміт
8656de6e26

+ 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'),