[Slashdotjp-dev 1196] [723] * Add /faq/ internal redirection at Slash/Apache/User.pm

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2008年 7月 25日 (金) 23:38:18 JST


Revision: 723
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=slashdotjp&view=rev&rev=723
Author:   tach
Date:     2008-07-25 23:38:18 +0900 (Fri, 25 Jul 2008)

Log Message:
-----------
* Add /faq/ internal redirection at Slash/Apache/User.pm

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


-------------- next part --------------
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 04:16:00 UTC (rev 722)
+++ slashjp/branches/2.5.0.192/Slash/Apache/User/User.pm	2008-07-25 14:38:18 UTC (rev 723)
@@ -636,6 +636,31 @@
 		return OK;
 	}
 
+	# faq for slashdot.jp
+	if ($uri =~ m!^/faq (?: /([^?]*) | /? ) (?: \?(.*) )? $!x) {
+		my($word, $query) = ($1, $2);
+		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)

Modified: slashjp/branches/2.5.0.192/debian/changelog
===================================================================
--- slashjp/branches/2.5.0.192/debian/changelog	2008-07-25 04:16:00 UTC (rev 722)
+++ slashjp/branches/2.5.0.192/debian/changelog	2008-07-25 14:38:18 UTC (rev 723)
@@ -4,8 +4,9 @@
     - top recent: /journals/top/recent -> /journals/recent
     - top posters: /journals/top/posters -> /journals/posters
     - you can access old URL
+  * Add /faq/ internal redirection at Slash/Apache/User.pm
 
- -- Taku YASUI <tach****@osdn*****>  Wed, 23 Jul 2008 12:07:54 +0000
+ -- Taku YASUI <tach****@osdn*****>  Fri, 25 Jul 2008 14:36:41 +0000
 
 slash (2.5.0.192-16) unstable; urgency=low
 


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