[Affelio-cvs 800] CVS update: affelio/lib

Back to archive index

Tadashi Okoshi slash****@users*****
2005年 11月 23日 (水) 13:00:19 JST


Index: affelio/lib/AffelioApp.pm
diff -u affelio/lib/AffelioApp.pm:1.14 affelio/lib/AffelioApp.pm:1.15
--- affelio/lib/AffelioApp.pm:1.14	Thu Oct 27 20:15:01 2005
+++ affelio/lib/AffelioApp.pm	Wed Nov 23 13:00:19 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: AffelioApp.pm,v 1.14 2005/10/27 11:15:01 slash5234 Exp $
+# $Id: AffelioApp.pm,v 1.15 2005/11/23 04:00:19 slash5234 Exp $
 
 package AffelioApp;
 {
@@ -39,70 +39,26 @@
 
 	debug_print("AffelioApp::new: start.");
 
-	############################
-	#app__fs_root, cfg_path
-	############################
+	my $cgi = $param{cgi};
 	my $app__fs_root = $param{ConfigDir};
 	my $cfg_path = "$app__fs_root/AF_app.cfg";
-	debug_print("AffelioApp::new: ConfigDir =$app__fs_root");
-	debug_print("AffelioApp::new: cfg_path  =$cfg_path");
-
-	############################
-	#CGI
-	############################
-	my $cgi = $param{cgi};
 
-	############################
-	#Install name
-	############################
 	my $install_name = $app__fs_root;
 	$install_name =~ s|/(.*)/||g;
-	debug_print("AffelioApp::new: install_name=$install_name");
 
-	############################
-	#Load Affelio
-	############################
 	my $af = new Affelio(ConfigDir => "$app__fs_root/../../config/",
 			     Caller    => $install_name);
 
-	############################
-	#app__web_root
-	############################
 	my $app__web_root = "$af->{site__web_root}/apps/$install_name";
+
+	debug_print("AffelioApp::new: ConfigDir =$app__fs_root");
+	debug_print("AffelioApp::new: cfg_path  =$cfg_path");
+	debug_print("AffelioApp::new: install_name=$install_name");
 	debug_print("AffelioApp::new: web_root=$app__web_root");
 	debug_print("AffelioApp::new: fs_root =$app__fs_root");
 
 	############################
-	#create userdata directory as needed
-	############################
-	if(-e "$af->{site__user_dir}/appdata/$install_name"){
-	}else{
-	    if (-d "$af->{site__user_dir}/appdata/"){
-		if (-w "$af->{site__user_dir}/appdata/"){
-		    my $ret =
-			mkdir("$af->{site__user_dir}/appdata/$install_name", 0777);
-		    if(!$ret){
-			error("Cannot make userdata/appdata/$install_name!");
-		    }
-		}else{
-		    error("Cannot make userdata/appdata/ is NOT writable!");
-		}
-	    }else{
-		my $ret =
-		    mkdir("$af->{site__user_dir}/appdata/", 0777);
-		if(!$ret){
-		    error("Cannot make userdata/appdata/!");
-		}
-		$ret =
-		    mkdir("$af->{site__user_dir}/appdata/$install_name", 0777);
-		if(!$ret){
-		    error("Cannot make userdata/appdata/$install_name!");
-		}
-	    }
-	}
-
-	############################
-	#Cookie check!
+	#Authentication with Cookie
 	############################
 	my $sid = $cgi->cookie("affelio-$af->{user__nickname}");
 	my $session = new CGI::Session(undef, 
@@ -123,8 +79,19 @@
 	debug_print("AffelioApp::new: visitor_nickname=  $visitor_nickname");
 	debug_print("AffelioApp::new: visitor_afid=      $visitor_afid");
 
-	my $install_title = $af->getAM->{apps}->{$install_name}->{install_title};
+	############################
+	#Authentication with X-WSSE header
+	############################
 
+	#(1)Get X-WSSE header
+
+	#(2)invoke AuthManager::WSSE_auth()
+
+
+	############################
+	#Blessing
+	############################
+	my $install_title = $af->getAM->{apps}->{$install_name}->{install_title};
 	my $dbh = $af->openAppDB($install_name);
 
 	#bless
@@ -147,9 +114,7 @@
 	############################
 	#Am I in the owner mode?
 	############################
-	debug_print("AffelioApp::new: cfg_path  =$cfg_path");
 	my $Config = Config::Tiny->new();
-
 	try{
 	    $Config = Config::Tiny->read($cfg_path);
 	}catch Error with{
@@ -157,13 +122,10 @@
 	}
 	my $rootproperty = $Config->{_}->{rootproperty};
 	my $owner_index = $Config->{application}->{owner_index};
-	debug_print("AffelioApp::new: owner_index  =$owner_index");
-
 	if($cgi->self_url =~/$owner_index/){ 
 	    $self->set_owner_mode();
 	}
 
-	############################
 	debug_print("AffelioApp::new: end.");
 	return $self;
     }
@@ -318,7 +280,6 @@
 	    . '<div class="afPubMain">' . "\n";
 
 	return($final_out);
-
     }
 
     ######################################################################
@@ -368,6 +329,27 @@
     }
 
     ######################################################################
+    #get_WSSE_header
+    #  arg(1): destination friend's AF_ID
+    ######################################################################
+    sub get_WSSE_header{
+	my $self = shift;
+	my $af = $self->{af};
+	my $to_AFID = shift;
+
+	my $ret="";
+
+	#(1)get DH password shared with the friend($to_AFID)
+
+
+	#(2)generate WSSE header
+
+
+	return($ret);
+    }
+
+
+    ######################################################################
     #Destructor
     ######################################################################
     sub DESTROY{


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