• timkite

    (@timkite)


    It’s actually quite easy to support alternate LDAP ports with SSL enabled, even with PHP working the way it does. Just change this code:

    if (strstr($dc, ':')) list($dc, $port) = explode(':', $dc);
    
    switch($enableSsl){
    	case 1:
    		$connection = ldap_connect($protocol.$dc);
    		break;
    	case 2:
    	case 0:
    	default:
    		if(isset($port)){
    			$connection = ldap_connect($dc,$port);
    		} else {
    			$connection = ldap_connect($dc);
    		}
    		break;
    
    }

    To this:

    if (strstr($dc, ':')) list($dc, $port) = explode(':', $dc);
    
    switch($enableSsl){
    	case 1:
    		if(isset($port)){
    			$connection = ldap_connect($protocol.$dc.':'.$port);
    		} else {
    			$connection = ldap_connect($protocol.$dc);
    		}
    		break;
    	case 2:
    	case 0:
    	default:
    		if(isset($port)){
    			$connection = ldap_connect($dc,$port);
    		} else {
    			$connection = ldap_connect($dc);
    		}
    		break;
    
    }

    I make this modification to this plugin every time I download an update to it. It works quite well (our LDAPS port is 10636).

    Maybe consider including this modification into the official source (and removing the note later on about alternate ports not working)?

    https://www.ads-software.com/plugins/wpdirauth/

Viewing 1 replies (of 1 total)
  • Plugin Author Paul Gilzow

    (@gilzow)

    I *know* this is a year late, but if you’re still using this plugin, and still have the same set up, I’d love to send you some test code to verify it works as you expect, and then will incorporate it into the official code.

Viewing 1 replies (of 1 total)
  • The topic ‘SSL and Alternate Ports’ is closed to new replies.