From: <var...@us...> - 2014-10-03 13:46:41
|
Revision: 9166 http://sourceforge.net/p/phpwiki/code/9166 Author: vargenau Date: 2014-10-03 13:46:33 +0000 (Fri, 03 Oct 2014) Log Message: ----------- function ldap_connect exists Modified Paths: -------------- trunk/configurator.php trunk/lib/WikiGroup.php trunk/lib/WikiUser.php trunk/lib/plugin/LdapSearch.php Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2014-10-03 13:37:54 UTC (rev 9165) +++ trunk/configurator.php 2014-10-03 13:46:33 UTC (rev 9166) @@ -1128,106 +1128,57 @@ $properties["DBAUTH_USER_GROUPS"] = new _define_optional('DBAUTH_USER_GROUPS', "SELECT group FROM user WHERE user='\$userid'", ""); -if (function_exists('ldap_connect')) { - - $properties["LDAP AUTH Host"] = - new _define_optional('LDAP_AUTH_HOST', "ldap://localhost:389", " +$properties["LDAP AUTH Host"] = + new _define_optional('LDAP_AUTH_HOST', "ldap://localhost:389", " If USER_AUTH_ORDER contains Ldap: The LDAP server to connect to. Can either be a hostname, or a complete URL to the server (useful if you want to use ldaps or specify a different port number)."); - $properties["LDAP BASE DN"] = - new _define_optional('LDAP_BASE_DN', "ou=mycompany.com,o=My Company", " +$properties["LDAP BASE DN"] = + new _define_optional('LDAP_BASE_DN', "ou=mycompany.com,o=My Company", " The organizational or domain BASE DN: e.g. \"dc=mydomain,dc=com\". Note: ou=Users and ou=Groups are used for GroupLdap Membership Better use LDAP_OU_USERS and LDAP_OU_GROUP with GROUP_METHOD=LDAP."); - $properties["LDAP SET OPTION"] = - new _define_optional('LDAP_SET_OPTION', "LDAP_OPT_PROTOCOL_VERSION=3:LDAP_OPT_REFERRALS=0", " +$properties["LDAP SET OPTION"] = + new _define_optional('LDAP_SET_OPTION', "LDAP_OPT_PROTOCOL_VERSION=3:LDAP_OPT_REFERRALS=0", " Some LDAP servers need some more options, such as the Windows Active Directory Server. Specify the options (as allowed by the PHP LDAP module) and their values as NAME=value pairs separated by colons."); - $properties["LDAP AUTH USER"] = - new _define_optional('LDAP_AUTH_USER', "CN=ldapuser,ou=Users,o=Development,dc=mycompany.com", " +$properties["LDAP AUTH USER"] = + new _define_optional('LDAP_AUTH_USER', "CN=ldapuser,ou=Users,o=Development,dc=mycompany.com", " DN to initially bind to the LDAP server as. This is needed if the server doesn't allow anonymous queries. (Windows Active Directory Server)"); - $properties["LDAP AUTH PASSWORD"] = - new _define_optional('LDAP_AUTH_PASSWORD', "secret", " +$properties["LDAP AUTH PASSWORD"] = + new _define_optional('LDAP_AUTH_PASSWORD', "secret", " Password to use to initially bind to the LDAP server, as the DN specified in the LDAP_AUTH_USER option (above)."); - $properties["LDAP SEARCH FIELD"] = - new _define_optional('LDAP_SEARCH_FIELD', "uid", " +$properties["LDAP SEARCH FIELD"] = + new _define_optional('LDAP_SEARCH_FIELD', "uid", " If you want to match usernames against an attribute other than uid, specify it here. Default: uid e.g.: LDAP_SEARCH_FIELD = sAMAccountName"); - $properties["LDAP OU USERS"] = - new _define_optional('LDAP_OU_USERS', "ou=Users", " +$properties["LDAP OU USERS"] = + new _define_optional('LDAP_OU_USERS', "ou=Users", " If you have an organizational unit for all users, define it here. This narrows the search, and is needed for LDAP group membership (if GROUP_METHOD=LDAP) Default: ou=Users"); - $properties["LDAP OU GROUP"] = - new _define_optional('LDAP_OU_GROUP', "ou=Groups", " +$properties["LDAP OU GROUP"] = + new _define_optional('LDAP_OU_GROUP', "ou=Groups", " If you have an organizational unit for all groups, define it here. This narrows the search, and is needed for LDAP group membership (if GROUP_METHOD=LDAP) The entries in this ou must have a gidNumber and cn attribute. Default: ou=Groups"); -} else { // function_exists('ldap_connect') - - $properties["LDAP Authentication"] = - new unchangeable_variable('LDAP Authentication', " -; If USER_AUTH_ORDER contains Ldap: -; -; The LDAP server to connect to. Can either be a hostname, or a complete -; URL to the server (useful if you want to use ldaps or specify a different -; port number). -;LDAP_AUTH_HOST = \"ldap://localhost:389\" -; -; The organizational or domain BASE DN: e.g. \"dc=mydomain,dc=com\". -; -; Note: ou=Users and ou=Groups are used for GroupLdap Membership -; Better use LDAP_OU_USERS and LDAP_OU_GROUP with GROUP_METHOD=LDAP. -;LDAP_BASE_DN = \"ou=Users,o=Development,dc=mycompany.com\" - -; Some LDAP servers need some more options, such as the Windows Active -; Directory Server. Specify the options (as allowed by the PHP LDAP module) -; and their values as NAME=value pairs separated by colons. -; LDAP_SET_OPTION = \"LDAP_OPT_PROTOCOL_VERSION=3:LDAP_OPT_REFERRALS=0\" - -; DN to initially bind to the LDAP server as. This is needed if the server doesn't -; allow anonymous queries. (Windows Active Directory Server) -; LDAP_AUTH_USER = \"CN=ldapuser,ou=Users,o=Development,dc=mycompany.com\" - -; Password to use to initially bind to the LDAP server, as the DN -; specified in the LDAP_AUTH_USER option (above). -; LDAP_AUTH_PASSWORD = secret - -; If you want to match usernames against an attribute other than uid, -; specify it here. Default: uid -; LDAP_SEARCH_FIELD = sAMAccountName - -; If you have an organizational unit for all users, define it here. -; This narrows the search, and is needed for LDAP group membership (if GROUP_METHOD=LDAP) -; Default: ou=Users -; LDAP_OU_USERS = ou=Users - -; If you have an organizational unit for all groups, define it here. -; This narrows the search, and is needed for LDAP group membership (if GROUP_METHOD=LDAP) -; The entries in this ou must have a gidNumber and cn attribute. -; Default: ou=Groups -; LDAP_OU_GROUP = ou=Groups", " -; Ignored. No LDAP support in this php. configure --with-ldap"); -} - if (function_exists('imap_open')) { $properties["IMAP Auth Host"] = Modified: trunk/lib/WikiGroup.php =================================================================== --- trunk/lib/WikiGroup.php 2014-10-03 13:37:54 UTC (rev 9165) +++ trunk/lib/WikiGroup.php 2014-10-03 13:46:33 UTC (rev 9166) @@ -963,16 +963,6 @@ E_USER_WARNING); return; } - // We should ignore multithreaded environments, not generally windows. - // CGI does work. - if (!function_exists('ldap_connect') and (!isWindows() or isCGI())) { - // on MacOSX >= 4.3 you'll need PHP_SHLIB_SUFFIX instead. - dl("ldap" . defined('PHP_SHLIB_SUFFIX') ? PHP_SHLIB_SUFFIX : DLL_EXT); - if (!function_exists('ldap_connect')) { - trigger_error(_("No LDAP in this PHP version"), E_USER_WARNING); - return; - } - } if (!defined("LDAP_BASE_DN")) define("LDAP_BASE_DN", ''); $this->base_dn = LDAP_BASE_DN; Modified: trunk/lib/WikiUser.php =================================================================== --- trunk/lib/WikiUser.php 2014-10-03 13:37:54 UTC (rev 9165) +++ trunk/lib/WikiUser.php 2014-10-03 13:46:33 UTC (rev 9166) @@ -1008,8 +1008,7 @@ ) { return new _DbPassUser($UserName, $this->_prefs); } elseif (in_array('LDAP', $dbh->getAuthParam('USER_AUTH_ORDER')) and - defined('LDAP_AUTH_HOST') and defined('LDAP_BASE_DN') and - function_exists('ldap_connect') + defined('LDAP_AUTH_HOST') and defined('LDAP_BASE_DN') ) { include_once 'lib/WikiUser/LDAP.php'; return new _LDAPPassUser($UserName, $this->_prefs); Modified: trunk/lib/plugin/LdapSearch.php =================================================================== --- trunk/lib/plugin/LdapSearch.php 2014-10-03 13:37:54 UTC (rev 9165) +++ trunk/lib/plugin/LdapSearch.php 2014-10-03 13:46:33 UTC (rev 9166) @@ -67,8 +67,6 @@ ); } - // I ought to require the ldap extension, but fail sanely, if I cant get it. - // - however at the moment this seems to work as is /** * @param WikiDB $dbi * @param string $argstr @@ -78,10 +76,6 @@ */ function run($dbi, $argstr, &$request, $basepage) { - if (!function_exists('ldap_connect')) { - if (!loadPhpExtension('ldap')) - return $this->error(_("Missing ldap extension")); - } $args = $this->getArgs($argstr, $request); extract($args); //include_once("lib/WikiUser/LDAP.php"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |