[Affelio-cvs 1077] CVS update: affelio/lib/Affelio/App/Admin

Back to archive index

Tadashi Okoshi slash****@users*****
2006年 2月 23日 (木) 21:41:37 JST


Index: affelio/lib/Affelio/App/Admin/ConfigApps.pm
diff -u affelio/lib/Affelio/App/Admin/ConfigApps.pm:1.4 affelio/lib/Affelio/App/Admin/ConfigApps.pm:1.5
--- affelio/lib/Affelio/App/Admin/ConfigApps.pm:1.4	Mon Dec 26 19:15:39 2005
+++ affelio/lib/Affelio/App/Admin/ConfigApps.pm	Thu Feb 23 21:41:37 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: ConfigApps.pm,v 1.4 2005/12/26 10:15:39 slash5234 Exp $
+# $Id: ConfigApps.pm,v 1.5 2006/02/23 12:41:37 slash5234 Exp $
 
 package Affelio::App::Admin::ConfigApps;
 {
@@ -27,6 +27,7 @@
     use Affelio::misc::CGIError;
     use Affelio::misc::Debug qw(debug_print);
     use Affelio::misc::WebInput;
+    use Affelio::exception::InvalidInputException;
 
     use Exporter;
     @Affelio::App::Admin::ConfigApps::ISA = "Exporter";
@@ -57,7 +58,7 @@
 	    }
 	}catch Error with{
 	    my $e = shift;
-	    $out_ref->{err_msg} .= $e->stacktrace . '<BR>';
+	    $out_ref->{err_msg} .= $e . '<BR>';
 	};
 	
 	$out_ref->{tmpl_file}
@@ -77,12 +78,19 @@
 
 	debug_print("ConfigApps::install_app: start.");
 	my $wi = new Affelio::misc::WebInput;
+	my $app_dir = $wi->PTN_word($cgi->param("app_dir"));
 	my $install_dir = $wi->PTN_word($cgi->param("install_dir"));
 	my $install_title = $cgi->param("install_title");
-	debug_print("ConfigApps::install_app: DIR=[$install_dir]");
-	debug_print("ConfigApps::install_app: TITLE=[$install_title]");
 
-	$af->getAM->install_app($install_dir, $install_title);
+	debug_print("ConfigApps::install_app: APP_DIR=[$app_dir]");
+	debug_print("ConfigApps::install_app: INST_DIR=[$install_dir]");
+	debug_print("ConfigApps::install_app: INST_TITLE=[$install_title]");
+
+	if(($install_dir eq "")  || ($install_title eq "")){
+	    throw Affelio::exception::InvalidInputException("Invalid input value.");
+	}
+
+	$af->getAM->install_app($app_dir, $install_dir, $install_title);
 
 	$out_ref->{ret_msg} = "$install_dir is installed.";
     }
@@ -125,13 +133,14 @@
 
 	my $wi = new Affelio::misc::WebInput;
 	my $app_id = $wi->PTN_num($cgi->param("app_id"));
+	my $install_name = $wi->PTN_word($cgi->param("install_name"));
 
 	debug_print("ConfigApps::delete: app_id =[$app_id]");
 
 	if(($app_id eq "" ) || ($app_id < 0)){
 	    return;
 	}else{
-	    $af->getAM()->uninstall_app($app_id);
+	    $af->getAM()->uninstall_app($app_id, $install_name);
 	    $out_ref->{ret_msg} = "Application uninstalled.";
 	}
     }
@@ -192,7 +201,15 @@
 		##################################
 		debug_print("ConfigApps::show: [$app_dir]");	
 
-		if( !defined($af->getAM->{apps}->{$app_dir}) ){
+		if( (!defined($af->getAM->{apps}->{$app_dir}))
+		    || ($af->{site__farm_mode} eq "AFE2")
+		    ){
+
+		    #Read AF_app.cfg file of install-ready applications.
+		    #In case of AFE2:  
+		    #    All apps. in affelio/apps/ dir. is always ready for install.
+		    #In case of Stand-alone and AFE:
+		    #    Only apps which is not registered as "installed" are ready.
 
 		    ##################################
 		    #Open AF_app.cfg file
@@ -216,14 +233,27 @@
 		    my $operate_URL
 			="admin.cgi?mode=config_apps&action=install_app";
 
+		    my $disabled_flag;
+		    my $install_dir;
+		    if($af->{site__farm_mode} eq "AFE2"){
+			$install_dir = "";
+			$disabled_flag="";
+		    }else{
+			$install_dir = $app_dir;
+			$disabled_flag=" readonly";
+		    }
+
+
 		    ##################################
 		    #Push into output_ref
 		    ##################################
 		    push(@unregistered_apps, 
-			 {app_dir => "$app_dir",
+			 {app_dir => $app_dir,
+			  install_dir => $install_dir,
 			  app_name => $app_name,
 			  app_version => $app_version,
-			  opURL => $operate_URL
+			  opURL => $operate_URL,
+			  disabled_flag => $disabled_flag
 			  } );
 		} #if
 
Index: affelio/lib/Affelio/App/Admin/EditSkins.pm
diff -u affelio/lib/Affelio/App/Admin/EditSkins.pm:1.7 affelio/lib/Affelio/App/Admin/EditSkins.pm:1.8
--- affelio/lib/Affelio/App/Admin/EditSkins.pm:1.7	Wed Nov 23 13:00:19 2005
+++ affelio/lib/Affelio/App/Admin/EditSkins.pm	Thu Feb 23 21:41:37 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: EditSkins.pm,v 1.7 2005/11/23 04:00:19 slash5234 Exp $
+# $Id: EditSkins.pm,v 1.8 2006/02/23 12:41:37 slash5234 Exp $
 
 package Affelio::App::Admin::EditSkins;
 {
@@ -111,13 +111,17 @@
 	#Enabling/disabling upload
 	###############################
 	my $farm_con;
-	$farm_con = $af->get_farm_connecter();
-	if($farm_con){
-	    if($farm_con->get_val("can_upload_skin") ne "yes"){
-		return();
+	if($af->{site__farm_mode} eq "AFE"){
+	    $farm_con = $af->get_farm_connecter();
+	    if($farm_con){
+		if($farm_con->get_val("can_upload_skin") ne "yes"){
+		    return();
+		}
 	    }
 	}
-
+	if($af->{site__farm_mode} eq "AFE2"){
+	    return();
+	}
 
 	my $filename = $cgi->param('uploadingfile');
 	my $filetype = $cgi->uploadInfo($filename)->{'Content-Type'};
@@ -258,14 +262,19 @@
 	#Enabling/disabling upload
 	###############################
 	my $farm_con;
-	$farm_con = $af->get_farm_connecter();
-	if($farm_con){
-	    if($farm_con->get_val("can_upload_skin") eq "yes"){
-		$output_ref->{'upload_disabler'} = "";
-	    }else{
-		$output_ref->{'upload_disabler'} = "disabled";
+	if($af->{site__farm_mode} eq "AFE"){
+	    $farm_con = $af->get_farm_connecter();
+	    if($farm_con){
+		if($farm_con->get_val("can_upload_skin") eq "yes"){
+		    $output_ref->{'upload_disabler'} = "";
+		}else{
+		    $output_ref->{'upload_disabler'} = "disabled";
+		}
 	    }
 	}
+	if($af->{site__farm_mode} eq "AFE2"){
+	    $output_ref->{'upload_disabler'} = "disabled";
+	}
 
 	###############################
 	#Selected skin's CSS file
@@ -279,6 +288,10 @@
 	}else{
 	    $output_ref->{'current_css_mode'} = "readonly";
 	}
+	if($af->{site__farm_mode} eq "AFE2"){
+	    $output_ref->{'current_css_mode'} = "readonly";
+	}
+
 
 	while(<IN>){$css_body .=$_;}
 	close(IN);
Index: affelio/lib/Affelio/App/Admin/EditTemplates.pm
diff -u affelio/lib/Affelio/App/Admin/EditTemplates.pm:1.10 affelio/lib/Affelio/App/Admin/EditTemplates.pm:1.11
--- affelio/lib/Affelio/App/Admin/EditTemplates.pm:1.10	Wed Nov 23 13:00:19 2005
+++ affelio/lib/Affelio/App/Admin/EditTemplates.pm	Thu Feb 23 21:41:37 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: EditTemplates.pm,v 1.10 2005/11/23 04:00:19 slash5234 Exp $
+# $Id: EditTemplates.pm,v 1.11 2006/02/23 12:41:37 slash5234 Exp $
 
 package Affelio::App::Admin::EditTemplates;
 {
@@ -216,11 +216,11 @@
 		###################################################
 		#Save to file in templates_dyn/ dir
 		###################################################
-		sysopen(OUT, "$af->{site__fs_root}/templates_dyn/$template_name.tmpl", O_WRONLY|O_CREAT|O_TRUNC, 0755);
+		sysopen(OUT, "$af->{site__tmpldyn_dir}/$template_name.tmpl", O_WRONLY|O_CREAT|O_TRUNC, 0755);
 		print OUT $output_contents;
 		close(OUT);
 
-		sysopen(OUT, "$af->{site__fs_root}/templates_dyn/$template_name.inj", O_WRONLY|O_CREAT|O_TRUNC, 0755);
+		sysopen(OUT, "$af->{site__tmpldyn_dir}/$template_name.inj", O_WRONLY|O_CREAT|O_TRUNC, 0755);
 		print OUT $included_aftags;
 		close(OUT);
 		
@@ -230,9 +230,9 @@
 	$ENV{PATH} = "/bin:/usr/bin";
 
 	debug_print("rebuild: header+left => Header"); 
-	system("cat $af->{site__fs_root}/templates_dyn/_header.tmpl  $af->{site__fs_root}/templates_dyn/_left.tmpl > $af->{site__fs_root}/templates_dyn/Header.tmpl");
+	system("cat $af->{site__tmpldyn_dir}/_header.tmpl  $af->{site__tmpldyn_dir}/_left.tmpl > $af->{site__tmpldyn_dir}/Header.tmpl");
 	debug_print("rebuild: right+footer => Footer"); 
-	system("cat $af->{site__fs_root}/templates_dyn/_right.tmpl  $af->{site__fs_root}/templates_dyn/_footer.tmpl > $af->{site__fs_root}/templates_dyn/Footer.tmpl");
+	system("cat $af->{site__tmpldyn_dir}/_right.tmpl  $af->{site__tmpldyn_dir}/_footer.tmpl > $af->{site__tmpldyn_dir}/Footer.tmpl");
 
 	debug_print("rebuild: end.");
     }
Index: affelio/lib/Affelio/App/Admin/MakeAffelioLink.pm
diff -u affelio/lib/Affelio/App/Admin/MakeAffelioLink.pm:1.5 affelio/lib/Affelio/App/Admin/MakeAffelioLink.pm:1.6
--- affelio/lib/Affelio/App/Admin/MakeAffelioLink.pm:1.5	Sun Jan 29 03:24:33 2006
+++ affelio/lib/Affelio/App/Admin/MakeAffelioLink.pm	Thu Feb 23 21:41:37 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: MakeAffelioLink.pm,v 1.5 2006/01/28 18:24:33 slash5234 Exp $
+# $Id: MakeAffelioLink.pm,v 1.6 2006/02/23 12:41:37 slash5234 Exp $
 
 package Affelio::App::Admin::MakeAffelioLink;
 {
@@ -93,7 +93,7 @@
 	    $my_DH_pri_key_str
 		= send_HandShake(dest_uri =>  $dest_uri, 
 				 my_nickname =>  $af->{user__nickname},
-				 my_AFID  =>  $af->{site__web_root},
+				 my_AFID  =>  $af->{site__user_afid},
 				 mesg => $my_mesg,
 				 timestamp => $cur_time);
 	}catch Affelio::exception::NetworkException with{
@@ -165,7 +165,7 @@
 	    $my_DH_pri_key_str
 		= send_HandShake(dest_uri =>  $dest_uri, 
 				 my_nickname =>  $af->{user__nickname},
-				 my_AFID  =>  $af->{site__web_root},
+				 my_AFID  =>  $af->{site__user_afid},
 				 mesg => "",
 				 timestamp => $cur_time);
 	}catch Affelio::exception::NetworkException with{
Index: affelio/lib/Affelio/App/Admin/ManageApplication.pm
diff -u affelio/lib/Affelio/App/Admin/ManageApplication.pm:1.6 affelio/lib/Affelio/App/Admin/ManageApplication.pm:1.7
--- affelio/lib/Affelio/App/Admin/ManageApplication.pm:1.6	Wed Nov 23 13:00:19 2005
+++ affelio/lib/Affelio/App/Admin/ManageApplication.pm	Thu Feb 23 21:41:37 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: ManageApplication.pm,v 1.6 2005/11/23 04:00:19 slash5234 Exp $
+# $Id: ManageApplication.pm,v 1.7 2006/02/23 12:41:37 slash5234 Exp $
 
 package Affelio::App::Admin::ManageApplication;
 {
@@ -316,8 +316,8 @@
 	    push(@applications, {install_title => $app->{install_title},
 				 install_name => $app->{install_name},
 				 #
-				 editlink_URL  => "$af->{site__web_root}/admin.cgi?mode=access_control_apps&mode2=show_app&app_name=$app->{install_name}",
-				 app_URL  => "$af->{site__web_root}/apps/$app->{install_name}/$app->{guest_index}",
+				 editlink_URL  => "$af->{site__user_afid}/admin.cgi?mode=access_control_apps&mode2=show_app&app_name=$app->{install_name}",
+				 app_URL  => "$af->{site__user_afid}/apps/$app->{install_name}/$app->{guest_index}",
 				 #
 				 app_name  => $app->{app_name},
 				 app_version  => $app->{app_version}
Index: affelio/lib/Affelio/App/Admin/ManageFriend.pm
diff -u affelio/lib/Affelio/App/Admin/ManageFriend.pm:1.7 affelio/lib/Affelio/App/Admin/ManageFriend.pm:1.8
--- affelio/lib/Affelio/App/Admin/ManageFriend.pm:1.7	Wed Nov 23 13:00:19 2005
+++ affelio/lib/Affelio/App/Admin/ManageFriend.pm	Thu Feb 23 21:41:37 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: ManageFriend.pm,v 1.7 2005/11/23 04:00:19 slash5234 Exp $
+# $Id: ManageFriend.pm,v 1.8 2006/02/23 12:41:37 slash5234 Exp $
 
 package Affelio::App::Admin::ManageFriend;
 {
@@ -153,7 +153,7 @@
 	#Set nickname and image URL
 	$output_ref->{"nickname"} = $person[2];
 	my $image_URL = generate_getcontentURL($af,
-					       $af->{site__web_root},
+					       $af->{site__user_afid},
 					       "self",
 					       $person[1],
 					       $person[4],
@@ -317,7 +317,7 @@
 
 	while( my @row = $result->fetchrow_array ){
 
-	    my $userhome_URL = $af->{site__web_root} 
+	    my $userhome_URL = $af->{site__user_afid} 
                               . "/outgoing.cgi?dest_url=" . $row[1];
 
 	    my $editlink_URL = 'admin.cgi?mode=manage_friends&mode2=show_member&uid=' . $row[0];
Index: affelio/lib/Affelio/App/Admin/Messaging.pm
diff -u affelio/lib/Affelio/App/Admin/Messaging.pm:1.22 affelio/lib/Affelio/App/Admin/Messaging.pm:1.23
--- affelio/lib/Affelio/App/Admin/Messaging.pm:1.22	Thu Jan 19 18:26:57 2006
+++ affelio/lib/Affelio/App/Admin/Messaging.pm	Thu Feb 23 21:41:37 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: Messaging.pm,v 1.22 2006/01/19 09:26:57 slash5234 Exp $
+# $Id: Messaging.pm,v 1.23 2006/02/23 12:41:37 slash5234 Exp $
 
 package Affelio::App::Admin::Messaging;
 {
@@ -23,7 +23,7 @@
     use lib("../../../../extlib/");
     use Error qw(:try);
     use MIME::Base64;
-    use lib("../../../");
+    use lib("../../../../lib/");
     use Affelio;
     use Affelio::misc::CGIError;
     use Affelio::misc::Debug qw(debug_print);
@@ -131,9 +131,9 @@
 	my $ret="";
 	try{
 	    $ret = post_Message(dest_uri =>  $msg_to,
-				src => $af->{site__web_root},
+				src => $af->{site__user_afid},
 				password => $passAB,
-				msg_from => $af->{site__web_root},
+				msg_from => $af->{site__user_afid},
 				msg_from_nickname => $af->{user__nickname},
 				msg_to => $msg_to,
 				msg_timestamp => get_timestamp(),
@@ -342,7 +342,7 @@
 	    debug_print("show_message_list: \t[$1]");
 	    debug_print("show_message_list: \t[$2]");
 	    
-	    $msg_from = '<A HREF="' . $af->{site__web_root} . '/outgoing.cgi?dest_url=' . $1 . '" target="_blank">' . $2 . '</A>';
+	    $msg_from = '<A HREF="' . $af->{site__user_afid} . '/outgoing.cgi?dest_url=' . $1 . '" target="_blank">' . $2 . '</A>';
 	}
 	###########
 
@@ -352,7 +352,7 @@
 	$$output_ref{"msg_from"} = $msg_from;
 	$$output_ref{"msg_body"} = $msg_body;
 
-	$$output_ref{"url2list"} = "$af->{site__web_root}/admin.cgi?mode=messages";
+	$$output_ref{"url2list"} = "$af->{site__user_afid}/admin.cgi?mode=messages";
 
 	debug_print("show_message: end.");
     }
@@ -396,12 +396,12 @@
 		debug_print("show_message_list: \t[$1]");
 		debug_print("show_message_list: \t[$2]");
 
-		$msg_from = '<A HREF="' . $af->{site__web_root} . '/outgoing.cgi?dest_url=' . $1 . '" target="_blank">' . $2 . '</A>';
+		$msg_from = '<A HREF="' . $af->{site__user_afid} . '/outgoing.cgi?dest_url=' . $1 . '" target="_blank">' . $2 . '</A>';
 	    }
 	    ###########
 
 
-	    my $linkurl = "$af->{site__web_root}/admin.cgi?mode=messages&action=show&mid=$msg_mid";
+	    my $linkurl = "$af->{site__user_afid}/admin.cgi?mode=messages&action=show&mid=$msg_mid";
 	    push(@ret_messages, 
 		 {
 		     'msg_title' => $msg_title,
Index: affelio/lib/Affelio/App/Admin/NeighborNews.pm
diff -u affelio/lib/Affelio/App/Admin/NeighborNews.pm:1.1 affelio/lib/Affelio/App/Admin/NeighborNews.pm:1.2
--- affelio/lib/Affelio/App/Admin/NeighborNews.pm:1.1	Sat Dec 10 10:03:32 2005
+++ affelio/lib/Affelio/App/Admin/NeighborNews.pm	Thu Feb 23 21:41:37 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: NeighborNews.pm,v 1.1 2005/12/10 01:03:32 slash5234 Exp $
+# $Id: NeighborNews.pm,v 1.2 2006/02/23 12:41:37 slash5234 Exp $
 
 package Affelio::App::Admin::NeighborNews;
 {
@@ -57,7 +57,7 @@
 	    my $title = $row[4];
 	    my $url1 = $row[7];
 
-	    my $url2 = "$af->{site__web_root}/outgoing.cgi?"
+	    my $url2 = "$af->{site__user_afid}/outgoing.cgi?"
 		. "dest_url=$af_id&dest_url2=$url1";
 
 	    debug_print("$url2");
Index: affelio/lib/Affelio/App/Admin/SendInvitation.pm
diff -u affelio/lib/Affelio/App/Admin/SendInvitation.pm:1.3 affelio/lib/Affelio/App/Admin/SendInvitation.pm:1.4
--- affelio/lib/Affelio/App/Admin/SendInvitation.pm:1.3	Fri Jul  1 11:00:07 2005
+++ affelio/lib/Affelio/App/Admin/SendInvitation.pm	Thu Feb 23 21:41:37 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: SendInvitation.pm,v 1.3 2005/07/01 02:00:07 slash5234 Exp $
+# $Id: SendInvitation.pm,v 1.4 2006/02/23 12:41:37 slash5234 Exp $
 
 package Affelio::App::Admin::SendInvitation;
 {
@@ -49,7 +49,7 @@
 	$emailbody =~ s/\[TO_ADDR\]/$dest_address/g;
 	$emailbody =~ s/\[FROM_NICKNAME\]/$af->{user__nickname}/g;
 	$emailbody =~ s/\[FROM_ADDR\]/$af->{user__email1}/g;
-	$emailbody =~ s/\[FROM_URL\]/$af->{site__web_root}/g;
+	$emailbody =~ s/\[FROM_URL\]/$af->{site__user_afid}/g;
 
 	my $intro_url= "http://www.handshaker.jp/?from=" 
 	    . $af->{site__web_root} . "&preferred="


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