using LDAP

15 years 2 months ago #86372 by yellowdog
Replied by yellowdog on topic Re:using LDAP
Hi all

Thanks for the quick response!
We've answered point one and looking at the db,image enclosed i'd say yes to number two as well.
Attachments:

Please Log in to join the conversation.

15 years 2 months ago #86373 by beat
Replied by beat on topic Re:using LDAP
Ok, that one seems clear.

Will add name separation into first/middle/last depending on CB config :)

Now i'm puzzled about the confirmation of user needed.

Could you please show screendump of backend users-list for such an entry (i'm interested in the icons shown for enabled, confirmed and approved).

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in to join the conversation.

15 years 2 months ago #86374 by interactivar
Replied by interactivar on topic Re:using LDAP
Thanks Yellowdog and Beat!

1) If your name field mode is only 1 field, does name save too ?

I did that, I will give you feedback later, can't do a test now

2) if you use joomla login module, does the name transfer correctly into the name field (single in joomla) (column name of jos_users) ?

In fact I can only get the joomla login module working with LDAP. I couldn't get LDAP working with the cb login! It seems to be allright with the joomla login to me. Is there any disadvantage in using the joomla standard login with cb 1.2 rc4?

Please Log in to join the conversation.

15 years 2 months ago #86376 by yellowdog
Replied by yellowdog on topic Re:using LDAP
I'm using the standard Authentication - LDAP plugin to connect to my AD.
I set the Allow User Regsitration in the Registration tab to 'same as global...'
Here is my screen dump.

The Simone Collobiano is set as not confirmed.
If I go into that users settings I see that the confirm user field is set to yes but until i enter and save the user, CB doen't see the user as confirmed.

Post edited by: yellowdog, at: 2009/01/23 17:35
Attachments:

Please Log in to join the conversation.

15 years 2 months ago #86377 by yellowdog
Replied by yellowdog on topic Re:using LDAP

Attachment Archive-564d1bc872f425ba1fcb921b9a8348ec.zip not found


Post edited by: yellowdog, at: 2009/01/23 17:36

Post edited by: yellowdog, at: 2009/01/23 17:36
Attachments:

Please Log in to join the conversation.

15 years 2 months ago #86388 by beat
Replied by beat on topic Re:using LDAP
Ok, here something to test for the splitting of name into first/last:

Add that function at end of administrator/components/com_comprofiler/comprofiler.class.php:
[code:1]
function cbSplitSingleName( &$user ) {
global $ueConfig;

switch ( $ueConfig ) {
case 2:
// firstname + lastname:
$posLname = strrpos( $user->name, ' ' );
if ( $posLname !== false ) {
$user->firstname = substr( $user->name, 0, $posLname );
$user->lastname = substr( $user->name, $posLname + 1 );
} else {
$user->firstname = '';
$user->lastname = $user->name;
}
break;
case 3:
// firstname + middlename + lastname:
$posMname = strpos( $user->name, ' ' );
$posLname = strrpos( $user->name, ' ' );
if ( $posLname !== false ) {
$user->lastname = substr( $user->name, $posLname + 1 );
$user->firstname = substr( $user->name, 0, $posMname );
if ( $posMname !== $posLname ) {
$user->middlename = substr( $user->name, $posMname + 1, $posLname - $posMname -1 );
} else {
$user->middlename = '';
}
} else {
$user->firstname = '';
$user->lastname = $user->name;
}
break;
default:
// name only: nothing to do !
break;
}
}

[/code:1]

Then open components/com_comprofiler/comprofiler.php :

Search for function login

and in that function search for:
[code:1]
$foundUser = $row->loadByUsername( stripslashes( $username ) );
$row->confirmed = 1;
$row->approved = 1;
$row->store(); // synchronizes with comprofiler table
$loggedIn = true;
[/code:1]

and add a call to that function as follows there:

[code:1]
$foundUser = $row->loadByUsername( stripslashes( $username ) );
cbSplitSingleName( $row );
$row->confirmed = 1;
$row->approved = 1;
$row->store(); // synchronizes with comprofiler table
$loggedIn = true;
[/code:1]

That should solve the name-splitting issue.

Please test this and confirm back fix in next hours. Thanks.

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.260 seconds