#111 Allow people to specify a URL directory for users.

open
nobody
5
2005-11-05
2005-11-05
Tony Mobily
No

This patch allows people to specify what URL directory is used to
determine a user's home.
Right now, it can only be:

http://slashdot.org/~merc (for example)

With this patch, it can be:

http://slashdot.org/users/merc (for example, if the var usersubdir
is "users/".

To avoid breaking existing sites, if the variable usersubdir is not
set, then "~" is assumed.

This patch is good if the slashsite is for non-hackers - newbies
weem to have trouble with the "tilde" character sometimes.

Here we go:

[root@mobily2 slash]# diff ./Slash/Apache/User/User.pm /usr/lib/
perl5/site_perl/5.8.5/i386-linux-thread-multi/Slash/Apache/User.pm
546a547,553
> # Work out what the user URI is. The default is ~.
> #
> my $usersubdir=$constants->{usersubdir};
> if($usersubdir eq ""){
> $usersubdir="~";
> }
>
548c555,556
< if (($saveuri =~ m[^/(?:%7[eE]|~)] && $uri =~ m[^/~ (?: /(.*) |
/? ) $]x)
---
> #
> if (($saveuri =~ m[^/(?:%7[eE]|$usersubdir)] && $uri =~ m[^/
$usersubdir (?: /(.*) | /? ) $]x)
648c656
< if ($saveuri =~ m[^/(?:%7[eE]|~)(.+)]) {
---
> if ($saveuri =~ m[^/(?:%7[eE]|$usersubdir)(.+)]) {

This is my very first patch. If it's crap, please let me know,

Discussion


Log in to post a comment.