[Slashdotjp-dev 1198] [725] Move "faq" handler to Apache.pm because cannot rewrite to "shtml" file on userdir_handler by unknown reason

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2008年 7月 26日 (土) 14:42:47 JST


Revision: 725
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=slashdotjp&view=rev&rev=725
Author:   tach
Date:     2008-07-26 14:42:47 +0900 (Sat, 26 Jul 2008)

Log Message:
-----------
Move "faq" handler to Apache.pm because cannot rewrite to "shtml" file on userdir_handler by unknown reason

Modified Paths:
--------------
    slashjp/branches/2.5.0.192/Slash/Apache/Apache.pm
    slashjp/branches/2.5.0.192/Slash/Apache/User/User.pm


-------------- next part --------------
Modified: slashjp/branches/2.5.0.192/Slash/Apache/Apache.pm
===================================================================
--- slashjp/branches/2.5.0.192/Slash/Apache/Apache.pm	2008-07-25 17:29:30 UTC (rev 724)
+++ slashjp/branches/2.5.0.192/Slash/Apache/Apache.pm	2008-07-26 05:42:47 UTC (rev 725)
@@ -490,6 +490,33 @@
 		}
 	}
 
+	# faq for slashdot.jp
+	if ($uri =~ m!^/faq (?: (/[^?]*) | /? ) (?: \?(.*) )? $!x) {
+		my($word, $query) = ($1, $2);
+		$word ? $word =~ s!^/!! : redirect("$constants->{absolutedir}/faq/");
+		my @args = ($query);
+		if ($word) {
+			$word = "-$word";
+		}
+		$word = "faq$word";
+		my $fpath = "/$constants->{sfjp_wikicontents_path}/$word.shtml";
+		my $file = "$constants->{basedir}$fpath";
+		unless (-r $file) {
+			return NOT_FOUND;
+		}
+		if ($is_user) {
+			push @args, "name=$word";
+			$r->args(join('&', @args));
+			$r->uri('/wikicontents.pl');
+			$r->filename($constants->{basedir} . '/wikicontents.pl');
+			return OK;
+		} else {
+			$r->uri($fpath);
+			$r->filename($file);
+			return OK;
+		}
+	}
+
 	# redirect to static if
 	# * not a user, nor a daypass holder,
 	# and
@@ -567,3 +594,4 @@
 Slash(3).
 
 =cut
+        

Modified: slashjp/branches/2.5.0.192/Slash/Apache/User/User.pm
===================================================================
--- slashjp/branches/2.5.0.192/Slash/Apache/User/User.pm	2008-07-25 17:29:30 UTC (rev 724)
+++ slashjp/branches/2.5.0.192/Slash/Apache/User/User.pm	2008-07-26 05:42:47 UTC (rev 725)
@@ -636,33 +636,6 @@
 		return OK;
 	}
 
-	# faq for slashdot.jp
-	if ($uri =~ m!^/faq (?: (/[^?]*) | /? ) (?: \?(.*) )? $!x) {
-		my($word, $query) = ($1, $2);
-		$word ? $word =~ s!^/!! : redirect("$constants->{absolutedir}/faq/");
-		my @args = ($query);
-		if ($word) {
-			$word = "-$word";
-		}
-		$word = "faq$word";
-		my $fpath = "/$constants->{sfjp_wikicontents_path}/$word.shtml";
-		my $file = "$constants->{basedir}$fpath";
-		unless (-r $file) {
-			return NOT_FOUND;
-		}
-		if ($r->header_in('Cookie') =~ $USER_MATCH) {
-			push @args, "name=$word";
-			$r->args(join('&', @args));
-			$r->uri('/wikicontents.pl');
-			$r->filename($constants->{basedir} . '/wikicontents.pl');
-			return OK;
-		} else {
-			$r->uri($fpath);
-			$r->filename($file);
-			return OK;
-		}
-	}
-
 	# for self-references (/~/ and /my/)
 	if (($saveuri =~ m[^/(?:%7[eE]|~)] && $uri =~ m[^/~ (?: /(.*) | /? ) $]x)
 		# /my/ or /my can match, but not /mything


Slashdotjp-dev メーリングリストの案内
Back to archive index