Update flavourpathinfo to use Blosxom::Debug.
[blosxom-plugins.git] / general / isp
blobc360f4a6b1bd119611d5374a6e56918908559e44
1 # Blosxom Plugin: isp
2 # Author(s): Rael Dornfest <rael@oreilly.com> 
3 # Version: 2.0b3
4 # Documentation: See the bottom of this file or type: perldoc readme
6 package isp;
8 # --- Configurable variables -----
10 # What bit of the URL should I treat as username?
11 # Be sure the username bit is caught by the first () in the regular expression,
12 # e.g. /~(.*)/weblog matches "sam" in http://www.example/~sam/weblog
14 my $url_match = q!/~(.*?)/weblog!;
16 # Where should I look for the user's Blosxom data directory ($datadir)?
17 # Assume $username is populated by the results of the regular expression match
18 # above, e.g. /home/sam/weblog
20 my $user_datadir = q!/home/$username/weblog!;
22 # Where should plug-ins keep their state for each user?
23 # You should create this directory for them or no state will be saved.
25 my $user_plugin_state_dir = q!/home/$username/.weblog/plugins/state!;
27 # --------------------------------
29 use CGI qw/:standard/;
31 sub start {
32   url() =~ /$url_match/ or return 0;
33   my $username = $1;
34   
35   $blosxom::datadir = $user_datadir and $blosxom::datadir =~ s!\$username!$username!;
36   $blosxom::plugin_state_dir = $user_plugin_state_dir and $blosxom::plugin_state_dir =~ s!\$username!$username!;
38   
39   1;
44 __END__
46 =head1 NAME
48 Blosxom Plug-in: isp
50 =head1 SYNOPSIS
52 This plug-in is designed for the ISP looking to provide Blosxom weblogs to all of its users.
54 It traps URLs of the form /~username/weblog (as defined by $url_match), setting
55 $blosxom::datadir to an appropriate directory (as defined by $user_datadir) in
56 "username"'s home directory.
58 =head2 Usage
60 Be sure this plug-in sits BEFORE all other plug-ins.  To force this, rename it 
61 to 00isp.
63 This plugin works in concert with the "config" plug-in, without which it
64 won't allow individual users to override the global Blosxom configuration by
65 placing config files in their $datadir.
67 Aside from this simple renaming, about all that should be needed is to 
68 ScriptAlias /~username/weblog to /cgi-bin/blosxom.cgi, replacing the paths as 
69 appropriate to your particular setup, of course.
71 =head2 Warning
73 Be sure to choose a $user_datadir _outside_ of the user's personal 
74 Web-accessible document-root.  In other words, don't use a $user_datadir of
75 /home/$username/www/weblog or the like, where anything under /home/$username/www
76 is world-readable.
78 =head2 Limitations
80 This plug-in doesn't allow for users to add their own plug-ins to their own plugin directories.  There's a race condition in this I've not yet worked my way around, but I have it in mind.
82 =head1 VERSION
84 2.0b3
86 Version number coincides with the version of Blosxom with which the 
87 current version was first bundled.
89 =head1 AUTHOR
91 Rael Dornfest  <rael@oreilly.com>, http://www.raelity.org/
93 This plugin is now maintained by the Blosxom Sourceforge Team,
94 <blosxom-devel@lists.sourceforge.net>.
96 =head1 SEE ALSO
98 Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net/
100 Blosxom Plugin Docs: http://blosxom.sourceforge.net/documentation/users/plugins.html
102 =head1 BUGS
104 None known; please send bug reports and feedback to the Blosxom
105 development mailing list <blosxom-devel@lists.sourceforge.net>.
107 =head1 LICENSE
109 Blosxom and this Blosxom Plug-in
110 Copyright 2003, Rael Dornfest 
112 Permission is hereby granted, free of charge, to any person obtaining a
113 copy of this software and associated documentation files (the "Software"),
114 to deal in the Software without restriction, including without limitation
115 the rights to use, copy, modify, merge, publish, distribute, sublicense,
116 and/or sell copies of the Software, and to permit persons to whom the
117 Software is furnished to do so, subject to the following conditions:
119 The above copyright notice and this permission notice shall be included
120 in all copies or substantial portions of the Software.
122 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
123 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
124 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
125 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
126 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
127 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
128 OTHER DEALINGS IN THE SOFTWARE.