Code

clean ups
authorrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 Mar 2008 14:35:01 +0000 (14:35 +0000)
committerrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 Mar 2008 14:35:01 +0000 (14:35 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9360 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/gosa-si-client
gosa-si/tests/client.php
gosa-si/tests/sqlite-check-server.pl

index 4e48451073feb9254a50962b422e89e4c502fa67..9f945819e39c650c51ab7666334623fd786d73d1 100755 (executable)
@@ -601,12 +601,8 @@ sub send_msg_to_target {
     my ($msg, $address, $encrypt_key, $msg_header) = @_ ;
     my $error = 0;
 
-    if( $msg_header ) {
-        $msg_header = "'$msg_header'-";
-    }
-    else {
-        $msg_header = "";
-    }
+    if( $msg_header ) { $msg_header = "'$msg_header'-"; }
+    else { $msg_header = ""; }
 
     # encrypt xml msg
     my $crypted_msg = &encrypt_msg($msg, $encrypt_key);
@@ -618,13 +614,11 @@ sub send_msg_to_target {
         $error++;
     }
     
+    # send xml msg
     if( $error == 0 ) {
-        # send xml msg
         print $socket $crypted_msg."\n";
-
         daemon_log("send ".$msg_header."msg to $address", 1);
         daemon_log("message:\n$msg", 8);
-
     }
 
     # close socket in any case
index 1d53e1ad60444776217dff9d84e4449c70d4e1c3..7632f70f6b82e5d59e4cd138aa27ff9c8afdec96 100755 (executable)
@@ -9,7 +9,7 @@ $zahl= 1;
 for($count = 1; $count <= $zahl; $count++)
 {
 
-$sock = new Socket_Client("127.0.0.1","20081",TRUE,1);
+$sock = new Socket_Client("127.0.0.1","20181",TRUE,1);
 $sock->setEncryptionKey("secret-gosa-password");
 
 if($sock->connected()){
@@ -32,7 +32,7 @@ if($sock->connected()){
 
 # jobdb update  
 #$data = "<xml> <header>gosa_update_status_jobdb_entry</header> <source>GOSA</source> <target>GOSA</target> <where><clause><phrase> <id>1</id></phrase></clause></where> <update><timestamp>19700101000000</timestamp></update></xml>";
-#$data = "<xml> <header>gosa_update_status_jobdb_entry</header> <source>GOSA</source><target>GOSA</target><where><clause><phrase> <macaddress>00:01:6c:9d:b9:fa</macaddress></phrase></clause> </where> <update><status>done</status> <result>update</result></update></xml>";
+#$data = "<xml> <header>gosa_update_status_jobdb_entry</header> <source>GOSA</source><target>GOSA</target><where><clause><phrase> <macaddress>00:01:6c:9d:b9:fa</macaddress></phrase></clause> </where> <update><status>processing</status> <result>update</result></update></xml>";
 
 # jobdb query
 #$data = "<xml><header>gosa_query_jobdb</header><source>GOSA</source> <target>GOSA</target>".
@@ -51,7 +51,7 @@ if($sock->connected()){
 #$data = "<xml> <header>gosa_clear_jobdb</header> <source>GOSA</source> <target>GOSA</target></xml>";
 
 # set gosa-si-client to 'activated'
-#$data = "<xml> <header>job_set_activated_for_installation</header> <target>10.89.1.31:20083</target> <source>GOSA</source> <macaddress>00:01:6c:9d:b9:fa</macaddress></xml>";
+#$data = "<xml> <header>job_set_activated_for_installation</header> <target>10.89.1.31:20083</target> <source>GOSA</source> <macaddress>00:01:6c:9d:b9:fa</macaddress><timestamp>22220101000000</timestamp></xml>";
 
 
 
@@ -59,7 +59,7 @@ if($sock->connected()){
 #$data = "<xml> <header>gosa_detect_hardware</header> <target>10.89.1.31:20083</target> <source>10.89.1.31:20081</source> </xml>";
 #$data = "<xml> <header>gosa_new_key_for_client</header> <target>00:01:6c:9d:b9:fa</target> <source>10.89.1.31:20081</source> </xml>";
 #$data = "<xml> <header>job_trigger_action_wake</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> <timestamp>19700101000000</timestamp></xml>";
-#$data = "<xml> <header>gosa_trigger_action_faireboot</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> </xml>";
+$data = "<xml> <header>gosa_trigger_action_faireboot</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> </xml>";
 #$data = "<xml> <header>job_trigger_action_reinstall</header> <source>GOSA</source> <target>00:01:6c:9d:b9:fa</target> <macaddress>00:01:6c:9d:b9:fa</macaddress> <timestamp>20130101000000</timestamp> </xml>";
 #$data = "<xml> <header>gosa_ping</header> <target>00:01:6c:9d:b9:fa</target> <source>GOSA</source> </xml>";
 
@@ -91,7 +91,7 @@ if($sock->connected()){
 # testing
 #$data = "<xml> <header>gosa_send_user_msg</header> <target>GOSA</target> <source>GOSA</source> <user>susi</user> <user>harald</user> <user>susi</user> <group>gosa-admins-all</group> </xml>"; 
 #$data = "<xml> <header>gosa_send_user_msg</header> <target>GOSA</target> <source>GOSA</source> <group>gosa-admins-all</group> <usrmesg>kaffeepause</usrmesg> </xml>"; 
-$data = "<xml> <header>gosa_send_user_msg</header> <target>GOSA</target> <source>GOSA</source> <user>cajus.pollmeier</user> <message>kaffeepause</message> </xml>"; 
+#$data = "<xml> <header>gosa_send_user_msg</header> <target>GOSA</target> <source>GOSA</source> <user>cajus.pollmeier</user> <message>kaffeepause</message> </xml>"; 
 
 
     $sock->write($data);
index 0940a30e717fd13a1cd39a8bbc50a3590078d5f5..d4d51a9f8a517cd2e71e7d4f71cae6c173cc5d01 100755 (executable)
@@ -87,18 +87,5 @@ if (-e $db_name) {
     print $answer."\n";
 }
 
-$db_name = "/var/lib/gosa-si/fai.db";
-if (-e $db_name) {
-    print "\n############################################################\n";
-    my $table_name = "fai_server";
-    print "$db_name\n";
-    print "$table_name\n";
-
-    my $sqlite = GOSA::DBsqlite->new($db_name);
-    my $col_names = $sqlite->get_table_columns($table_name);
-    print join(', ', @{ $col_names } )."\n" ;
-    my $answer = $sqlite->show_table($table_name);
-    print $answer."\n";
-}
 
 print "\nFINISH\n";