I am hoping to add to the login process a query for FName & LName...hawkbat05 wrote:Or if you want it to query LDAP at every login you'd want to add it after the email address check.
Code: Select all
<b><a href={postrow.U_PROFILE}><span style="color: {postrow.POST_AUTHOR_COLOUR}">{postrow.PROFILE_REALNAME_VALUE}</span></a></b>
Code: Select all
<b><a href={memberrow.U_VIEW_PROFILE}>{memberrow.PROFILE_REALNAME_VALUE}</a></b>
Code: Select all
$search = @ldap_search(
$ldap,
$config['ldap_base_dn'],
ldap_user_filter($username),
(empty($config['ldap_email'])) ? array($config['ldap_uid']) : array($config['ldap_uid'], $config['ldap_email']),
0,
1
);
Code: Select all
$search = @ldap_search(
$ldap,
$config['ldap_base_dn'],
ldap_user_filter($username),
(empty($config['ldap_email'])) ? array($config['ldap_uid'], $config['ldap_email'], 'displayName'),
0,
1
);
Code: Select all
$sql ='SELECT user_id, username, user_password, user_passchg, user_email, user_type
Code: Select all
$sql ='SELECT user_id, username, user_password, user_passchg, user_email, user_type, user_from
Code: Select all
$ldap_user_row = array(
'username' => $username,
'user_password' => phpbb_hash($password),
'user_email' => (!empty($config['ldap_email'])) ? $ldap_result[0][$config['ldap_email']][0] : '',
'group_id' => (int) $row['group_id'],
'user_type' => USER_NORMAL,
'user_ip' => $user->ip,
);
Code: Select all
$ldap_user_row = array(
'username' => $username,
'user_password' => phpbb_hash($password),
'user_email' => (!empty($config['ldap_email'])) ? $ldap_result[0][$config['ldap_email']][0] : '',
'group_id' => (int) $row['group_id'],
'user_type' => USER_NORMAL,
'user_ip' => $user->ip,
'user_from' => $ldap_result[0]['displayname'][0],
);
Code: Select all
if ($guest_username === false)
{
$username = ($username) ? $username : $user->lang['GUEST'];
}
Code: Select all
if ($guest_username === false)
{
$sql = "SELECT * FROM `phpbb_users` WHERE `user_id` = '" . $user_id . "'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$username = $row['user_from'];
$db->sql_freeresult($result);
}
Code: Select all
'POST_AUTHOR_FULL' => get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
Code: Select all
$postrow = array(
'POST_AUTHOR_FULL' => $user_cache[$poster_id]['from'],
Code: Select all
'LOCATION' => 'Location',
Code: Select all
'LOCATION' => 'Full Name',
I'm having a problem with this. I get the following error:paul_manning22 wrote:
File:- /includes/auth/auth_ldap.php
OriginalChanged To:Code: Select all
$search = @ldap_search( $ldap, $config['ldap_base_dn'], ldap_user_filter($username), (empty($config['ldap_email'])) ? array($config['ldap_uid']) : array($config['ldap_uid'], $config['ldap_email']), 0, 1 );
<-- snip -->Code: Select all
$search = @ldap_search( $ldap, $config['ldap_base_dn'], ldap_user_filter($username), >>>>>(empty($config['ldap_email'])) ? array($config['ldap_uid'], $config['ldap_email'], 'displayName'), 0, 1 );
The line marked by >>>>> is the line in question. Any ideas?Parse error: syntax error, unexpected ',' in /www/docs/forum/includes/auth/auth_ldap.php on line 165
Code: Select all
$search = @ldap_search(
$ldap,
$config['ldap_base_dn'],
ldap_user_filter($username),
(empty($config['ldap_email'])) ? array($config['ldap_uid']) : array($config['ldap_uid'], $config['ldap_email']),
0,
1
);
Code: Select all
$search = @ldap_search(
$ldap,
$config['ldap_base_dn'],
ldap_user_filter($username),
(empty($config['ldap_email'])) ? array($config['ldap_uid']) : array($config['ldap_uid'], $config['ldap_email'], 'displayName'),
0,
1
);
Code: Select all
$sql ='SELECT user_id, username, user_password, user_passchg, user_email, user_type
Code: Select all
$sql ='SELECT user_id, username, user_password, user_passchg, user_email, user_type, user_from
Code: Select all
$ldap_user_row = array(
'username' => $username,
'user_password' => phpbb_hash($password),
'user_email' => (!empty($config['ldap_email'])) ? $ldap_result[0][$config['ldap_email']][0] : '',
'group_id' => (int) $row['group_id'],
'user_type' => USER_NORMAL,
'user_ip' => $user->ip,
);
Code: Select all
$ldap_user_row = array(
'username' => $username,
'user_password' => phpbb_hash($password),
'user_email' => (!empty($config['ldap_email'])) ? $ldap_result[0][$config['ldap_email']][0] : '',
'group_id' => (int) $row['group_id'],
'user_type' => USER_NORMAL,
'user_ip' => $user->ip,
'user_from' => $ldap_result[0]['displayname'][0],
);
Code: Select all
global $phpbb_root_path, $phpEx, $user, $auth;
Code: Select all
global $phpbb_root_path, $phpEx, $user, $auth, $db;
Code: Select all
if ($guest_username === false)
{
$username = ($username) ? $username : $user->lang['GUEST'];
}
Code: Select all
if ($guest_username === false)
{
$sql = "SELECT * FROM `phpbb_users` WHERE `user_id` = '" . $user_id . "'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$username = ($row['user_from']) ? $row['user_from'] : $username;
$db->sql_freeresult($result);
}
Code: Select all
$postrow = array(
'POST_AUTHOR_FULL' => get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
Code: Select all
$postrow = array(
'POST_AUTHOR_FULL' => get_username_string('full', $poster_id, $user_cache[$poster_id]['from'], $row['user_colour'], $row['post_username']),
Code: Select all
'LOCATION' => 'Location',
Code: Select all
'LOCATION' => 'Full Name',