diff options
author | matteo <matteo.pasotti@gmail.com> | 2014-07-02 00:35:47 +0300 |
---|---|---|
committer | matteo <matteo.pasotti@gmail.com> | 2014-07-02 00:35:47 +0300 |
commit | 94fddcaad5a0c3e6f8cb4d7504f4e5b0443b99bc (patch) | |
tree | a3302bb9a5997dfaf085ede1faa465ea4fde3ca1 /lib/AdminPanel/Module/Proxy.pm | |
parent | ea2f79bc9b87773f934c60821d0c2ce3e94166b1 (diff) | |
download | manatools-94fddcaad5a0c3e6f8cb4d7504f4e5b0443b99bc.tar manatools-94fddcaad5a0c3e6f8cb4d7504f4e5b0443b99bc.tar.gz manatools-94fddcaad5a0c3e6f8cb4d7504f4e5b0443b99bc.tar.bz2 manatools-94fddcaad5a0c3e6f8cb4d7504f4e5b0443b99bc.tar.xz manatools-94fddcaad5a0c3e6f8cb4d7504f4e5b0443b99bc.zip |
check for root capability; ask for X restart after settings are saved
Diffstat (limited to 'lib/AdminPanel/Module/Proxy.pm')
-rw-r--r-- | lib/AdminPanel/Module/Proxy.pm | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/lib/AdminPanel/Module/Proxy.pm b/lib/AdminPanel/Module/Proxy.pm index 11aae182..ed3daffb 100644 --- a/lib/AdminPanel/Module/Proxy.pm +++ b/lib/AdminPanel/Module/Proxy.pm @@ -24,6 +24,7 @@ use Modern::Perl '2011'; use autodie; use Moose; use POSIX qw(ceil); +use English; use utf8; use yui; @@ -31,6 +32,10 @@ use AdminPanel::Shared qw(trim); use AdminPanel::Shared::GUI; use AdminPanel::Shared::Proxy; +# TODROP but provides network::network +use lib qw(/usr/lib/libDrakX); +use network::network; + extends qw( AdminPanel::Module ); @@ -108,9 +113,23 @@ sub init_proxy { sub start { my $self = shift; + if ($EUID != 0) { + $self->sh_gui->warningMsgBox({ + title => $self->name, + text => "root privileges required", + }); + return; + } + $self->_manageProxyDialog(); }; +sub ask_for_X_restart { + my $self = shift; + + $self->sh_gui->warningMsgBox({title=>'X Restart Required',text=>'You need to log out and back in again for changes to take effect',richtext=>1}); +} + sub validate { my $self = shift; my $proxy = shift; @@ -255,8 +274,8 @@ sub _manageProxyDialog { # validation succeded $self->proxy(\%_proxy); # save changes - use Data::Dumper; - print Dumper($self->proxy); + network::network::proxy_configure($self->proxy); + $self->ask_for_X_restart(); last; } # validation failed |