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

Back to archive index

Tadashi Okoshi slash****@users*****
2006年 6月 4日 (日) 17:20:59 JST


Index: affelio/lib/AffelioApp.pm
diff -u affelio/lib/AffelioApp.pm:1.26 affelio/lib/AffelioApp.pm:1.27
--- affelio/lib/AffelioApp.pm:1.26	Sun Jun  4 16:15:12 2006
+++ affelio/lib/AffelioApp.pm	Sun Jun  4 17:20:59 2006
@@ -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.26 2006/06/04 07:15:12 slash5234 Exp $
+# $Id: AffelioApp.pm,v 1.27 2006/06/04 08:20:59 slash5234 Exp $
 
 package AffelioApp;
 {
@@ -47,11 +47,20 @@
 
 	if($ENV{REDIRECT_URL}){
 	    #AFE2
-	    $install_name = $ENV{REDIRECT_URL};
-	    debug_print("AffelioApp::new: [$install_name]");
-	    $install_name =~ s|/([a-zA-Z0-9\-\_\.]+)$|/|;
-	    $install_name =~ /\/([a-zA-Z0-9\-\_]+)\/$/;
-	    $install_name = $1;
+	    my $tmp_a="users";
+	    if($ENV{REDIRECT_AF_EXEC_TYPE} eq "Personal"){
+		$tmp_a = "user";
+	    }
+	    if($ENV{REDIRECT_AF_EXEC_TYPE} eq "Collab"){
+		$tmp_a = "collab";
+	    }
+	    my $my_af_url = $ENV{FARM_WEB_TOP} . "/$tmp_a/" . $ENV{REDIRECT_AF_USERNAME} . "/apps/";
+	    $my_af_url =~ s|([^:])//|$1/|g;   #Translate "//" to "/"
+
+	    $install_name = $ENV{SCRIPT_URI};    
+	    $install_name =~ s|([^:])//|$1/|g;    #Translate "//" to "/"
+	    $install_name =~ s|\Q$my_af_url\E||g; #Distill later than "apps/"
+	    $install_name =~ s|(.*)/(.*)|$1|;     #Distill only app dir name.
 	}else{
 	    $install_name = $app__fs_root;
 	    $install_name =~ s|/(.*)/||g;
@@ -70,12 +79,6 @@
 
 	my $app__web_root = "$af->{site__user_afid}/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: user_afid=$app__user_afid");
-	debug_print("AffelioApp::new: web_root=$app__web_root");
-	debug_print("AffelioApp::new: fs_root =$app__fs_root");
 
 	############################
 	#Authentication with Cookie
@@ -93,19 +96,12 @@
 	if($visitor_type eq ""){
 	    $visitor_type="pb";
 	}
-	debug_print("AffelioApp::new: visitor_type=      $visitor_type");
-	debug_print("AffelioApp::new: visitor_nickname=  $visitor_nickname");
-	debug_print("AffelioApp::new: visitor_afid=      $visitor_afid");
-
 	############################
 	#Authentication with X-WSSE header
 	############################
-
 	#(1)Get X-WSSE header
-
 	#(2)invoke AuthManager::WSSE_auth()
 
-
 	############################
 	#Blessing
 	############################
@@ -137,6 +133,9 @@
 	debug_print("AffelioApp::new: visitor_nick= [$visitor_nickname]");
 	debug_print("AffelioApp::new: visitor_afid= [$visitor_afid]");
 	debug_print("AffelioApp::new: userdata_dir= [$self->{userdata_dir}]");
+	debug_print("AffelioApp::new: visitor_type=     [$visitor_type]");
+	debug_print("AffelioApp::new: visitor_nickname= [$visitor_nickname]");
+	debug_print("AffelioApp::new: visitor_afid=     [$visitor_afid]");
 
 	############################
 	#Am I in the owner mode?


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