[Affelio-cvs 998] CVS update: affelio_farm/lib/AffelioFarm/App/Admin

Back to archive index

Tadashi Okoshi slash****@users*****
2005年 12月 21日 (水) 18:39:27 JST


Index: affelio_farm/lib/AffelioFarm/App/Admin/AccountManagement.pm
diff -u affelio_farm/lib/AffelioFarm/App/Admin/AccountManagement.pm:1.1.1.1 affelio_farm/lib/AffelioFarm/App/Admin/AccountManagement.pm:1.2
--- affelio_farm/lib/AffelioFarm/App/Admin/AccountManagement.pm:1.1.1.1	Tue Oct 25 04:14:39 2005
+++ affelio_farm/lib/AffelioFarm/App/Admin/AccountManagement.pm	Wed Dec 21 18:39:26 2005
@@ -122,6 +122,54 @@
 	      throw Affelio::exception::Exception("Error occured in AccountManagement::create: " . $e);
 	  };
 
+	################################################
+	#5.do some operation specified by farm admin.
+	################################################
+	my @ops = split(' ', $farm->{config}->{af_inst_def}->{operation});
+	foreach my $op (@ops){
+	    my ($target, $method, $user, $password) = split(',', $op);
+	    debug_print("AccountManagement::create \t target=$target");
+	    debug_print("AccountManagement::create \t method=$method");
+	    debug_print("AccountManagement::create \t user  =$user");
+	    debug_print("AccountManagement::create \t pass  =$password");
+
+	    require Affelio::misc::WSSE;
+	    my $xwsse = Affelio::misc::WSSE::make_XWSSE($user,
+							$password);
+	    debug_print("AccountManagement::create \t xwsse =$xwsse");
+
+            ###########################
+	    #case op_request_AFlink 
+            ###########################
+	    require XMLRPC::Lite;
+	    if($method =~ /op_request_AFlink/){
+		my $result = eval {
+		    XMLRPC::Lite
+			->proxy("$target/bin/xml-rpc-serv.cgi")
+			->call('affelio.op_request_AFlink',
+			       "1.0",
+			       $xwsse,
+			       $dest_url
+			       )
+			->result;
+		  };
+		debug_print("AccountManagement::create  XML-RPC returned.");
+
+		if ($@) {
+		    throw Affelio::exception::Exception("Error occured in AccountManagement::create: XMLRPC invocation:" . $@);
+		}
+		if ($result->{flerror} ne "0"){
+		    throw Affelio::exception::Exception("Error occured in AccountManagement::create: XMLRPC returns error: [$result->{message}]");
+		}
+
+		debug_print("AccountManagement::create  XML-RPC OK : $result->{message}\n");
+		debug_print("AccountManagement::create  XML-RPC OK : $result->{flerror}]\n");
+
+	    }
+	    #if
+
+        }#while
+
 	return($ret);
     }
 
Index: affelio_farm/lib/AffelioFarm/App/Admin/AffelioInstallDefault.pm
diff -u affelio_farm/lib/AffelioFarm/App/Admin/AffelioInstallDefault.pm:1.1.1.1 affelio_farm/lib/AffelioFarm/App/Admin/AffelioInstallDefault.pm:1.2
--- affelio_farm/lib/AffelioFarm/App/Admin/AffelioInstallDefault.pm:1.1.1.1	Tue Oct 25 04:14:39 2005
+++ affelio_farm/lib/AffelioFarm/App/Admin/AffelioInstallDefault.pm	Wed Dec 21 18:39:26 2005
@@ -54,6 +54,13 @@
 	    $wi->PTN_dirname($cgi->param("sendmail_path"));
 	debug_print("AffelioInstallDefault:save: sendmail_path = $farm->{config}->{af_inst_def}->{sendmail_path}");
 
+	$farm->{config}->{af_inst_def}->{operation} = $cgi->param("operation");
+	$farm->{config}->{af_inst_def}->{operation} =~ s/\r/\n/g;
+	$farm->{config}->{af_inst_def}->{operation} =~ s/\n\n/\n/g;
+	$farm->{config}->{af_inst_def}->{operation} =~ s/\n/ /g;
+
+	debug_print("AffelioInstallDefault:save: operation = $farm->{config}->{af_inst_def}->{operation}");
+
 	$farm->save_config();
 	$farm->load_config();
     }
@@ -75,6 +82,9 @@
 	$output_ref->{sendmail_path} = 
 	    $farm->{config}->{af_inst_def}->{sendmail_path};
 
+	$output_ref->{operation} = 
+	    $farm->{config}->{af_inst_def}->{operation};
+	$output_ref->{operation} =~ s/ /\n/g;
     }
 }
 1;


Affelio-cvs メーリングリストの案内
Back to archive index