Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ PLG_LDAP_FIELD_HOST_DESC="Eg: openldap.example.com."
PLG_LDAP_FIELD_HOST_LABEL="Host"
PLG_LDAP_FIELD_NEGOCIATE_DESC="Negotiate TLS encryption with the LDAP server. This requires all traffic to and from the LDAP server to be encrypted."
PLG_LDAP_FIELD_NEGOCIATE_LABEL="Negotiate TLS"
PLG_LDAP_FIELD_LDAPDEBUG_DESC="Enables debug hardcoded to level 7"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sort keys in alpha order.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the first? request for this feature ;-) so properly the first position is not perfect....

I would suggest moving debug to the last option and the tls thing before debug.

I moved the debug option to last but the Ignore certificate is closely connected to enabling TLS and thus should be the next option.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should still be sorted in alpha order.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check the file after last nights commit 224ec41, the file is in order.

PLG_LDAP_FIELD_LDAPDEBUG_LABEL="Debug"
PLG_LDAP_FIELD_REQCERT_DESC="When enabled ignore the server certificate, this is useful when running for example Samba 4 with a self-signed certificate."
PLG_LDAP_FIELD_REQCERT_LABEL="Ignore Certificate"
PLG_LDAP_FIELD_PASSWORD_DESC="The Connect Password is the password of an administrative account. This is used in Authenticate then Bind and Authenticated Compare authorisation methods."
PLG_LDAP_FIELD_PASSWORD_LABEL="Connect Password"
PLG_LDAP_FIELD_PORT_DESC="Default port is 389."
Expand Down
26 changes: 26 additions & 0 deletions libraries/vendor/joomla/ldap/src/LdapClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,22 @@ class LdapClient
*/
public $negotiate_tls = null;

/**
* Ignore TLS Certificate (encrypted communications)
*
* @var boolean
* @since 1.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @since 1.0
* @since __DEPLOY_VERSION__

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

*/
public $ignore_reqcert_tls = null;

/**
* Enable LDAP debug (encrypted communications)
*
* @var boolean
* @since 1.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @since 1.0
* @since __DEPLOY_VERSION__

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

*/
public $ldap_debug = null;

/**
* Username to connect to server
*
Expand Down Expand Up @@ -180,6 +196,16 @@ public function connect()
return false;
}

if ($this->ignore_reqcert_tls)
{
putenv('LDAPTLS_REQCERT=never');
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove tabs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the spaces.
Hmm, emacs acting up. php-mode seems to default to PEAR-style. Which uses spaces.

if ($this->ldap_debug)
{
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
}

$this->resource = ldap_connect($this->host, $this->port);

if (!$this->resource)
Expand Down
26 changes: 26 additions & 0 deletions plugins/authentication/ldap/ldap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@
<config>
<fields name="params">
<fieldset name="basic">
<field
name="ldap_debug"
type="radio"
label="PLG_LDAP_FIELD_LDAPDEBUG_LABEL"
description="PLG_LDAP_FIELD_LDAPDEBUG_DESC"
default="0"
filter="integer"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>

<field
name="host"
type="text"
Expand Down Expand Up @@ -67,6 +80,19 @@
<option value="0">JNO</option>
</field>

<field
name="ignore_reqcert_tls"
type="radio"
label="PLG_LDAP_FIELD_REQCERT_LABEL"
description="PLG_LDAP_FIELD_REQCERT_DESC"
default="0"
filter="integer"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>

<field
name="no_referrals"
type="radio"
Expand Down