[Affelio-cvs 866] CVS update: affelio/bin

Back to archive index

Tadashi Okoshi slash****@users*****
2005年 12月 16日 (金) 19:24:54 JST


Index: affelio/bin/loginexec.cgi
diff -u affelio/bin/loginexec.cgi:1.10 affelio/bin/loginexec.cgi:1.11
--- affelio/bin/loginexec.cgi:1.10	Fri Dec 16 18:47:19 2005
+++ affelio/bin/loginexec.cgi	Fri Dec 16 19:24:54 2005
@@ -16,7 +16,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: loginexec.cgi,v 1.10 2005/12/16 09:47:19 slash5234 Exp $
+# $Id: loginexec.cgi,v 1.11 2005/12/16 10:24:54 slash5234 Exp $
 
 use strict;
 
@@ -112,46 +112,47 @@
 	####################################################################
 	#Phase S0 (V2 protocol)
 	
-	##################################
-	#Format adjustment of AffelioURL
-	##################################
-	$affelio_url =~ s|/$||;    #remove / at the end of line
-	if($affelio_url !~ /^(http:\/\/)/){
-	    $affelio_url = "http://" . $affelio_url;
-	}
-	
-	##################################
-	#Determine forward_URL
-	##################################
-	#Forward_URL is a URL to which the user will be forwarded after auth.
-	if($forward_URL eq ""){
-	    $forward_URL= $ENV{HTTP_REFERER};
+	if($affelio_url eq $af->{site__username}){
+	    ##################################
+	    #input URL = site owner's nickname
+	    ##################################
+
+	    show_checkpassword_screen(mode => "login_as_owner");
+	    exit(1);
+	}else{
+	    ##################################
+	    #Format adjustment of AffelioURL
+	    ##################################
+	    $affelio_url =~ s|/$||;    #remove / at the end of line
+	    if($affelio_url !~ /^(http:\/\/)/){
+		$affelio_url = "http://" . $affelio_url;
+	    }
+	    
+	    ##################################
+	    #Determine forward_URL
+	    ##################################
+	    #Forward_URL is a URL to which the user will be forwarded after auth.
+	    if($forward_URL eq ""){
+		$forward_URL= $ENV{HTTP_REFERER};
+	    }
+	    
+	    ##################################
+	    #Go to "s1" phase...
+	    ##################################
+	    my $next_URL
+		= "$affelio_url/bin/loginexec.cgi?mode=s1&forward_URL=$forward_URL";
+	    debug_print("\t\tnext_URL= $next_URL");
+	    debug_print("loginexec.cgi($mode): end.");
+	    print $q->redirect( -url => $next_URL);
+	    exit(1);
 	}
-	
-	##################################
-	#Go to "s1" phase...
-	##################################
-	my $next_URL
-	    = "$affelio_url/bin/loginexec.cgi?mode=s1&forward_URL=$forward_URL";
-	debug_print("\t\tnext_URL= $next_URL");
-	debug_print("loginexec.cgi($mode): end.");
-	print $q->redirect( -url => $next_URL);
-	exit(1);
-	
+
     }elsif($mode eq "s1"){
 	####################################################################
 	#Phase S1 (V2 protocol)
 	#(password input phase)
-	
-	my $TMPL_FILE = "$af->{site__fs_root}/templates/$af->{site__template}/owner_side/login_s1.tmpl";
-	my $tmpl = new HTML::Template( filename => $TMPL_FILE,
-				       die_on_bad_params => 0);
-	$tmpl->param("owner_nickname" => $af->{user__nickname});
-	$tmpl->param("tmpl_path" => "$af->{site__web_root}/templates/$af->{site__template}");
-	$tmpl->param("cgi_path" => "$af->{site__web_root}/bin/loginexec.cgi?mode=s2&forward_URL=$forward_URL");
-	print "Content-type: text/html; charset=UTF-8\n\n";
-	print $af->translate_templateL10N($tmpl->output);
-	
+
+	show_checkpassword(mode => "back_from_friend");
 	debug_print("loginexec.cgi($mode): end.");
 	exit(1);
 	
@@ -209,3 +210,23 @@
 }
 
 exit(1);
+
+
+
+
+
+
+sub show_checkpassword_screen{
+    my %args = @_;
+
+    my $TMPL_FILE = "$af->{site__fs_root}/templates/$af->{site__template}/owner_side/login_s1.tmpl";
+    my $tmpl = new HTML::Template( filename => $TMPL_FILE,
+				   die_on_bad_params => 0);
+    $tmpl->param("owner_nickname" => $af->{user__nickname});
+    $tmpl->param("tmpl_path" => "$af->{site__web_root}/templates/$af->{site__template}");
+    $tmpl->param("cgi_path" => "$af->{site__web_root}/bin/loginexec.cgi?mode=s2&forward_URL=$forward_URL");
+    $tmpl->param($args{mode} => "true");
+
+    print "Content-type: text/html; charset=UTF-8\n\n";
+    print $af->translate_templateL10N($tmpl->output);
+}


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