[Affelio-cvs 1336] CVS update: affelio/lib/Affelio/misc

Back to archive index

Tadashi Okoshi slash****@users*****
2006年 6月 4日 (日) 18:11:55 JST


Index: affelio/lib/Affelio/misc/NetMisc.pm
diff -u affelio/lib/Affelio/misc/NetMisc.pm:1.5 affelio/lib/Affelio/misc/NetMisc.pm:1.6
--- affelio/lib/Affelio/misc/NetMisc.pm:1.5	Tue Mar  7 23:39:11 2006
+++ affelio/lib/Affelio/misc/NetMisc.pm	Sun Jun  4 18:11:55 2006
@@ -14,14 +14,14 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
-# $Id: NetMisc.pm,v 1.5 2006/03/07 14:39:11 slash5234 Exp $
+# $Id: NetMisc.pm,v 1.6 2006/06/04 09:11:55 slash5234 Exp $
 
 package Affelio::misc::NetMisc;
 {
     use strict;
     use Exporter;
     @Affelio::misc::NetMisc::ISA = "Exporter";
-    @Affelio::misc::NetMisc::EXPORT = qw (get_remote_domain get_remote_host URL2domain URL2path hostname2domain check_private_IP_addr);
+    @Affelio::misc::NetMisc::EXPORT = qw (get_remote_domain get_remote_host URL2domain URL2path hostname2domain check_private_IP_addr get_accessed_uri);
     
     ########################################################################
     sub check_private_IP_addr{
@@ -104,6 +104,29 @@
 	return($url);
     }
     
+    ########################################################################
+    sub get_accessed_uri{
+	use Affelio::misc::Debug;
+	#while (my ($name, $value) = each(%ENV)) {
+	#    debug_print("ENV:: $name = $value\n");
+	#}
+
+	if($ENV{SCRIPT_URI}){
+	    return($ENV{SCRIPT_URI});
+	}else{
+	    my $proto= "http";
+	    if($ENV{SERVER_PROTOCOL} =~ /HTTPS/){
+		$proto ="https";
+	    }
+	    my $port ="";
+	    if($ENV{SERVER_PORT} != 80){
+		$port =":$ENV{SERVER_PORT}";
+	    } 
+	    my $ret = "$proto://$ENV{SERVER_NAME}" .$port. $ENV{REQUEST_URI};
+	    return($ret); 
+	}
+    }
+
     
 }#package
 1;


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