aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AdminPanel/Module/Proxy.pm
diff options
context:
space:
mode:
authormatteo <matteo.pasotti@gmail.com>2014-07-02 01:04:56 +0300
committermatteo <matteo.pasotti@gmail.com>2014-07-02 01:04:56 +0300
commit64c6a43e2969ba1246ffb95416d6413e8b83ebb7 (patch)
tree7fd06ca8db838e5158a35197eba2e213a98cb603 /lib/AdminPanel/Module/Proxy.pm
parent540b36d25e82ed2f2643250f254c6fc9e4a62ad2 (diff)
downloadcolin-keep-64c6a43e2969ba1246ffb95416d6413e8b83ebb7.tar
colin-keep-64c6a43e2969ba1246ffb95416d6413e8b83ebb7.tar.gz
colin-keep-64c6a43e2969ba1246ffb95416d6413e8b83ebb7.tar.bz2
colin-keep-64c6a43e2969ba1246ffb95416d6413e8b83ebb7.tar.xz
colin-keep-64c6a43e2969ba1246ffb95416d6413e8b83ebb7.zip
retrieve system settings and populate the input fields if needed
Diffstat (limited to 'lib/AdminPanel/Module/Proxy.pm')
-rw-r--r--lib/AdminPanel/Module/Proxy.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/AdminPanel/Module/Proxy.pm b/lib/AdminPanel/Module/Proxy.pm
index ed3daff..4e6b96e 100644
--- a/lib/AdminPanel/Module/Proxy.pm
+++ b/lib/AdminPanel/Module/Proxy.pm
@@ -35,6 +35,7 @@ use AdminPanel::Shared::Proxy;
# TODROP but provides network::network
use lib qw(/usr/lib/libDrakX);
use network::network;
+use MDK::Common::System qw(getVarsFromSh);
extends qw( AdminPanel::Module );
@@ -170,6 +171,9 @@ sub _manageProxyDialog {
my $label_width = 25;
my $inputfield_width = 45;
+ # getVarsFromSh returns an empty hash if no vars are defined
+ my $proxy_curr_settings = { getVarsFromSh('/etc/profile.d/proxy.sh') };
+
#
# @layout
#
@@ -206,6 +210,7 @@ sub _manageProxyDialog {
# http proxy section
my $httpproxy_label = $factory->createLabel($vbox_labels_flags, "HTTP proxy");
my $http_proxy = $factory->createInputField($factory->createHBox($vbox_inputfields),"",0);
+ $http_proxy->setValue($proxy_curr_settings->{http_proxy}) if(defined($proxy_curr_settings->{http_proxy}));
$http_proxy->setWeight($yui::YD_HORIZ, 30);
# flag to setup the https proxy with the same value of the http proxy
@@ -216,16 +221,19 @@ sub _manageProxyDialog {
# https proxy
$factory->createLabel($vbox_labels_flags, "HTTPS proxy");
my $https_proxy = $factory->createInputField($factory->createHBox($vbox_inputfields),"",0);
+ $https_proxy->setValue($proxy_curr_settings->{https_proxy}) if(defined($proxy_curr_settings->{https_proxy}));
$https_proxy->setWeight($yui::YD_HORIZ, 30);
# ftp proxy
$factory->createLabel($vbox_labels_flags, "FTP proxy");
my $ftp_proxy = $factory->createInputField($factory->createHBox($vbox_inputfields),"",0);
+ $ftp_proxy->setValue($proxy_curr_settings->{ftp_proxy}) if(defined($proxy_curr_settings->{ftp_proxy}));
$ftp_proxy->setWeight($yui::YD_HORIZ, 30);
# no-proxy list
$factory->createLabel($vbox_labels_flags, "No proxy for (comma separated list):");
my $no_proxy = $factory->createInputField($factory->createHBox($vbox_inputfields),"",0);
+ $no_proxy->setValue($proxy_curr_settings->{no_proxy}) if(defined($proxy_curr_settings->{no_proxy}));
$no_proxy->setWeight($yui::YD_HORIZ, 30);
my $hbox_filler = $factory->createHBox($layout);