fixed up several broken URLs (minor but annoying)
[gitolite.git] / contrib / lib / Gitolite / Triggers / RedmineUserAlias.pm
blobae5ce93a7a1066083d8cc47f13ccb87bc27559ec
1 package Gitolite::Triggers::RedmineUserAlias;
3 use Gitolite::Rc;
4 use Gitolite::Common;
5 use Gitolite::Conf::Load;
7 use strict;
8 use warnings;
10 # aliasing a redmine username to a more user-friendly one
11 # ----------------------------------------------------------------------
13 =for usage
15 Why:
17 Redmine creates users like "redmine_alice_123"; we want the users to just
18 see "alice" instead of that.
20 Assumption:
22 * Redmine does not allow duplicates in the middle bit; i.e., you can't
23 create redmine_alice_123 and redmine_alice_456 also.
25 How:
27 * add this code as lib/Gitolite/Triggers/RedmineUserAlias.pm to your
28 site-local code directory; see this link for how:
30 http://gitolite.com/gitolite/non-core.html#locations
32 * add the following to the rc file, just before the ENABLE section (don't
33 forget the trailing comma):
35 INPUT => [ 'RedmineUserAlias::input' ],
37 Notes:
39 * http mode has not been tested and will not be. If someone has the time to
40 test it and make it work please let me know.
42 * not tested with mirroring.
44 Quote:
46 * "All that for what is effectively one line of code. I need a life".
48 =cut
50 sub input {
51 $ARGV[0] or _die "no username???";
52 $ARGV[0] =~ s/^redmine_(\S+)_\d+$/$1/;