aboutsummaryrefslogtreecommitdiffstats
path: root/config/autoconfigbackup
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2014-11-22 19:36:51 +0545
committerPhil Davis <phil.davis@inf.org>2014-11-22 19:36:51 +0545
commit67d07eab15f401cd9477d8c34fcf6d501a7014a5 (patch)
treef15b25fe0d42bec38ff382c3ee2b175121be6fc3 /config/autoconfigbackup
parent47c892d0e3a21da98ddb164a62ea815a34c36914 (diff)
downloadpfsense-packages-67d07eab15f401cd9477d8c34fcf6d501a7014a5.tar.gz
pfsense-packages-67d07eab15f401cd9477d8c34fcf6d501a7014a5.tar.bz2
pfsense-packages-67d07eab15f401cd9477d8c34fcf6d501a7014a5.zip
AutoConfigBackup current host appears twice in dropdown
When building the lists of available host names on the Restore tab, the current host is listed twice if it already has some backups. This makes the code a bit smarter to not do that. IMHO not worth updating the version number, since this is purely cosmetic.
Diffstat (limited to 'config/autoconfigbackup')
-rw-r--r--config/autoconfigbackup/autoconfigbackup.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/config/autoconfigbackup/autoconfigbackup.php b/config/autoconfigbackup/autoconfigbackup.php
index 755c47aa..52b3eca9 100644
--- a/config/autoconfigbackup/autoconfigbackup.php
+++ b/config/autoconfigbackup/autoconfigbackup.php
@@ -357,10 +357,17 @@ EOF;
<center>
<b>Hostname:</b>
<select id="hostname" name="hostname" onChange="document.location='autoconfigbackup.php?hostname=' + this.value;">
- <?foreach($hostnames as $hn):?>
- <option value='<?=$hn?>'><?=$hn?></option>
+ <?
+ $host_not_found = true;
+ foreach($hostnames as $hn):
+ ?>
+ <option value='<?=$hn?>' <? if ($hn == $hostname) {echo " selected=\"selected\""; $host_not_found = false;}?>>
+ <?=$hn?>
+ </option>
<?endforeach?>
- <option value='<?=$hostname?>' SELECTED><?=$hostname?></option>
+ <? if ($host_not_found) { ?>
+ <option value='<?=$hostname?>' SELECTED><?=$hostname?></option>
+ <? } ?>
</select>
</td>
</tr>