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

Back to archive index

Tadashi Okoshi slash****@users*****
2005年 6月 30日 (木) 19:42:28 JST


Index: affelio/lib/Affelio.pm
diff -u affelio/lib/Affelio.pm:1.14 affelio/lib/Affelio.pm:1.15
--- affelio/lib/Affelio.pm:1.14	Thu Jun 30 15:48:30 2005
+++ affelio/lib/Affelio.pm	Thu Jun 30 19:42:28 2005
@@ -4,7 +4,7 @@
 #    http://affelio.jp/ (Japan)
 #    http://affelio.jp/ (USA and other area)
 #
-# $Id: Affelio.pm,v 1.14 2005/06/30 06:48:30 slash5234 Exp $
+# $Id: Affelio.pm,v 1.15 2005/06/30 10:42:28 slash5234 Exp $
 
 package Affelio;
 {
@@ -638,11 +638,18 @@
 	}else{
 	    $selected ="true";
 	}
+
+	my $dest_url;
+	if($self->{guest_owner_switch} eq "owner"){
+	    $dest_url = $self->{site__web_root} . "/admin.cgi";
+	}else{
+	    $dest_url = $self->{site__web_root} . "/index.cgi?mode=index";
+	}
 	push(@modules,
 	     {'name' => "Affelio",
 	      'image_normal' => "$self->{site__web_root}/icons/affelio_normal.jpg",
 	      'image_over' => "$self->{site__web_root}/icons/affelio_over.jpg",
-	      'url' => $self->{site__web_root} . "/index.cgi?mode=index"  ,
+	      'url' => $dest_url,
 	      'selected' => $selected}
 	     );
 
@@ -672,11 +679,18 @@
 		}else{
 		    $selected = "";
 		}
+
+		my $dest_url;
+		if($self->{guest_owner_switch} eq "owner"){
+		    $dest_url = "$self->{site__web_root}/apps/$this_app{'install_name'}/$this_app{'owner_index'}";
+		}else{
+		    $dest_url = "$self->{site__web_root}/apps/$this_app{'install_name'}/$this_app{'guest_index'}";
+		}
 		
 		push(@modules,
 		     {'selected' => $selected,
 		      'name' => $this_app{'install_title'},
-		      'url' => "$self->{site__web_root}/apps/$this_app{'install_name'}/$this_app{'guest_index'}",
+		      'url' => $dest_url,
 		      'image_normal' => "$self->{site__web_root}/apps/$this_app{'install_name'}/icons/normal.jpg",
 		      'image_over' => "$self->{site__web_root}/apps/$this_app{'install_name'}/icons/over.jpg"
 		      }
Index: affelio/lib/AffelioApp.pm
diff -u affelio/lib/AffelioApp.pm:1.8 affelio/lib/AffelioApp.pm:1.9
--- affelio/lib/AffelioApp.pm:1.8	Thu Jun 30 12:47:56 2005
+++ affelio/lib/AffelioApp.pm	Thu Jun 30 19:42:28 2005
@@ -4,7 +4,7 @@
 #    http://affelio.jp/ (Japan)
 #    http://affelio.jp/ (USA and other area)
 #
-# $Id: AffelioApp.pm,v 1.8 2005/06/30 03:47:56 higefuku Exp $
+# $Id: AffelioApp.pm,v 1.9 2005/06/30 10:42:28 slash5234 Exp $
 
 package AffelioApp;
 {
@@ -33,8 +33,9 @@
 	#app__fs_root, cfg_path
 	############################
 	my $app__fs_root = $param{ConfigDir};
-	my $cfg_path = "$app__fs_root/AFAppConfig.cgi";
-	debug_print("AffelioApp::new: ConfigDir=$app__fs_root");
+	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
@@ -133,6 +134,26 @@
 		    };
 	bless $self, $class;
 
+	############################
+	#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{
+	    throw Affelio::exception::SystemException("AFApp.cfg not found");
+	}
+	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;
     }


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