Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Autogenerating usernames

by strat (Canon)
on Sep 03, 2006 at 10:36 UTC ( #570921=note: print w/replies, xml ) Need Help??

in reply to Autogenerating usernames

If you need the usernames for the open internet, just set up a simple rule (e.g. /^\w{2,12}$/) and let the user choose what he wants.

But if you need usernames for a company, I'd use a rather strict rule. What this role looks like depends on the system, e.g.

  • length between 8 and 20 chars
  • first 4 chars are the department
  • next chars are the surname in international spelling [A-Za-z], with a maximum of 12 chars
  • first char of the givenname in international spelling

If this is not unique, add more letters of the givenname, and if still not unique, add something like [a-z]

So my username for a company could look like 1234fabianim or 1234fabianima or 1234fabianimartinx (if there are a lot of persons with the name martin fabiani in the same department)

The advantage of this rule is that these usernames are rather easy to remember

Best regards,
perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8."

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://570921]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2018-06-22 00:48 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (120 votes). Check out past polls.