[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Hook Script to change username case

From: Reinhard Brandstaedter <reinhard.brandstaedter_at_ams-engineering.com>
Date: 2005-10-25 14:09:16 CEST

Ryan Schmidt wrote:
> On Oct 25, 2005, at 09:27, Reinhard Brandstaedter wrote:
>
>> Is it possible to change the username case (to lower) via hook script
>> so that the whole commit process uses the lower case username,
>> transparent to the user itself?
>> If not via hook script, is there a way to do this in apache?
>
>
> I don't think there is a way to change any data in a hook script. I
> think the best you can do is, in a start-commit hook, check if the
> username contains any uppercase letters, and if so, reject the commit
> with a message explaining to use lowercase usernames. That should
> reduce your support calls......

OK that's not the cleanest way but I've done similar now.
My start-commit script now checks against Active Directory via LDAP and
optionally tells the user his real name (with case-sensitivness)

If anyone is interested, my start-commit script:

--- snip ---
#!/bin/sh
REPOS="$1"
USER="$2"

SAMACCOUNTNAME=`ldapsearch -x -D "<DOMAIN>\<login>" -s sub -LLL -w
<password> "sAMAccountName=$USER" sAMAccountName | awk '$1 ==
"sAMAccountName:" {print $2}'`

if [ "$SAMACCOUNTNAME" != "$USER" ]
then
   echo "Your provided username \"$USER\" does not match case! You have
to use \"$SAMACCOUNTNAME\"" >&2
   exit 1
fi

# All checks passed, so allow the commit.
exit 0
--- snip ---

kr,
Reinhard

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Oct 25 14:12:52 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.