[Pyukiwiki-cvs 0010590] CVS update: PyukiWiki-Devel/lib/Nana

アーカイブの一覧に戻る

PyukiWiki CVS Commit pyuki****@lists*****
2012年 4月 9日 (月) 03:07:37 JST


Index: PyukiWiki-Devel/lib/Nana/Cache.pm
diff -u PyukiWiki-Devel/lib/Nana/Cache.pm:1.506 PyukiWiki-Devel/lib/Nana/Cache.pm:1.507
--- PyukiWiki-Devel/lib/Nana/Cache.pm:1.506	Sun Apr  8 16:59:10 2012
+++ PyukiWiki-Devel/lib/Nana/Cache.pm	Mon Apr  9 03:07:36 2012
@@ -1,6 +1,6 @@
 ######################################################################
 # Cache.pm - This is PyukiWiki, yet another Wiki clone.
-# $Id: Cache.pm,v 1.506 2012/04/08 07:59:10 papu Exp $
+# $Id: Cache.pm,v 1.507 2012/04/08 18:07:36 papu Exp $
 #
 # "Nana::Cache" ver 0.2 $$
 # Author: Nanami
Index: PyukiWiki-Devel/lib/Nana/Cookie.pm
diff -u /dev/null PyukiWiki-Devel/lib/Nana/Cookie.pm:1.1
--- /dev/null	Mon Apr  9 03:07:36 2012
+++ PyukiWiki-Devel/lib/Nana/Cookie.pm	Mon Apr  9 03:07:36 2012
@@ -0,0 +1,77 @@
+######################################################################
+# Cookie.pm - This is PyukiWiki, yet another Wiki clone.
+# $Id: Cookie.pm,v 1.1 2012/04/08 18:07:36 papu Exp $
+#
+# "Nana::Cookie" ver 0.1 $$
+# Author: Nanami
+# http://nanakochi.daiba.cx/
+# Copyright (C) 2004-2012 Nekyo
+# http://nekyo.qp.land.to/
+# Copyright (C) 2005-2012 PyukiWiki Developers Team
+# http://pyukiwiki.info/
+# Based on YukiWiki http://www.hyuki.com/yukiwiki/
+# Powerd by PukiWiki http://pukiwiki.sfjp.jp/
+# License: GPL3 and/or Artistic or each later version
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the same terms as Perl itself.
+# Return:LF Code=EUC-JP 1TAB=4Spaces
+######################################################################
+
+package	Nana::Cookie;
+use 5.005;
+use strict;
+use vars qw($VERSION);
+$VERSION = '0.1';
+
+######################################################################
+
+sub getcookie {
+	my($cookieID,%buf)=@_;
+	my @pairs;
+	my ($pair, $cname, $value);
+	my %DUMMY;
+
+	my $decode = $::functions{"decode"};
+
+	@pairs = split(/;/,&$decode($ENV{'HTTP_COOKIE'}));
+	foreach $pair (@pairs) {
+		($cname,$value) = split(/=/,$pair,2);
+		$cname =~ s/ //g;
+		$DUMMY{$cname} = $value;
+	}
+	@pairs = split(/,/,$DUMMY{$cookieID});
+	foreach $pair (@pairs) {
+		($cname,$value) = split(/:/,$pair,2);
+		$buf{$cname} = $value;
+	}
+	return %buf;
+}
+
+sub setcookie {
+	my ($cookieID,$expire,%buf)=@_;
+	my ($date, $data, $name, $value);
+
+	my $datefunc = $::functions{"http_date"};
+	my $tzfunc = $::functions{"gettz"};
+
+	if($expire+0 > 0) {
+		$date=&$datefunc(time+&$tzfunc*3600+$::cookie_expire);
+	} elsif($expire+0 < 0) {
+		$date=&$datefunc(1);
+	}
+	$buf{cookietime}=time;
+	while(($name,$value)=each(%buf)) {
+		$data.="$name:$value," if($name ne '');
+	}
+	$data=~s/,$//g;
+
+	my $encodefunc = $::functions{"encode"};
+	$data=&$encodefunc($data);
+
+	$::HTTP_HEADER.=qq(Set-Cookie: $cookieID=$data;);
+	$::HTTP_HEADER.=qq( path=$::basepath;);
+	$::HTTP_HEADER.=" expires=$date" if($expire ne 0);
+	$::HTTP_HEADER.="\n";
+}
+1;
Index: PyukiWiki-Devel/lib/Nana/Enc.pm
diff -u /dev/null PyukiWiki-Devel/lib/Nana/Enc.pm:1.1
--- /dev/null	Mon Apr  9 03:07:36 2012
+++ PyukiWiki-Devel/lib/Nana/Enc.pm	Mon Apr  9 03:07:36 2012
@@ -0,0 +1,97 @@
+######################################################################
+# Enc.pm - This is PyukiWiki, yet another Wiki clone.
+# $Id: Enc.pm,v 1.1 2012/04/08 18:07:36 papu Exp $
+#
+# "Nana::Enc" ver 0.1 $$
+# Author: Nanami
+# http://nanakochi.daiba.cx/
+# Copyright (C) 2004-2012 Nekyo
+# http://nekyo.qp.land.to/
+# Copyright (C) 2005-2012 PyukiWiki Developers Team
+# http://pyukiwiki.info/
+# Based on YukiWiki http://www.hyuki.com/yukiwiki/
+# Powerd by PukiWiki http://pukiwiki.sfjp.jp/
+# License: GPL3 and/or Artistic or each later version
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the same terms as Perl itself.
+# Return:LF Code=EUC-JP 1TAB=4Spaces
+######################################################################
+
+package	Nana::Enc;
+use 5.005;
+use strict;
+use vars qw($VERSION);
+$VERSION = '0.1';
+
+######################################################################
+
+sub maketoken {
+	my $js;
+	if($::Token eq '') {
+		my (@token) = ('0'..'9', 'A'..'Z', 'a'..'z');
+		$::Token="";
+		my $add=0;
+		for(my $i=0; $i<16;) {
+			my $token;
+			$token=$token[(time + $add++ + $i + int(rand(62))) % 62];
+				 # 62 is scalar(@token)								# comment
+			if($::Token!~/$token/) {
+				$::Token.=$token;
+				$i++;
+			}
+		}
+	}
+	$js=qq(var cs = "$::Token";\n);
+	return $js;
+}
+
+sub iscryptpass {
+	if($::Use_CryptPass) {
+		if($::Token eq '') {
+			$::IN_JSHEAD.=&maketoken;
+			my $funcp = $::functions{"jscss_include"};
+			$::IN_HEAD.=&$funcp("passwd");
+		}
+		return 1;
+	}
+	return 0;
+}
+
+# pure code of http://ninja.index.ne.jp/~toshi/soft/untispam.shtml	# comment
+
+sub decode {
+	my($passwd,$enc,$token)=@_;
+	my $dec;
+
+	if($passwd eq '' && $enc ne '' && $token ne '' && &iscryptpass) {
+
+		for(my $i=0; $i<length($enc); $i+=4) {
+			my $dif=index($token,substr($enc,$i,1)) * length($token) + index($token,substr($enc,$i+1,1));
+			my $c=index($token,substr($enc,$i+2,1));
+			my $d=$c * length($token) + index($token,substr($enc,$i+3,1)) - $dif;
+			$dec=$dec . chr($d);
+		}
+		return $dec;
+	}
+	return $passwd;
+}
+
+# reverse code of http://ninja.index.ne.jp/~toshi/soft/untispam.shtml	# comment
+
+sub encode {
+	my($str, $token) = @_;
+	my($i, $dd, $res, $dif );
+	my $enc_list = $token;
+	for( $i = 0 ; $i < length( $str ) ; $i ++ ) {
+		$dif = (int(rand(127))+$i)%127;
+		$res .= substr($enc_list,$dif/0x10,1).substr($enc_list,$dif%0x10,1);
+		$dd = ord(substr($str,$i,1))+$dif;
+		$res .= substr($enc_list,$dd/0x10,1).substr($enc_list,$dd%0x10,1);
+	}
+	return( $res );
+}
+
+
+1;
+__END__
Index: PyukiWiki-Devel/lib/Nana/File.pm
diff -u PyukiWiki-Devel/lib/Nana/File.pm:1.484 PyukiWiki-Devel/lib/Nana/File.pm:1.485
--- PyukiWiki-Devel/lib/Nana/File.pm:1.484	Sun Apr  8 16:59:10 2012
+++ PyukiWiki-Devel/lib/Nana/File.pm	Mon Apr  9 03:07:36 2012
@@ -1,6 +1,6 @@
 ######################################################################
 # File.pm - This is PyukiWiki, yet another Wiki clone.
-# $Id: File.pm,v 1.484 2012/04/08 07:59:10 papu Exp $
+# $Id: File.pm,v 1.485 2012/04/08 18:07:36 papu Exp $
 #
 # "Nana::File" ver 0.1 $$
 # Author: Nanami
Index: PyukiWiki-Devel/lib/Nana/GZIP.pm
diff -u PyukiWiki-Devel/lib/Nana/GZIP.pm:1.249 PyukiWiki-Devel/lib/Nana/GZIP.pm:1.250
--- PyukiWiki-Devel/lib/Nana/GZIP.pm:1.249	Sun Apr  8 16:59:10 2012
+++ PyukiWiki-Devel/lib/Nana/GZIP.pm	Mon Apr  9 03:07:36 2012
@@ -1,6 +1,6 @@
 ######################################################################
 # GZIP.pm - This is PyukiWiki, yet another Wiki clone.
-# $Id: GZIP.pm,v 1.249 2012/04/08 07:59:10 papu Exp $
+# $Id: GZIP.pm,v 1.250 2012/04/08 18:07:36 papu Exp $
 #
 # "Nana::GZIP" ver 0.2 $$
 # Author: Nanami
Index: PyukiWiki-Devel/lib/Nana/HTMLOpt.pm
diff -u /dev/null PyukiWiki-Devel/lib/Nana/HTMLOpt.pm:1.1
--- /dev/null	Mon Apr  9 03:07:36 2012
+++ PyukiWiki-Devel/lib/Nana/HTMLOpt.pm	Mon Apr  9 03:07:36 2012
@@ -0,0 +1,55 @@
+######################################################################
+# HTMLOpt.pm - This is PyukiWiki, yet another Wiki clone.
+# $Id: HTMLOpt.pm,v 1.1 2012/04/08 18:07:36 papu Exp $
+#
+# "Nana::HTMLOpt" ver 0.1 $$
+# Author: Nanami
+# http://nanakochi.daiba.cx/
+# Copyright (C) 2004-2012 Nekyo
+# http://nekyo.qp.land.to/
+# Copyright (C) 2005-2012 PyukiWiki Developers Team
+# http://pyukiwiki.info/
+# Based on YukiWiki http://www.hyuki.com/yukiwiki/
+# Powerd by PukiWiki http://pukiwiki.sfjp.jp/
+# License: GPL3 and/or Artistic or each later version
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the same terms as Perl itself.
+# Return:LF Code=EUC-JP 1TAB=4Spaces
+######################################################################
+
+package	Nana::HTMLOpt;
+use 5.005;
+use strict;
+use vars qw($VERSION);
+$VERSION = '0.1';
+
+######################################################################
+
+sub html {
+	my($body)=shift;
+
+	$body=~s/\/\/\-\-\>\n?\<\/script\>\n?<script\s?type\=\"text\/javascript\"\>\<\!\-\-\n?//g;
+	$body=~s/(<\!\-\-)/\n\/\/<\!\[CDATA\[/g;
+	$body=~s/(\/\/\-\->)/\/\/\]\]>/g;
+	$body=~s/<pre>\n/<pre>/g;
+	$body=~s/<div>([\s\t\r\n]+)?<\/div>//g;
+	$body=~s/<p>\n<\/p>(<p>\n<\/p>)?/<p>\n<\/p>/g;
+	$body=~s/>\n(\n+)?</>\n</g;
+
+	return $body;
+}
+
+sub xhtml {
+	my($body)=shift;
+
+	$body=~s/\/\/\-\-\>\n?\<\/script\>\n?<script\s?type\=\"text\/javascript\"\>\<\!\-\-\n?//g;
+	$body=~s/\ \/>/>/g;
+	$body=~s/<div>([\s\t\r\n]+)?<\/div>//g;
+	$body=~s/<p>\n<\/p>(<p>\n<\/p>)?/<p>\n<\/p>/g;
+	$body=~s/>\n(\n+)?</>\n</g;
+
+	return $body;
+}
+1;
+__END__
Index: PyukiWiki-Devel/lib/Nana/HTTP.pm
diff -u PyukiWiki-Devel/lib/Nana/HTTP.pm:1.482 PyukiWiki-Devel/lib/Nana/HTTP.pm:1.483
--- PyukiWiki-Devel/lib/Nana/HTTP.pm:1.482	Sun Apr  8 16:59:10 2012
+++ PyukiWiki-Devel/lib/Nana/HTTP.pm	Mon Apr  9 03:07:36 2012
@@ -1,6 +1,6 @@
 ######################################################################
 # HTTP.pm - This is PyukiWiki, yet another Wiki clone.
-# $Id: HTTP.pm,v 1.482 2012/04/08 07:59:10 papu Exp $
+# $Id: HTTP.pm,v 1.483 2012/04/08 18:07:36 papu Exp $
 #
 # "HTTP::Lite" ver 0.8 $$
 # Author: Nanami
Index: PyukiWiki-Devel/lib/Nana/HTTPCompress.pm
diff -u /dev/null PyukiWiki-Devel/lib/Nana/HTTPCompress.pm:1.1
--- /dev/null	Mon Apr  9 03:07:36 2012
+++ PyukiWiki-Devel/lib/Nana/HTTPCompress.pm	Mon Apr  9 03:07:36 2012
@@ -0,0 +1,92 @@
+######################################################################
+# HTTPCompress.pm - This is PyukiWiki, yet another Wiki clone.
+# $Id: HTTPCompress.pm,v 1.1 2012/04/08 18:07:36 papu Exp $
+#
+# "Nana::HTTPCompress" ver 0.1 $$
+# Author: Nanami
+# http://nanakochi.daiba.cx/
+# Copyright (C) 2004-2012 Nekyo
+# http://nekyo.qp.land.to/
+# Copyright (C) 2005-2012 PyukiWiki Developers Team
+# http://pyukiwiki.info/
+# Based on YukiWiki http://www.hyuki.com/yukiwiki/
+# Powerd by PukiWiki http://pukiwiki.sfjp.jp/
+# License: GPL3 and/or Artistic or each later version
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the same terms as Perl itself.
+# Return:LF Code=EUC-JP 1TAB=4Spaces
+######################################################################
+
+package	Nana::HTTPCompress;
+use 5.005;
+use strict;
+use vars qw($VERSION);
+$VERSION = '0.1';
+
+######################################################################
+
+$gzip::path;
+$gzip::header;
+
+sub init {
+	my($path)=@_;
+	my $gzip_command='gzip';
+
+	if($path eq 'nouse') {
+		$path='';
+	} elsif($path eq '') {
+		my $forceflag="";
+		my $fastflag="";
+		foreach(split(/:/,$ENV{PATH})) {
+			if(-x "$_/$gzip_command") {
+				$path="$_/$gzip_command" ;
+				if(open(PIPE,"$path --help 2>&1|")) {
+					foreach(<PIPE>) {
+						$forceflag="--force" if(/(\-\-force)/);
+						$fastflag="--fast" if(/(\-\-fast)/);
+					}
+					close(PIPE);
+				}
+			}
+		}
+		if($path ne '') {
+			$gzip::path="$path $fastflag $forceflag";
+			$::debug.="auto detect gzip path : \"$gzip::path\"\n";	# debug
+		} elsif(&load_module("Compress::Zlib")) {
+			$gzip::path="zlib";
+			$::debug.="auto detect Compress::Zlib";	# debug
+		}
+	}
+
+	if ($path ne '') {
+		if(($ENV{'HTTP_ACCEPT_ENCODING'}=~/gzip/)) {
+			if($ENV{'HTTP_ACCEPT_ENCODING'}=~/x-gzip/) {
+				$gzip::header="Content-Encoding: x-gzip\n";
+			} else {
+				$gzip::header="Content-Encoding: gzip\n";
+			}
+			return $gzip::header;
+		}
+	}
+}
+
+sub output {
+	my ($data)=shift;
+	if ($gzip::header ne '') {
+		if($gzip::path eq "zlib") {
+			binmode(STDOUT);
+			my $compress_data=Compress::Zlib::memGzip ($data);
+			print $compress_data;
+		} else {
+			binmode(STDOUT);
+			open(STDOUT,"| $gzip::path");
+			print $data;
+		}
+	} else {
+		print $data;
+	}
+	close(STDOUT);
+}
+1;
+__END__
Index: PyukiWiki-Devel/lib/Nana/Lock.pm
diff -u PyukiWiki-Devel/lib/Nana/Lock.pm:1.505 PyukiWiki-Devel/lib/Nana/Lock.pm:1.506
--- PyukiWiki-Devel/lib/Nana/Lock.pm:1.505	Sun Apr  8 16:59:10 2012
+++ PyukiWiki-Devel/lib/Nana/Lock.pm	Mon Apr  9 03:07:36 2012
@@ -1,6 +1,6 @@
 ######################################################################
 # Lock.pm - This is PyukiWiki, yet another Wiki clone.
-# $Id: Lock.pm,v 1.505 2012/04/08 07:59:10 papu Exp $
+# $Id: Lock.pm,v 1.506 2012/04/08 18:07:36 papu Exp $
 #
 # "Nana::Lock" ver 0.2 $$
 # Author: Nanami
Index: PyukiWiki-Devel/lib/Nana/Logs.pm
diff -u PyukiWiki-Devel/lib/Nana/Logs.pm:1.205 PyukiWiki-Devel/lib/Nana/Logs.pm:1.206
--- PyukiWiki-Devel/lib/Nana/Logs.pm:1.205	Sun Apr  8 16:59:10 2012
+++ PyukiWiki-Devel/lib/Nana/Logs.pm	Mon Apr  9 03:07:36 2012
@@ -1,6 +1,6 @@
 ######################################################################
 # Logs.pm - This is PyukiWiki, yet another Wiki clone.
-# $Id: Logs.pm,v 1.205 2012/04/08 07:59:10 papu Exp $
+# $Id: Logs.pm,v 1.206 2012/04/08 18:07:36 papu Exp $
 #
 # "Nana::Logs" ver 0.2 $$
 # Author: Nanami
Index: PyukiWiki-Devel/lib/Nana/MD5.pm
diff -u PyukiWiki-Devel/lib/Nana/MD5.pm:1.58 PyukiWiki-Devel/lib/Nana/MD5.pm:1.59
--- PyukiWiki-Devel/lib/Nana/MD5.pm:1.58	Sun Apr  8 16:59:10 2012
+++ PyukiWiki-Devel/lib/Nana/MD5.pm	Mon Apr  9 03:07:36 2012
@@ -1,6 +1,6 @@
 ######################################################################
 # MD5.pm - This is PyukiWiki, yet another Wiki clone.
-# $Id: MD5.pm,v 1.58 2012/04/08 07:59:10 papu Exp $
+# $Id: MD5.pm,v 1.59 2012/04/08 18:07:36 papu Exp $
 #
 # "Nana::MD5" ver 0.1 $$
 # Author: Nanami
Index: PyukiWiki-Devel/lib/Nana/Mail.pm
diff -u PyukiWiki-Devel/lib/Nana/Mail.pm:1.466 PyukiWiki-Devel/lib/Nana/Mail.pm:1.467
--- PyukiWiki-Devel/lib/Nana/Mail.pm:1.466	Sun Apr  8 16:59:10 2012
+++ PyukiWiki-Devel/lib/Nana/Mail.pm	Mon Apr  9 03:07:36 2012
@@ -1,8 +1,8 @@
 ######################################################################
 # Mail.pm - This is PyukiWiki, yet another Wiki clone.
-# $Id: Mail.pm,v 1.466 2012/04/08 07:59:10 papu Exp $
+# $Id: Mail.pm,v 1.467 2012/04/08 18:07:36 papu Exp $
 #
-# "Nana::Mail" ver 0.4 $$
+# "Nana::Mail" ver 0.5 $$
 # Author: Nanami
 # http://nanakochi.daiba.cx/
 # Copyright (C) 2004-2012 Nekyo
@@ -24,13 +24,13 @@
 use 5.8.1;
 use strict;
 use vars qw($VERSION);
-$VERSION = '0.4';
+$VERSION = '0.5';
 
 # sendmailパス検索候補
 $Nana::Mail::sendmail=<<EOM;
-/var/qmail/bin/sendmail
-/usr/sbin/sendmail
-/usr/bin/sendmail
+/var/qmail/bin/sendmail -t
+/usr/sbin/sendmail -t
+/usr/bin/sendmail -t
 EOM
 
 ######################################################################
Index: PyukiWiki-Devel/lib/Nana/Pod2Wiki.pm
diff -u PyukiWiki-Devel/lib/Nana/Pod2Wiki.pm:1.479 PyukiWiki-Devel/lib/Nana/Pod2Wiki.pm:1.480
--- PyukiWiki-Devel/lib/Nana/Pod2Wiki.pm:1.479	Sun Apr  8 16:59:10 2012
+++ PyukiWiki-Devel/lib/Nana/Pod2Wiki.pm	Mon Apr  9 03:07:36 2012
@@ -1,6 +1,6 @@
 ######################################################################
 # Pod2Wiki.pm - This is PyukiWiki, yet another Wiki clone.
-# $Id: Pod2Wiki.pm,v 1.479 2012/04/08 07:59:10 papu Exp $
+# $Id: Pod2Wiki.pm,v 1.480 2012/04/08 18:07:36 papu Exp $
 #
 # "Nana::Pod2Wiki" ver 0.1 $$
 # Author: Nanami
Index: PyukiWiki-Devel/lib/Nana/RemoteHost.pm
diff -u /dev/null PyukiWiki-Devel/lib/Nana/RemoteHost.pm:1.1
--- /dev/null	Mon Apr  9 03:07:36 2012
+++ PyukiWiki-Devel/lib/Nana/RemoteHost.pm	Mon Apr  9 03:07:36 2012
@@ -0,0 +1,128 @@
+######################################################################
+# RemoteHost.pm - This is PyukiWiki, yet another Wiki clone.
+# $Id: RemoteHost.pm,v 1.1 2012/04/08 18:07:36 papu Exp $
+#
+# "Nana::RemoteHost" ver 0.1 $$
+# Author: Nanami
+# http://nanakochi.daiba.cx/
+# Copyright (C) 2004-2012 Nekyo
+# http://nekyo.qp.land.to/
+# Copyright (C) 2005-2012 PyukiWiki Developers Team
+# http://pyukiwiki.info/
+# Based on YukiWiki http://www.hyuki.com/yukiwiki/
+# Powerd by PukiWiki http://pukiwiki.sfjp.jp/
+# License: GPL3 and/or Artistic or each later version
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the same terms as Perl itself.
+# Return:LF Code=Shift-JIS 1TAB=4Spaces
+######################################################################
+
+package	Nana::RemoteHost;
+use 5.005;
+use strict;
+use vars qw($VERSION);
+$VERSION = '0.1';
+
+######################################################################
+
+$Nana::RemoteHost::Execed=0;
+sub get {
+	return if($Nana::RemoteHost::Execed eq 1);
+
+	$Nana::RemoteHost::Execed=1;
+
+	# from http://www.alib.jp/perl/resolv.html#nocompact	# comment
+	# and  http://www2u.biglobe.ne.jp/MAS/perl/waza/dns.html#nocompact	# comment
+
+	if($ENV{REMOTE_HOST} eq '' || $ENV{REMOTE_ADDR} eq $ENV{REMOTE_HOST}) {#nocompact
+		my $addr=$ENV{REMOTE_ADDR};#nocompact
+		my $ipv4addr;#nocompact
+		my $ipv6addr;#nocompact
+		if($addr=~/^(?:::(?:f{4}:)?)?((?:0*(?:2[0-4]\d|25[0-5]|[01]?\d\d|\d)\.){3}0*(?:2[0-4]\d|25[0-5]|[01]?\d\d|\d)|(?:\d+))$/) {#nocompact
+			$ipv4addr=$1;#nocompact
+			$ENV{REMOTE_ADDR}="$ipv4addr";#nocompact
+		} elsif($addr=~/:/) {#nocompact
+			$ipv6addr=$addr;#nocompact
+			$ENV{REMOTE_ADDR}="$ipv6addr";#nocompact
+		} else {#nocompact
+			$ipv4addr=$addr;#nocompact
+			$ENV{REMOTE_ADDR}="$ipv4addr";#nocompact
+		}#nocompact
+		if($ipv4addr ne '') {#nocompact
+			my $host#nocompact
+			 = gethostbyaddr(pack("C4", split(/\./, $ENV{REMOTE_ADDR})), 2);#nocompact
+			if($host eq '') {#nocompact
+				$host=$ENV{REMOTE_ADDR};#nocompact
+			}#nocompact
+			$ENV{REMOTE_HOST}=$host;#nocompact
+		} elsif($ipv6addr ne '') {#nocompact
+			if(&load_module("Net::DNS")) {#nocompact
+				# IPV6ƒAƒhƒŒƒX‚ð“WŠJ‚·‚éB#nocompact	# comment
+				my @address;#nocompact
+				if ($ipv6addr =~ /::/) {#nocompact
+			        my ($adr_a, $adr_b) = split /::/, $ipv6addr;#nocompact
+			        my @adr_a = split /:/, $adr_a;#nocompact
+			        my @adr_b = split /:/, $adr_b;#nocompact
+   					for (scalar @adr_a .. 7 - scalar @adr_b) {#nocompact
+						push @adr_a, 0#nocompact
+					}#nocompact
+					@address = (@adr_a, @adr_b);#nocompact
+				} else {#nocompact
+					@address = split /:/, $ipv6addr;#nocompact
+				}#nocompact
+				$ipv6addr =  (join ":", @address);#nocompact
+#nocompact
+				# IPV6ƒAƒhƒŒƒX‚ð‰ðŒˆ‚·‚é#nocompact	# comment
+				my $resolver = new Net::DNS::Resolver;#nocompact
+			    my $ans = $resolver->query($ipv6addr, 'PTR', 'IN');#nocompact
+				if($ans) {#nocompact
+			        foreach my $rr ($ans->answer) {#nocompact
+			                next if $rr->type ne "PTR";#nocompact
+			                $ENV{REMOTE_HOST}=$rr->ptrdname;#nocompact
+			        }#nocompact
+				} else {#nocompact
+					$ENV{REMOTE_HOST}="$ipv6addr";#nocompact
+				}#nocompact
+			} else {#nocompact
+				$ENV{REMOTE_HOST}="$ipv6addr";#nocompact
+			}#nocompact
+		}#nocompact
+	}#nocompact
+	if($ENV{REMOTE_HOST} eq '') {#compact
+		my $host#compact
+		 = gethostbyaddr(pack("C4", split(/\./, $ENV{REMOTE_ADDR})), 2);#compact
+		if($host eq '') {#compact
+			$host=$ENV{REMOTE_ADDR};#compact
+		}#compact
+		$ENV{REMOTE_HOST}=$host;#compact
+	}#compact
+	# ƒvƒƒNƒV‚ÌIPƒAƒhƒŒƒX‚𔲂­ #nocompact #comment
+	my $proxy;#nocompact
+	if($ENV{REMOTE_HOST_ORG} eq '') {#nocompact
+		$ENV{REMOTE_HOST_ORG}=$ENV{REMOTE_HOST};#nocompact
+	} else {#nocompact
+		$ENV{REMOTE_HOST}=$ENV{REMOTE_HOST_ORG};#nocompact
+	}#nocompact
+	if($ENV{HTTP_CLIENT_IP}=~/($::ipv4address_regex)/) {#nocompact
+		$proxy=$1;#nocompact
+	} elsif($ENV{HTTP_CLIENT_IP}=~/($::ipv6address_regex)/) {#nocompact
+		$proxy=$1;#nocompact
+	} elsif($ENV{HTTP_FORWARDED}=~/($::ipv4address_regex)/) {#nocompact
+		$proxy=$1;#nocompact
+	} elsif($ENV{HTTP_FORWARDED}=~/($::ipv6address_regex)/) {#nocompact
+		$proxy=$1;#nocompact
+	} elsif($ENV{HTTP_X_FORWARDED_FOR}=~/($::ipv4address_regex)/) {#nocompact
+		$proxy=$1;#nocompact
+	} elsif($ENV{HTTP_X_FORWARDED_FOR}=~/($::ipv6address_regex)/) {#nocompact
+		$proxy=$1;#nocompact
+	} elsif($ENV{HTTP_VIA}=~/($::ipv4address_regex)/) {#nocompact
+		$proxy=$1;#nocompact
+	} elsif($ENV{HTTP_VIA}=~/($::ipv6address_regex)/) {#nocompact
+		$proxy=$1;#nocompact
+	}#nocompact
+	if($proxy ne '') {#nocompact
+		$ENV{REMOTE_HOST}.= " ($proxy)";#nocompact
+	}#nocompact
+}
+__END__
Index: PyukiWiki-Devel/lib/Nana/Search.pm
diff -u PyukiWiki-Devel/lib/Nana/Search.pm:1.518 PyukiWiki-Devel/lib/Nana/Search.pm:1.519
--- PyukiWiki-Devel/lib/Nana/Search.pm:1.518	Sun Apr  8 16:59:10 2012
+++ PyukiWiki-Devel/lib/Nana/Search.pm	Mon Apr  9 03:07:36 2012
@@ -1,6 +1,6 @@
 ######################################################################
 # Search.pm - This is PyukiWiki, yet another Wiki clone.
-# $Id: Search.pm,v 1.518 2012/04/08 07:59:10 papu Exp $
+# $Id: Search.pm,v 1.519 2012/04/08 18:07:36 papu Exp $
 #
 # "Nana::Search" ver 0.6 $$
 # Author: Nanami
Index: PyukiWiki-Devel/lib/Nana/Search.pm.ja.pod
diff -u PyukiWiki-Devel/lib/Nana/Search.pm.ja.pod:1.505 PyukiWiki-Devel/lib/Nana/Search.pm.ja.pod:1.506
--- PyukiWiki-Devel/lib/Nana/Search.pm.ja.pod:1.505	Sun Apr  8 16:59:10 2012
+++ PyukiWiki-Devel/lib/Nana/Search.pm.ja.pod	Mon Apr  9 03:07:36 2012
@@ -1,4 +1,4 @@
-#$Id: Search.pm.ja.pod,v 1.505 2012/04/08 07:59:10 papu Exp $
+#$Id: Search.pm.ja.pod,v 1.506 2012/04/08 18:07:36 papu Exp $
 
 __END__
 =encoding euc-jp
Index: PyukiWiki-Devel/lib/Nana/YukiWikiDB.pm
diff -u PyukiWiki-Devel/lib/Nana/YukiWikiDB.pm:1.506 PyukiWiki-Devel/lib/Nana/YukiWikiDB.pm:1.507
--- PyukiWiki-Devel/lib/Nana/YukiWikiDB.pm:1.506	Sun Apr  8 16:59:10 2012
+++ PyukiWiki-Devel/lib/Nana/YukiWikiDB.pm	Mon Apr  9 03:07:36 2012
@@ -1,6 +1,6 @@
 ######################################################################
 # YukiWikiDB.pm - This is PyukiWiki, yet another Wiki clone.
-# $Id: YukiWikiDB.pm,v 1.506 2012/04/08 07:59:10 papu Exp $
+# $Id: YukiWikiDB.pm,v 1.507 2012/04/08 18:07:36 papu Exp $
 #
 # "Nana::YukiWikiDB" ver 0.6 $$
 # Author: Nanami
Index: PyukiWiki-Devel/lib/Nana/YukiWikiDB_GZIP.pm
diff -u PyukiWiki-Devel/lib/Nana/YukiWikiDB_GZIP.pm:1.253 PyukiWiki-Devel/lib/Nana/YukiWikiDB_GZIP.pm:1.254
--- PyukiWiki-Devel/lib/Nana/YukiWikiDB_GZIP.pm:1.253	Sun Apr  8 16:59:10 2012
+++ PyukiWiki-Devel/lib/Nana/YukiWikiDB_GZIP.pm	Mon Apr  9 03:07:36 2012
@@ -1,6 +1,6 @@
 ######################################################################
 # YukiWikiDB_GZIP.pm - This is PyukiWiki, yet another Wiki clone.
-# $Id: YukiWikiDB_GZIP.pm,v 1.253 2012/04/08 07:59:10 papu Exp $
+# $Id: YukiWikiDB_GZIP.pm,v 1.254 2012/04/08 18:07:36 papu Exp $
 #
 # "Nana::YukiWikiDB_GZIP" ver 0.7 $$
 # Author: Nanami



Pyukiwiki-cvs メーリングリストの案内
アーカイブの一覧に戻る