Просмотр исходного кода

change username during reinstall

andre 4 лет назад
Родитель
Сommit
3bc4677de5

+ 3 - 0
app/UI/Reinstall/Forms/TemplateInstallForm.php

@@ -58,6 +58,9 @@ class TemplateInstallForm extends BaseForm implements ClientArea, AdminArea
 
         //entity id
         $this->addField(new Hidden("id"));
+        //user
+        $field = new Text('username');
+        $this->addField($field);
         //password
         $field = new Text('password');
         $field->notEmpty();

+ 1 - 1
app/UI/Reinstall/Providers/TemplateInstallProvider.php

@@ -117,7 +117,7 @@ class TemplateInstallProvider extends BaseDataProvider implements ClientArea, Ad
             $this->hosting()->update(['username' => $ciuser ?: 'Administrator' ]);
         }
         elseif($this->configuration()->isQemu() && $this->configuration()->getCiuser()){
-            $this->hosting()->update(['username' =>$this->configuration()->getCiuser() ]);
+            $this->hosting()->update(['username' => $this->formData['username'] ? $this->formData['username'] : $this->configuration()->getCiuser() ]);
         }
         $arguments = [
             'hostingId'  => $this->getWhmcsParamByKey('serviceid'),