mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-24 10:14:31 +01:00
Added extended Uid function
This commit is contained in:
parent
b6cba42b85
commit
dcd7162ca9
@ -7,16 +7,26 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
function normalizeName(name) {
|
||||||
|
return removeDiacritics(name).toLowerCase().replace(/[^a-z]/g, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
function lcUidExt(firstname, lastname, firstnameEnd, lastnameEnd){
|
||||||
|
return normalizeName(firstname).substring(0, parseInt(firstnameEnd))+normalizeName(lastname).substring(0,parseInt(lastnameEnd));
|
||||||
|
}
|
||||||
|
|
||||||
function lcUid(firstname, lastname){
|
function lcUid(firstname, lastname){
|
||||||
var ascii_firstname = removeDiacritics(firstname).toLowerCase().replace(/[^a-z]/g, '');
|
return lcUidExt(firstname, lastname, 0, 7);
|
||||||
var ascii_lastname = removeDiacritics(lastname).toLowerCase().replace(/[^a-z]/g, '');
|
|
||||||
return ascii_firstname.charAt(0)+ascii_lastname.substring(0,7);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function lcDisplayName(firstname, lastname){
|
function lcDisplayName(firstname, lastname){
|
||||||
return firstname+' '+lastname;
|
return firstname+' '+lastname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function lcMailExt(firstname, lastname, domain, firstnameEnd, lastnameEnd){
|
||||||
|
return lcUidExt(firstname, lastname, firstnameEnd, lastnameEnd)+domain;
|
||||||
|
}
|
||||||
|
|
||||||
function lcMail(firstname, lastname, domain){
|
function lcMail(firstname, lastname, domain){
|
||||||
return lcUid(firstname, lastname)+domain;
|
return lcUid(firstname, lastname)+domain;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user