musacivak / rock-php

Automatically exported from code.google.com/p/rock-php
0 stars 0 forks source link

Deprecated: Function MongoDB::authenticate() is deprecated #219

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Web server  nginx/1.2.3
PHP version PHP 5.3.6-13ubuntu3.8
PHP extension   mongo/1.2.12

Build Information ({buildinfo:1})
version 2.0.7
gitVersion  875033920e8869d284f32119413543fa475227bf
sysInfo Linux 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 
x86_64 BOOST_LIB_VERSION=1_41
versionArray    Array
bits    64
debug   
maxBsonObjectSize   16777216

Original issue reported on code.google.com by z.sta...@gmail.com on 23 Aug 2012 at 12:50

GoogleCodeExporter commented 8 years ago
/var/www/rockmongo/app/models/MServer.php on line 257

Original comment by z.sta...@gmail.com on 23 Aug 2012 at 12:52

GoogleCodeExporter commented 8 years ago
any update?

Original comment by russell....@gmail.com on 29 Sep 2012 at 8:29

GoogleCodeExporter commented 8 years ago
I agree, with recent PHP driver (> 1.2.11) and auth enabled, rockmongo cannot 
log-in !

Why is this defect categorize "Medium" ?

Original comment by acord...@tftlabs.com on 2 Oct 2012 at 2:16

GoogleCodeExporter commented 8 years ago
"Medium" is default. I can not change the category. This can be performed only 
by privileged users.

Original comment by zygiman...@soundest.lt on 2 Oct 2012 at 2:43

GoogleCodeExporter commented 8 years ago
Sorry, this remark was not intended for you, more for the developper(s)...

Original comment by acord...@tftlabs.com on 3 Oct 2012 at 2:13

GoogleCodeExporter commented 8 years ago
just open MServer.php and add this:

$this->_mongoOptions['username'] = $username;
$this->_mongoOptions['password'] = $password;
$this->_mongoOptions['db'] = $db;

above the try block with new Mongo(...);

and comment out the auth by mongo and auth by rock parts.

simples..

Original comment by bnjep...@gmail.com on 12 Oct 2012 at 1:29

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Above suggestion seems to be implemented in 1.1.4 version of rockmongo

Original comment by acord...@tftlabs.com on 18 Dec 2012 at 3:49

GoogleCodeExporter commented 8 years ago
by default 
$this->_mongoOptions is empty array .you can use method by #6 friend said.
or 
$this->_mongoOptions['username'] = $this->_mongoUser;
$this->_mongoOptions['password'] = $this->_mongoPass;
$this->_mongoOptions['db'] = $db;

$this->_mongoUser  $this->_mongoPass are inited by config in config.php

$ret = $this->_mongo->selectDb($db)->authenticate($username, $password);
if (!$ret["ok"]) {
    return false;
}

change to:

$ret = $this->_mongo->selectDb($db);  (return an object,not like authenticate 
return an array)
//if (!$ret["ok"]) {
//  return false;
//}

Original comment by zxsz4...@gmail.com on 5 Nov 2013 at 11:08