Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Mapping userID with domain usernames on NT
AKB
Hi,
wanted to know whether any one has mapped teamSite userid with the usernames. So that on the new job screen, instead of getting the userid in the drop down list of authors, editors, reviewers etc we should get the usernames.
Thanks,
Anil
Find more posts tagged with
Comments
sajiddc
Yes it is possible and I believe has been done in the past.
Hope that helps.
Adam Stoller
The code for doing this is dependant upon the platform and the authentication mechanisms in place. Some folks have taken to creating additional foo.uid files with the mappings directly inside them:
dkdu19:Arthur Marx
l3isl34a:Adolph Marx
...
Others use similar calls to grep through /etc/passwd or the results from something like ypcat passwd (on Unix) or net user (Windows) - more forward-thinking folks would probably use existing routines for looking up this information like getpwnam() or Win32::NetAdmin or Win32API::Net routines, or else they do some form of LDAP lookup
So - it's emminently possible to do - the trick is doing it correctly for the environment within which it is needed
--fish
(Interwoven, Curriculum Development)
Migrateduser
I use the first method that fish mentioned - creating additional .uid files and maintaining them along with the roles files. It requires more user admin maintenance, but it's really not that time consuming at all. I have the code that you would use to set up your drop-down list based on the full names. Email me if you want it.
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
AKB
Fish,
THanks a lot for the reply. Do have code snippet of using ypcat passwd (on Unix) or Win32::NetAdmin .
By this I will have some base and I can start working from that point.
Thanks,
Anil
Adam Stoller
Win32::NetAdmin - use perldoc and simple test scripts to get yourself going (I don't have anything "handy").
ypcat - basically:
sub get_name{
my $userid = $_[0];
my $name = (split(/:/, `ypcat passwd | egrep "^$userid:"`))[4];
print "$userid => '$name'\n"; #=# POC debugging
return($name);
}
You could do it a number of other ways too - but the above should work.
--fish
(Interwoven, Curriculum Development)
talktome_ys
Would you happen to have any sample code for a Windows environment?
Regards,
Adam Stoller
I suggest you do a perldoc on Win32API::Net (not Win32::NetAdmin) - that should help you figure out how to write the code.
--fish
<i>Strolling Prime Minister of no fixed address</i>
sajiddc
I might I will need to check around. If I find it, I will post it