From b59b72cc3028cc0514e951f135d8bfe7efcaaa6f Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 26 Feb 2015 18:04:03 +0100 Subject: Fix "Non-static method PEAR::isError() should not be called statically" errors (#1490281) --- plugins/password/drivers/ldap.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/password/drivers/ldap.php') diff --git a/plugins/password/drivers/ldap.php b/plugins/password/drivers/ldap.php index c18ff0f06..a11c38d17 100644 --- a/plugins/password/drivers/ldap.php +++ b/plugins/password/drivers/ldap.php @@ -75,7 +75,7 @@ class rcube_ldap_password $ldap = Net_LDAP2::connect($ldapConfig); // Checking for connection error - if (PEAR::isError($ldap)) { + if (is_a($ldap, 'PEAR_Error')) { return PASSWORD_CONNECT_ERROR; } @@ -176,7 +176,7 @@ class rcube_ldap_password $ldap = Net_LDAP2::connect($ldapConfig); - if (PEAR::isError($ldap)) { + if (is_a($ldap, 'PEAR_Error')) { return ''; } @@ -189,7 +189,7 @@ class rcube_ldap_password $result = $ldap->search($base, $filter, $options); $ldap->done(); - if (PEAR::isError($result) || ($result->count() != 1)) { + if (is_a($result, 'PEAR_Error') || ($result->count() != 1)) { return ''; } -- cgit v1.2.3 From e2fb34028980910e006f09b4fd93c4172f79b306 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Thu, 12 Mar 2015 09:59:47 +0100 Subject: Remove obsolete mt_srand() calls --- plugins/password/drivers/ldap.php | 3 --- program/lib/Roundcube/rcube_user.php | 1 - 2 files changed, 4 deletions(-) (limited to 'plugins/password/drivers/ldap.php') diff --git a/plugins/password/drivers/ldap.php b/plugins/password/drivers/ldap.php index a11c38d17..6ed5ada04 100644 --- a/plugins/password/drivers/ldap.php +++ b/plugins/password/drivers/ldap.php @@ -289,7 +289,6 @@ class rcube_ldap_password break; case 'ssha': - mt_srand((double) microtime() * 1000000); $salt = substr(pack('h*', md5(mt_rand())), 0, 8); if (function_exists('mhash') && function_exists('mhash_keygen_s2k')) { @@ -316,7 +315,6 @@ class rcube_ldap_password case 'smd5': - mt_srand((double) microtime() * 1000000); $salt = substr(pack('h*', md5(mt_rand())), 0, 8); if (function_exists('mhash') && function_exists('mhash_keygen_s2k')) { @@ -373,7 +371,6 @@ class rcube_ldap_password { $possible = '0123456789' . 'abcdefghijklmnopqrstuvwxyz' . 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' . './'; $str = ''; - // mt_srand((double)microtime() * 1000000); while (strlen($str) < $length) { $str .= substr($possible, (rand() % strlen($possible)), 1); diff --git a/program/lib/Roundcube/rcube_user.php b/program/lib/Roundcube/rcube_user.php index 1a61efd5e..8ed34fc28 100644 --- a/program/lib/Roundcube/rcube_user.php +++ b/program/lib/Roundcube/rcube_user.php @@ -242,7 +242,6 @@ class rcube_user // generate a random hash and store it in user prefs if (empty($prefs['client_hash'])) { - mt_srand((double)microtime() * 1000000); $prefs['client_hash'] = md5($this->data['username'] . mt_rand() . $this->data['mail_host']); $this->save_prefs(array('client_hash' => $prefs['client_hash'])); } -- cgit v1.2.3