On Mon, Jan 23, 2012 at 09:32:28AM +0100, Petter Reinholdtsen wrote:
> [Giorgio Pioda]
> > Is there an hack to modify the username creation for new users.  We
> > have the following policy: first name first letter and complete
> > lastname. So Peter Muster would have a "pmuster" account and not,
> > like gosa proposes "peterm".
> 
> According to
> <URL: 
> http://wiki.debian.org/DebianEdu/Documentation/Squeeze/GettingStarted#User_Management_with_GOsa.2BALI-
>  >
> this can be adjusted in gosa.conf.

Changing e.g. the default entry

  idGenerator="{%givenName[3-6]}{%sn[3-6]}"

in /etc/gosa/gosa.conf to

  idGenerator="{%givenName[1]}{%sn[23]}{id!1}"          

would generate the uid pmuster for user Peter Muster and pmuster1 for 
the next user Petra Muster, max. length of uids: 25; man 5 gosa.conf 
for more details.
 
> An alternative for you would be to import a CSV file with the wanted
> username instead of leaving it to GOsa to construct them.  See the
> manual for information on how to do this.

Using a csv file would allow to have the right non ascii name as well for 
the GECOS field. There's a drawback though: it's up to you to avoid 
duplicte usernames like the ones above. If there's already an account 
pmuster for user Peter Muster a new import with the same uid will throw 
an error.

Examples for csv file entries:

(Users Özil Muster, Petra Mühe, Peter Mühe)

omuster,Muster,Özil,secret1
pmuehe,Mühe,Petra,secret2
pmuehe1,Mühe,Peter,seret3

One could generate the (ascii) uid using a spreadsheet.

Maybe that I should add this csv example to the manual.

Wolfgang

Attachment: signature.asc
Description: Digital signature

Reply via email to