ClearFoundation Tracker - ClearOS
View Issue Details
0000248ClearOSapp-users - User Managerpublic2011-03-18 00:022019-03-12 10:32
pazaan 
 
normalfeaturealways
closedsuspended 
5.2-SP1 
 
0000248: Templatable default e-mail address
Currently, a user's e-mail address will default to username@domain (see api/User.class.php).

I would like to be able to implement a system whereby this can be changed. My specific requirement would be to change:
$ldap_object['mail'] = $this->username . "@" . $this->ldaph->GetDefaultDomain();
to:
$ldap_object['mail'] = preg_replace( '/[ \t\n]*/', '', strtolower( $ldap_object['givenName'] . "." . $ldap_object['sn'] ) ) . "@" . $this->ldaph->GetDefaultDomain();
but obviously something more flexible would be good.

I'm happy to code up this and submit it, but I would like some design direction. The easiest is just to have a combo box somewhere (Directory->Setup->Organization?) that has a simple bunch of options:
- Username
- first.last (spaces removed)
- somethingelse

A more generic way to do it is to implement some kind of templating system based on available LDAP fields, but this would get a lot more complex (and bug prone).
No tags attached.
related to 0000251closed  Add user template 
Issue History
2011-03-18 00:02pazaanNew Issue
2011-03-18 10:32user2Assigned To => user2
2011-03-18 10:32user2Statusnew => confirmed
2011-03-18 10:32user2Target Version => 6.0
2011-03-18 10:40user2Note Added: 0000339
2011-03-18 10:47user2Relationship addedrelated to 0000251
2011-03-20 17:13pazaanNote Added: 0000340
2011-03-21 09:50user2Note Added: 0000341
2011-03-21 09:50user2Note Added: 0000342
2014-04-22 13:28user2Target Version6 Future => Future
2015-05-25 05:10user2Target VersionFuture =>
2018-12-14 12:11user2Statusconfirmed => assigned
2018-12-14 12:11user2Assigned Touser2 => tracker
2019-03-12 10:32NickHNote Added: 0010961
2019-03-12 10:32NickHStatusassigned => closed
2019-03-12 10:32NickHAssigned Totracker =>
2019-03-12 10:32NickHResolutionopen => suspended

Notes
(0000339)
user2   
2011-03-18 10:40   
This work is going on right now. The "mail" attribute is going to go back to be an editable field that should represent the user's primary e-mail address. Things like Kolab/Horde, Zarafa (?) and others latch on to "mail" and we need to get away from that if possible. If you tried changing the mail attribute on a 5.x system, there's a very good chance Horde/Kolab will break!

By the way, you will start to see more information on the LDAP design here:
http://www.clearfoundation.com/docs/developer/architecture/directory/ [^]
(0000340)
pazaan   
2011-03-20 17:13   
Right. We're using SOGo, so Horde/Kolab breaking is not an issue for us. Is there an acceptable workaround for 5.x?
(0000341)
user2   
2011-03-21 09:50   
Well... just changing the code as described in the bug report is a workaround. I don't think I would try to do much more than that on a 5.2 system. If a 5.3 is ever released, we can see what kind of backporting can be done from 6.0.
(0000342)
user2   
2011-03-21 09:50   
Well... just changing the code as described in the bug report is a workaround. I don't think I would try to do much more than that on a 5.2 system. If a 5.3 is ever released, we can see what kind of backporting can be done from 6.0.
(0010961)
NickH   
2019-03-12 10:32   
Migrated to: https://gitlab.com/clearos/clearfoundation/app-users/issues/5 [^]