diff -Nru phpBB3/includes/auth/auth_ldap.php phpBB3-devel/includes/auth/auth_ldap.php
--- phpBB3/includes/auth/auth_ldap.php  2007-07-28 18:48:11.000000000 +0200
+++ phpBB3-devel/includes/auth/auth_ldap.php    2007-08-23 17:52:36.000000000 +0200
@@ -26,7 +26,7 @@
                return $user->lang['LDAP_NO_LDAP_EXTENSION'];
        }
 
-       if (!($ldap = @ldap_connect($config['ldap_server'])))
+       if (!($ldap = @ldap_connect($config['ldap_server'], $config['ldap_port'])))
        {
                return $user->lang['LDAP_NO_SERVER_CONNECTION'];
        }
@@ -91,7 +91,7 @@
                );
        }
 
-       if (!($ldap = @ldap_connect($config['ldap_server'])))
+       if (!($ldap = @ldap_connect($config['ldap_server'], $config['ldap_port'])))
        {
                return array(
                        'status'                => LOGIN_ERROR_EXTERNAL_AUTH,
@@ -238,6 +238,11 @@
                <dd><input type="text" id="ldap_server" size="40" name="config[ldap_server]" value="' . $new['ldap_server'] . '" /></dd>
        </dl>
        <dl>
+               <dt><label for="ldap_port">' . $user->lang['LDAP_PORT'] . ':</label><br /><span>' . $user->lang['LDAP_PORT_EXPLAIN'] . '</span></dt>
+               <dd><input type="text" id="ldap_server" size="40" name="config[ldap_port]" value="' . $new['ldap_port'] . '" /></dd>
+       </dl>
+
+       <dl>
                <dt><label for="ldap_user">' . $user->lang['LDAP_USER'] . ':</label><br /><span>' . $user->lang['LDAP_USER_EXPLAIN'] . '</span></dt>
                <dd><input type="text" id="ldap_user" size="40" name="config[ldap_user]" value="' . $new['ldap_user'] . '" /></dd>
        </dl>
@@ -262,8 +267,8 @@
        // These are fields required in the config table
        return array(
                'tpl'           => $tpl,
-               'config'        => array('ldap_server', 'ldap_user', 'ldap_password', 'ldap_base_dn', 'ldap_uid', 'ldap_email')
+               'config'        => array('ldap_server', 'ldap_port', 'ldap_user', 'ldap_password', 'ldap_base_dn', 'ldap_uid', 'ldap_email')
        );
 }
 
-?>
\ No newline at end of file
+?>
diff -Nru phpBB3/language/en/acp/board.php phpBB3-devel/language/en/acp/board.php
--- phpBB3/language/en/acp/board.php    2007-07-28 18:48:13.000000000 +0200
+++ phpBB3-devel/language/en/acp/board.php      2007-08-23 17:53:05.000000000 +0200
@@ -307,6 +307,8 @@
        'LDAP_PASSWORD_EXPLAIN'                 => 'Leave blank to use anonymous access. Else fill in the password for the above user. <strong>WARNING:</strong> This password will be stored as plain text in the database visible to everybody who can access your database.',
        'LDAP_SERVER'                                   => 'LDAP server name',
        'LDAP_SERVER_EXPLAIN'                   => 'If using LDAP this is the name or IP address of the server.',
+       'LDAP_PORT'                                     => 'LDAP server port (use 389 for default)',
+       'LDAP_PORT_EXPLAIN'                     => 'If using LDAP this is the port of the server.',
        'LDAP_UID'                                              => 'LDAP <var>uid</var>',
        'LDAP_UID_EXPLAIN'                              => 'This is the key under which to search for a given login identity, e.g. <var>uid</var>, <var>sn</var>, etc.',
        'LDAP_USER'                                             => 'LDAP user',
@@ -438,4 +440,4 @@
        'JAB_USERNAME_EXPLAIN'          => 'Specify a registered username. The username will not be checked for validity.',
 ));
 
-?>
\ No newline at end of file
+?>
