Comparing revisions for LDAPauthentication

Additions:
- Documentation: LDAPauthenticationInfo
- Wikka 1.1.6.3
- Add the two code blocks below to ##actions/usersettings.php##
- Add the three lines below to ##wikka.config.php##
- Make sure PHP is compiled with [[http://php.net/manual/en/ref.ldap.php LDAP support]]
1. In ##actions/usersettings.php##, go to line 82 and replace the following code block:
%%(php)
%%
%%(php)
return strtolower($name);
$success = false;
if ($ldapconn = ldap_connect($LDAPserver))
{
// put here any LDAP option you may want to set
//ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);
if ($result = ldap_bind($ldapconn, sprintf($LDAPreq, LDAP_wikiname_to_login($login)), $pwd))
{
$success = true;
}
ldap_close($ldapconn);
}
return $success;
2. Go to line 389 and replace the following code block:
%%(php)
case (strlen($_POST['password']) == 0):
$error = ERROR_EMPTY_PASSWORD;
$password_highlight = INPUT_ERROR_STYLE;
break;
case (md5($_POST['password']) != $existingUser['password']):
%%
%%(php)
case (strlen($_POST['password']) == 0):
$error = ERROR_EMPTY_PASSWORD;
$password_highlight = INPUT_ERROR_STYLE;
break;
case (isset($this->config['user_identification']) && ($this->config['user_identification']=='ldap') && LDAP_auth($this->config['ldap_server'], $this->config['ldap_name'], $_POST['name'], $_POST['password'])):
// authenticated by the LDAP directory
$this->SetUser($existingUser);
$this->Redirect($url, '');
break;
case (md5($_POST['password']) != $existingUser['password']):
3. Add the following lines (with the appropriate values for lines 2 and 3) to ##wikka.config.php##:
%%(php)
'user_identification' => 'ldap',
'ldap_server' => 'myldapserver',
'ldap_name' => '%s',
%%
Deletions:
- Documentation: LDAPauthenticationInfo
- Wikka 1.1.6.3 & 1.1.6.4 & 1.1.6.5
- Add the two code blocks below to ##actions/usersettings.php##
- Add the three lines below to ##wikka.config.php##
- Make sure PHP is compiled with [[http://php.net/manual/en/ref.ldap.php LDAP support]]
1. In ##actions/usersettings.php##, go to line 82 [version 1.1.6.3 only] or 100 [versions 1.1.6.4 & 1.1.6.5 only] and replace the following code block:
%%(php)
%%(php)
return strtolower($name);
$success = false;
if ($ldapconn = ldap_connect($LDAPserver))
// put here any LDAP option you may want to set
//ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);
if ($result = ldap_bind($ldapconn, sprintf($LDAPreq, LDAP_wikiname_to_login($login)), $pwd))
$success = true;
ldap_close($ldapconn);
return $success;
2. Go to line 389 [version 1.1.6.3 only] or 417 [versions 1.1.6.4 & 1.1.6.5 only] and replace the following code block:
%%(php)
case (strlen($_POST['password']) == 0):
$error = ERROR_EMPTY_PASSWORD;
$password_highlight = INPUT_ERROR_STYLE;
break;
case (md5($_POST['password']) != $existingUser['password']):
%%(php)
case (strlen($_POST['password']) == 0):
$error = ERROR_EMPTY_PASSWORD;
$password_highlight = INPUT_ERROR_STYLE;
break;
case (isset($this->config['user_identification']) && ($this->config['user_identification']=='ldap') && LDAP_auth($this->config['ldap_server'], $this->config['ldap_name'], $_POST['name'], $_POST['password'])):
// authenticated by the LDAP directory
$this->SetUser($existingUser);
$this->Redirect($url, '');
break;
case (md5($_POST['password']) != $existingUser['password']):
3. Add the following lines (with the appropriate values for the second and third lines) to ##wikka.config.php##:
%%(php)
'user_identification' => 'ldap',
'ldap_server' => 'myldapserver',
'ldap_name' => '%s',
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki