From: opensides Date: Sat, 27 Mar 2010 23:22:25 +0000 (+0000) Subject: - Corrected open perl function, corrected variable passing to open and close X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ba23158b9133ec21f0898fbfa49b1d9023b6ee96;p=gosa.git - Corrected open perl function, corrected variable passing to open and close git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17316 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/client/events/dak.pm b/gosa-si/client/events/dak.pm index c1566a8ee..57c2f8533 100644 --- a/gosa-si/client/events/dak.pm +++ b/gosa-si/client/events/dak.pm @@ -3,7 +3,14 @@ # @brief Implementation of a GOsa-SI-client event module. package dak; + +use strict; +use warnings; use Exporter; + +use GOSA::GosaSupportDaemon; +use MIME::Base64; + @ISA = qw(Exporter); my @events = ( "get_events", @@ -13,12 +20,6 @@ my @events = ( ); @EXPORT = @events; - -use strict; -use warnings; -use GOSA::GosaSupportDaemon; -use MIME::Base64; - BEGIN {} END {} @@ -129,7 +130,7 @@ sub import_dak_key { &add_content2xml_hash($out_hash, "error", "DAK Keyring is not writable"); } else { my $keyfile; - open($keyfile, ">/tmp/gosa_si_tmp_dak_key"); + open($keyfile, ">","/tmp/gosa_si_tmp_dak_key"); print $keyfile $key; close($keyfile); my $command = "$gpg --import /tmp/gosa_si_tmp_dak_key"; diff --git a/gosa-si/client/events/gosaTriggered.pm b/gosa-si/client/events/gosaTriggered.pm index e73b69f7c..3b6f9678a 100644 --- a/gosa-si/client/events/gosaTriggered.pm +++ b/gosa-si/client/events/gosaTriggered.pm @@ -27,7 +27,15 @@ Andreas Rettenberger package gosaTriggered; + +use strict; +use warnings; use Exporter; + +use GOSA::GosaSupportDaemon; +use MIME::Base64; +use File::Temp qw/ tempfile/; + @ISA = qw(Exporter); my @events = ( "get_events", @@ -43,12 +51,6 @@ my @events = ( ); @EXPORT = @events; -use strict; -use warnings; -use GOSA::GosaSupportDaemon; -use MIME::Base64; -use File::Temp qw/ tempfile/; - BEGIN {} END {} @@ -191,9 +193,9 @@ sub trigger_action_localboot { # Check logged in user my @user_list = &get_logged_in_users; if( @user_list >= 1 ) { - open(FILE, "> /etc/gosa-si/event"); - print FILE "trigger_action_localboot\n"; - close(FILE); + open($FILE, ">", "/etc/gosa-si/event"); + print $FILE "trigger_action_localboot\n"; + close($FILE); } } else { @@ -291,9 +293,9 @@ sub trigger_action_reboot { my @user_list = &get_logged_in_users; if( @user_list >= 1 ) { system( "/usr/bin/goto-notify reboot" ); - open(FILE, "> /etc/gosa-si/event"); - print FILE "reboot\n"; - close(FILE); + open($FILE, ">", "/etc/gosa-si/event"); + print $FILE "reboot\n"; + close($FILE); } } else { @@ -353,9 +355,9 @@ sub trigger_action_halt { my @user_list = &get_logged_in_users; if( @user_list >= 1 ) { system( "/usr/bin/goto-notify halt" ); - open(FILE, "> /etc/gosa-si/event"); - print FILE "halt\n"; - close(FILE); + open($FILE, ">", "/etc/gosa-si/event"); + print $FILE "halt\n"; + close($FILE); } } else { system( "/sbin/shutdown -h +$timeout &" ); @@ -405,9 +407,9 @@ sub trigger_action_reinstall { my @user_list = &get_logged_in_users; if( @user_list >= 1 ) { system( "/usr/bin/goto-notify install" ); - open(FILE, "> /etc/gosa-si/event"); - print FILE "install\n"; - close(FILE); + open($FILE, ">", "/etc/gosa-si/event"); + print $FILE "install\n"; + close($FILE); } } else { system( "/sbin/shutdown -r now &" );