From b1bae55cbe406b2256164a000fd5aef631c17747 Mon Sep 17 00:00:00 2001 From: Thijs Kinkhorst <thijs@kinkhorst.com> Date: Wed, 27 May 2015 09:26:22 +0000 Subject: [PATCH] Since PHP 5.3 is required, there's no need to treat users of 5.1.2-5.2 specially. Also we can safely use LDAP_OPT_NETWORK_TIMEOUT now. --- lib/SimpleSAML/Auth/LDAP.php | 7 ++----- modules/core/hooks/hook_sanitycheck.php | 2 -- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/SimpleSAML/Auth/LDAP.php b/lib/SimpleSAML/Auth/LDAP.php index db95377c4..efde8b916 100644 --- a/lib/SimpleSAML/Auth/LDAP.php +++ b/lib/SimpleSAML/Auth/LDAP.php @@ -90,11 +90,8 @@ class SimpleSAML_Auth_LDAP { // (OpenLDAP 2.x.x or Netscape Directory SDK x.x needed). $this->timeout = $timeout; if ($timeout > 0) { - if (defined('LDAP_OPT_NETWORK_TIMEOUT')) { - /* This option isn't present before PHP 5.3. */ - if (!@ldap_set_option($this->ldap, constant('LDAP_OPT_NETWORK_TIMEOUT'), $timeout)) - SimpleSAML_Logger::warning('Library - LDAP __construct(): Unable to set timeouts (LDAP_OPT_NETWORK_TIMEOUT) to ' . $timeout); - } + if (!@ldap_set_option($this->ldap, LDAP_OPT_NETWORK_TIMEOUT, $timeout)) + SimpleSAML_Logger::warning('Library - LDAP __construct(): Unable to set timeouts (LDAP_OPT_NETWORK_TIMEOUT) to ' . $timeout); if (!@ldap_set_option($this->ldap, LDAP_OPT_TIMELIMIT, $timeout)) SimpleSAML_Logger::warning('Library - LDAP __construct(): Unable to set timeouts (LDAP_OPT_TIMELIMIT) to ' . $timeout); } diff --git a/modules/core/hooks/hook_sanitycheck.php b/modules/core/hooks/hook_sanitycheck.php index b0848d3fc..24e0f812d 100644 --- a/modules/core/hooks/hook_sanitycheck.php +++ b/modules/core/hooks/hook_sanitycheck.php @@ -25,8 +25,6 @@ function core_hook_sanitycheck(&$hookinfo) { if (version_compare(phpversion(), '5.3', '>=')) { $hookinfo['info'][] = '[core] You are running PHP version ' . phpversion() . '. Great.'; - } elseif( version_compare(phpversion(), '5.1.2', '>=')) { - $hookinfo['info'][] = '[core] You are running PHP version ' . phpversion() . '. It\'s recommended to upgrade to >= 5.2'; } else { $hookinfo['errors'][] = '[core] You are running PHP version ' . phpversion() . '. SimpleSAMLphp requires version >= 5.3. Please upgrade!'; } -- GitLab