Do not echo loginPassword in PackageUpdateServerEditForm
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 19 Aug 2020 12:39:22 +0000 (14:39 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 19 Aug 2020 13:07:48 +0000 (15:07 +0200)
wcfsetup/install/files/acp/templates/packageUpdateServerAdd.tpl
wcfsetup/install/files/lib/acp/form/PackageUpdateServerEditForm.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index f3bffa417d9edecfb468e4218d3fdcb146a56ea6..0f05d9920221e6b454f207addfae423e85d7de14 100644 (file)
@@ -49,7 +49,7 @@
                <dl>
                        <dt><label for="loginPassword">{lang}wcf.acp.updateServer.loginPassword{/lang}</label></dt>
                        <dd>
-                               <input type="password" id="loginPassword" name="loginPassword" value="{$loginPassword}" class="medium" autocomplete="off">
+                               <input type="password" id="loginPassword" name="loginPassword" value="{$loginPassword}" class="medium" autocomplete="off"{if $action != 'add' && $loginUsername} placeholder="{lang}wcf.acp.updateServer.loginPassword.noChange{/lang}"{/if}>
                                <small>{lang}wcf.acp.updateServer.loginPassword.description{/lang}</small>
                        </dd>
                </dl>
index 53c5965dbcc288adc69a6923dd408d3c1f09d492..7c0d4d15ba0febe58edadd6c623bf0d12c4cd7a8 100755 (executable)
@@ -51,12 +51,16 @@ class PackageUpdateServerEditForm extends PackageUpdateServerAddForm {
        public function save() {
                AbstractForm::save();
                
-               // save server
-               $this->objectAction = new PackageUpdateServerAction([$this->packageUpdateServerID], 'update', ['data' => array_merge($this->additionalFields, [
+               $data = [
                        'serverURL' => $this->serverURL,
-                       'loginUsername' => $this->loginUsername,
-                       'loginPassword' => $this->loginPassword
-               ])]);
+               ];
+               if ($this->loginUsername != $this->updateServer->loginUsername || $this->loginPassword) {
+                       $data['loginUsername'] = $this->loginUsername;
+                       $data['loginPassword'] = $this->loginPassword;
+               }
+               
+               // save server
+               $this->objectAction = new PackageUpdateServerAction([$this->packageUpdateServerID], 'update', ['data' => array_merge($this->additionalFields, $data)]);
                $this->objectAction->executeAction();
                $this->saved();
                
@@ -73,7 +77,6 @@ class PackageUpdateServerEditForm extends PackageUpdateServerAddForm {
                if (empty($_POST)) {
                        $this->serverURL = $this->updateServer->serverURL;
                        $this->loginUsername = $this->updateServer->loginUsername;
-                       $this->loginPassword = $this->updateServer->loginPassword;
                }
        }
        
index 7a1606133dd8c7501455f92c183f35be99a948b3..77501017c5063489f8191ef7b4267863a59d6a63 100644 (file)
@@ -2777,6 +2777,7 @@ Kein Abschnitt darf leer sein und alle Abschnitten dürfen nur folgende Zeichen
                <item name="wcf.acp.updateServer.lastErrorMessage"><![CDATA[Beim letzten Verbindungsversuch trat folgender Fehler auf:]]></item>
                <item name="wcf.acp.updateServer.loginPassword"><![CDATA[Kennwort]]></item>
                <item name="wcf.acp.updateServer.loginPassword.description"><![CDATA[Kennwort für Authentifizierung (optional)]]></item>
+               <item name="wcf.acp.updateServer.loginPassword.noChange"><![CDATA[(keine Änderung)]]></item>
                <item name="wcf.acp.updateServer.loginUsername"><![CDATA[Benutzername]]></item>
                <item name="wcf.acp.updateServer.loginUsername.description"><![CDATA[Benutzernamen für Authentifizierung (optional)]]></item>
                <item name="wcf.acp.updateServer.packages"><![CDATA[Pakete]]></item>
index f02887f0941c72f3a80065dc0cc9e35333f69f8e..7ec9d1dd766729b68d6d9ca8430bed69eca20554 100644 (file)
@@ -2704,6 +2704,7 @@ If you have <strong>already bought the licenses for the listed apps</strong>, th
                <item name="wcf.acp.updateServer.lastErrorMessage"><![CDATA[Errors occurred on last connection attempt:]]></item>
                <item name="wcf.acp.updateServer.loginPassword"><![CDATA[Password]]></item>
                <item name="wcf.acp.updateServer.loginPassword.description"><![CDATA[Enter your authentication password (optional).]]></item>
+               <item name="wcf.acp.updateServer.loginPassword.noChange"><![CDATA[(no change)]]></item>
                <item name="wcf.acp.updateServer.loginUsername"><![CDATA[Username]]></item>
                <item name="wcf.acp.updateServer.loginUsername.description"><![CDATA[Enter your authentication username (optional).]]></item>
                <item name="wcf.acp.updateServer.packages"><![CDATA[Packages]]></item>