[TYPO3-english] RE : LDAP authenticate on Active Directory with email -> How to ?
Marc Heckmann
Marc.Heckmann at d-ploy.ch
Mon Jul 5 13:51:41 CEST 2010
Hi List,
I resolve my issue by doing following modification into : class.t3lib_userauth.php
At line 480 after :
// active login (eg. with login form)
if ($loginData['status']=='login') {
$activeLogin = TRUE;
I have write this new Line:
if (preg_match("/^[-_a-z0-9\'+*$^&%=~!?{}]++(?:\.[-_a-z0-9\'+*$^&%=~!?{}]+)*+@(?:(?![-.])[-a-z0-9.]+(?<![-.])\.[a-z]{2,6}|\d{1,3}(?:\.\d{1,3}){3})(?::\d++)?$/iD",$loginData['uname'])) {
$loginEmail = $this->getFeUsersUnameByEmail($loginData['uname']);
$loginData['uname'] = $loginEmail['username'];
}
Then I have create a new function after this one:
function getRawUserByName($name) {
$user = FALSE;
$dbres = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $this->user_table, 'username='.$GLOBALS['TYPO3_DB']->fullQuoteStr($name, $this->user_table).' '.$this->user_where_clause());
if ($dbres) {
$user = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($dbres);
$GLOBALS['TYPO3_DB']->sql_free_result($dbres);
}
return $user;
}
At Line 1392:
function getFeUsersUnameByEmail($email) {
$user = FALSE;
$dbres = $GLOBALS['TYPO3_DB']->exec_SELECTquery('username', $this->user_table, 'email='.$GLOBALS['TYPO3_DB']->fullQuoteStr($email, $this->user_table).' '.$this->user_where_clause());
if ($dbres) {
$user = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($dbres);
$GLOBALS['TYPO3_DB']->sql_free_result($dbres);
}
return $user;
}
This is my workarround to bring the possibility for Fe_User to login with email or username over LDAP (active directory or without ;)
Hope this could help You.
Regards,
Marc
-----Ursprüngliche Nachricht-----
Von: typo3-english-bounces at lists.typo3.org [mailto:typo3-english-bounces at lists.typo3.org] Im Auftrag von Marc Heckmann
Gesendet: Freitag, 2. Juli 2010 01:05
An: TYPO3 English
Betreff: [TYPO3-english] RE : LDAP authenticate on Active Directory with email -> How to ?
Hi List,
I use now eu_ldap with fe_login on typo3 to login with authentification on a LDAP server (Active Directory).
Now i would have:
I have one LDAP server (Active Directory) , standard Windows or Excange client could login with accountname or with email.
How could i do it on typo3 to login with fe_users username or email ?
Need help, thanks
Marc
________________________________________
De : typo3-english-bounces at lists.typo3.org [typo3-english-bounces at lists.typo3.org] de la part de Marc Heckmann [Marc.Heckmann at d-ploy.ch]
Date d'envoi : jeudi 1 juillet 2010 11:40
À : typo3-english at lists.typo3.org
Objet : [TYPO3-english] LDAP authenticate on Active Directory with email -> How to ?
Hello All,
Have somebody some information to do the necessary configuration or modification ?
Satus Now :
Used module -> fe_login + eu_ldap
Login is running now with user account (samaccountname) .
Active directory is configured to login with samaccountname and mail.
What and where must i modified to set that user could login in with email over fe_login and eu_ldap.
I have testing my first idea over a SQL Query like this -> Update "fe_users" Set "username"="mail"
But naturally login doesn't running and Ldap new import or update doesn't running now.
Has somebody an idea how to do it ?
Ldap server in storage look like before modification on email :
Port :389
Ldap version : 3
Base DN : OU=UserGroup,OU=User,DC=MyDomaine,DC=local
Filter : (&(objectClass=user)(objectCategory=person)(samaccountname=<search>))
Type of LDAP server : Active Directory (Domain\User)
Domain : MyDomain
Use this server for : Frontend only
LDAP attribute holding the displayed user name : samaccountname
Active Options :
use standard implementation to assign users to groups - person:memberOf (AD) / person:groupMembership (NDS) / posixGroup:memberUid (OpenLDAP)
import only users with filled email address
Import groups from LDAP
Kind Regards,
Marc
_______________________________________________
TYPO3-english mailing list
TYPO3-english at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
_______________________________________________
TYPO3-english mailing list
TYPO3-english at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
More information about the TYPO3-english
mailing list