Code

- Corrected open perl function, corrected variable passing to open and close
authoropensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8>
Sat, 27 Mar 2010 23:22:25 +0000 (23:22 +0000)
committeropensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8>
Sat, 27 Mar 2010 23:22:25 +0000 (23:22 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17316 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/client/events/dak.pm
gosa-si/client/events/gosaTriggered.pm

index c1566a8ee0d327dd1fce049da3f2a03636143f5a..57c2f85337f769dfd0f322f4ebe3e62310f26f09 100644 (file)
@@ -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";
index e73b69f7c1bc168dfa3ba5158a707eab7caea175..3b6f9678a23f141028684689f622d4b3d828451c 100644 (file)
@@ -27,7 +27,15 @@ Andreas Rettenberger <rettenberger at gonicus dot de>
 
 
 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 &" );