Version check fixes.
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 23 Jan 2003 20:50:22 +0000 (20:50 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 23 Jan 2003 20:50:22 +0000 (20:50 +0000)
1) the required version is minimum 4.0.4 so the 4.0.2 check is always passed.
2) make the check in prefs.php also work when new php versions are released %-)

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4459 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/abook_ldap_server.php
functions/prefs.php

index 75a3105c243fd2e0bd1376b1b2f00c632adb47b0..191431482bc61643a2fa61e1133bc0a2872d8f25 100644 (file)
@@ -157,18 +157,10 @@ class abook_ldap_server extends addressbook_backend {
             return false;
         }
   
-        /* Do the search. Use improved ldap_search() if PHP version is
-         * 4.0.2 or newer. */
-        if(sqCheckPHPVersion(4, 0, 2)) {
-            $sret = @ldap_search($this->linkid, $this->basedn, $expression,
-                array('dn', 'o', 'ou', 'sn', 'givenname', 
-                'cn', 'mail', 'telephonenumber'),
-                0, $this->maxrows, $this->timeout);
-        } else {
-            $sret = @ldap_search($this->linkid, $this->basedn, $expression,
-                array('dn', 'o', 'ou', 'sn', 'givenname', 
-                'cn', 'mail', 'telephonenumber'));
-        }
+        $sret = @ldap_search($this->linkid, $this->basedn, $expression,
+            array('dn', 'o', 'ou', 'sn', 'givenname', 
+            'cn', 'mail', 'telephonenumber'),
+            0, $this->maxrows, $this->timeout);
   
         /* Should get error from server using the ldap_error() function,
          * but it only exist in the PHP LDAP documentation. */
@@ -264,4 +256,4 @@ class abook_ldap_server extends addressbook_backend {
      *
      * Careful with this -- it could get quite large for big sites. */
 }
-?>
\ No newline at end of file
+?>
index 47e854f2cd72dcb13f1bc7cd680b35812bf1e06b..9b35834aa3d52ac71fee3cedada912c03077b09f 100644 (file)
@@ -18,12 +18,13 @@ sqgetGlobalVar('prefs_are_cached', $prefs_are_cached, SQ_SESSION );
 
 $rg = ini_get('register_globals');
 
+/* if php version >= 4.1 OR (4.0 AND $rg = off) */
 if ( !sqsession_is_registered('prefs_are_cached') ||
      !isset( $prefs_cache) ||
      !is_array( $prefs_cache) ||
-     substr( phpversion(), 0, 3 ) == '4.1' ||
-     substr( phpversion(), 0, 3 ) == '4.2' ||
-     (substr( phpversion(), 0, 3 ) == '4.0' && empty($rg))) {
+     check_php_version(4,1) ||
+     empty($rg)
+   ) {
     $prefs_are_cached = false;
     $prefs_cache = array();
 }