Tadashi Okoshi
slash****@users*****
2005年 11月 23日 (水) 13:00:20 JST
Index: affelio/lib/Affelio/SNS/AuthManager.pm
diff -u /dev/null affelio/lib/Affelio/SNS/AuthManager.pm:1.1
--- /dev/null Wed Nov 23 13:00:20 2005
+++ affelio/lib/Affelio/SNS/AuthManager.pm Wed Nov 23 13:00:20 2005
@@ -0,0 +1,69 @@
+# Copyright (C) 2005 FishGrove Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# $Id: AuthManager.pm,v 1.1 2005/11/23 04:00:20 slash5234 Exp $
+
+package Affelio::SNS::AuthManager;
+{
+ use strict;
+
+ use lib("../../../extlib");
+ use DBI;
+ use lib("../../");
+ use Affelio;
+ use Affelio::misc::CGIError;
+ use Affelio::misc::Debug qw(debug_print);
+ use Affelio::misc::Time;
+ use Affelio::misc::DBroutines qw(db_value_replace);
+ use Affelio::exception::DBException;
+
+ ########################################################################
+ #Constructor
+ ########################################################################
+ sub new{
+ my $class = shift;
+ my $af = shift;
+
+ debug_print("AuthManager::new: start.");
+
+ my $self = {af => $af
+ };
+
+ bless $self, $class;
+
+ debug_print("AuthManager::new: end.");
+ return $self;
+ }
+
+ ########################################################################
+ #WSSE_auth
+ ########################################################################
+ sub WSSE_auth{
+ my $self = shift;
+ my $af = $self->{af};
+ my $wsse_username = shift;
+ my $wsse_pwdigest = shift;
+ my $wsse_nonce = shift;
+ my $wsse_created = shift;
+
+ }
+
+
+
+
+
+}#package
+1;
Index: affelio/lib/Affelio/SNS/Handshaker_s.pm
diff -u affelio/lib/Affelio/SNS/Handshaker_s.pm:1.24 affelio/lib/Affelio/SNS/Handshaker_s.pm:1.25
--- affelio/lib/Affelio/SNS/Handshaker_s.pm:1.24 Wed Nov 23 12:14:22 2005
+++ affelio/lib/Affelio/SNS/Handshaker_s.pm Wed Nov 23 13:00:20 2005
@@ -14,7 +14,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-# $Id: Handshaker_s.pm,v 1.24 2005/11/23 03:14:22 slash5234 Exp $
+# $Id: Handshaker_s.pm,v 1.25 2005/11/23 04:00:20 slash5234 Exp $
########################################################################
#package Affelio::SNS::Handshaker_s::Util;
@@ -56,6 +56,7 @@
use Affelio::SNS::FriendManager;
use Affelio::SNS::Handshaker_tmpDB;
use Affelio::SNS::Handshaker_c qw(get_F2List);
+ use Affelio::App::Admin::MakeAffelioLink;
use Affelio::Managing::MessageManager;
use Affelio::misc::CGIError;
use Affelio::misc::Debug;
@@ -66,17 +67,57 @@
use Exporter;
@Affelio::SNS::Handshaker_s::ISA = "Exporter";
- @Affelio::SNS::Handshaker_s::EXPORT = qw (HandShake HandShakeReply F2List post_Message get_services);
+ @Affelio::SNS::Handshaker_s::EXPORT = qw (HandShake HandShakeReply F2List post_Message get_services request_AFlink);
use vars qw( $AF_DIR);
}
##################################################################
+ #server.request_AFlink
+ # proto_ver: 1
+ ##################################################################
+ sub request_AFlink{
+ my $self = shift;
+ my ($proto_ver, $xwsse_mesg, $to_url) = @_;
+ my $af = Affelio::SNS::Handshaker_s::Util::af_new();
+ my $ret ="";
+
+ if($proto_ver > 1.0){
+ return {
+ flerror => XMLRPC::Data->type('boolean', 1),
+ message => "ERR:102 UnsupportedProtoVer 1.0"
+ };
+ }
+
+ ############################
+ if( !(Affelio::misc::WSSE::authenticate($xwsse_mesg,
+ "username",
+ "password")) ){
+ $ret="NG";
+ }else{
+ $ret="OK";
+
+ Affelio::App::Admin::MakeAffelioLink::_send_request($af,
+ $to_uri,
+ "");
+ }
+ ############################
+ return {
+ flerror => XMLRPC::Data->type('boolean', 0),
+ message => $ret
+ };
+ }
+
+
+ ##################################################################
#server.get_services
# proto_ver: 1
##################################################################
sub get_services{
my $self = shift;
- my ($proto_ver) = @_;
+ my ($proto_ver,
+ $wsse_username, $wsse_pwdigest, $wsse_nonce, $wsse_created,
+ $format_req ) = @_;
+ my $af = Affelio::SNS::Handshaker_s::Util::af_new();
if($proto_ver > 1.0){
return {
@@ -89,7 +130,7 @@
<?xml version="1.0"?>
<services type="core">
<service name="AffelioHandshaker">
-<version>1.1</version>
+<version>1.2</version>
</service>
<service name="AffelioMessaging">
<version>1.0</version>
@@ -99,7 +140,21 @@
</service>
</services>
EOT
- return {
+
+ $msg .= '<services type="applications">' . "\n";
+
+ while ( my ($tmp_name, $app) = each( %{$self->getAM->{apps}} ) ){
+ $msg .= "<service about=\"" . $app->{app_URI} . "\">\n";
+ $msg .= "<version>" . $app->{app_version} . "</version>\n";
+ $msg .= "<name>" . $app->{app_name} . "</name>\n";
+ $msg .= "<baseurl>" . $af->{site__web_root}
+ . "/apps/" . $apps->{install_name} . "</baseurl>\n";
+ $msg .= "</service>\n";
+ }
+
+ my $msg .= "</services>\n";
+
+ return {
flerror => XMLRPC::Data->type('boolean', 0),
message => $msg
};