Modification MDB2
This commit is contained in:
parent
5d04534e10
commit
ba9ed99b73
@ -92,7 +92,7 @@ class Auth_Container_MDB2 extends Auth_Container
|
|||||||
if (is_array($dsn)) {
|
if (is_array($dsn)) {
|
||||||
$this->_parseOptions($dsn);
|
$this->_parseOptions($dsn);
|
||||||
if (empty($this->options['dsn'])) {
|
if (empty($this->options['dsn'])) {
|
||||||
PEAR::raiseError('No connection parameters specified!');
|
DOLIPEAR::raiseError('No connection parameters specified!');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->options['dsn'] = $dsn;
|
$this->options['dsn'] = $dsn;
|
||||||
@ -116,9 +116,9 @@ class Auth_Container_MDB2 extends Auth_Container
|
|||||||
} elseif (is_subclass_of($dsn, 'MDB2_Driver_Common')) {
|
} elseif (is_subclass_of($dsn, 'MDB2_Driver_Common')) {
|
||||||
$this->db = $dsn;
|
$this->db = $dsn;
|
||||||
} elseif (is_object($dsn) && MDB2::isError($dsn)) {
|
} elseif (is_object($dsn) && MDB2::isError($dsn)) {
|
||||||
return PEAR::raiseError($dsn->getMessage(), $dsn->code);
|
return DOLIPEAR::raiseError($dsn->getMessage(), $dsn->code);
|
||||||
} else {
|
} else {
|
||||||
return PEAR::raiseError('The given dsn was not valid in file ' . __FILE__ . ' at line ' . __LINE__,
|
return DOLIPEAR::raiseError('The given dsn was not valid in file ' . __FILE__ . ' at line ' . __LINE__,
|
||||||
41,
|
41,
|
||||||
PEAR_ERROR_RETURN,
|
PEAR_ERROR_RETURN,
|
||||||
null,
|
null,
|
||||||
@ -127,8 +127,8 @@ class Auth_Container_MDB2 extends Auth_Container
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MDB2::isError($this->db) || PEAR::isError($this->db)) {
|
if (MDB2::isError($this->db) || DOLIPEAR::isError($this->db)) {
|
||||||
return PEAR::raiseError($this->db->getMessage(), $this->db->code);
|
return DOLIPEAR::raiseError($this->db->getMessage(), $this->db->code);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -268,7 +268,7 @@ class Auth_Container_MDB2 extends Auth_Container
|
|||||||
// Prepare for a database query
|
// Prepare for a database query
|
||||||
$err = $this->_prepare();
|
$err = $this->_prepare();
|
||||||
if ($err !== true) {
|
if ($err !== true) {
|
||||||
return PEAR::raiseError($err->getMessage(), $err->getCode());
|
return DOLIPEAR::raiseError($err->getMessage(), $err->getCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if db_fields contains a *, if so assume all columns are selected
|
//Check if db_fields contains a *, if so assume all columns are selected
|
||||||
@ -291,8 +291,8 @@ class Auth_Container_MDB2 extends Auth_Container
|
|||||||
);
|
);
|
||||||
|
|
||||||
$res = $this->db->queryRow($query, null, MDB2_FETCHMODE_ASSOC);
|
$res = $this->db->queryRow($query, null, MDB2_FETCHMODE_ASSOC);
|
||||||
if (MDB2::isError($res) || PEAR::isError($res)) {
|
if (MDB2::isError($res) || DOLIPEAR::isError($res)) {
|
||||||
return PEAR::raiseError($res->getMessage(), $res->getCode());
|
return DOLIPEAR::raiseError($res->getMessage(), $res->getCode());
|
||||||
}
|
}
|
||||||
if (!is_array($res)) {
|
if (!is_array($res)) {
|
||||||
$this->activeUser = '';
|
$this->activeUser = '';
|
||||||
@ -344,7 +344,7 @@ class Auth_Container_MDB2 extends Auth_Container
|
|||||||
{
|
{
|
||||||
$err = $this->_prepare();
|
$err = $this->_prepare();
|
||||||
if ($err !== true) {
|
if ($err !== true) {
|
||||||
return PEAR::raiseError($err->getMessage(), $err->getCode());
|
return DOLIPEAR::raiseError($err->getMessage(), $err->getCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
$retVal = array();
|
$retVal = array();
|
||||||
@ -368,7 +368,7 @@ class Auth_Container_MDB2 extends Auth_Container
|
|||||||
|
|
||||||
$res = $this->db->queryAll($query, null, MDB2_FETCHMODE_ASSOC);
|
$res = $this->db->queryAll($query, null, MDB2_FETCHMODE_ASSOC);
|
||||||
if (MDB2::isError($res)) {
|
if (MDB2::isError($res)) {
|
||||||
return PEAR::raiseError($res->getMessage(), $res->getCode());
|
return DOLIPEAR::raiseError($res->getMessage(), $res->getCode());
|
||||||
} else {
|
} else {
|
||||||
foreach ($res as $user) {
|
foreach ($res as $user) {
|
||||||
$user['username'] = $user[$this->options['usernamecol']];
|
$user['username'] = $user[$this->options['usernamecol']];
|
||||||
@ -397,7 +397,7 @@ class Auth_Container_MDB2 extends Auth_Container
|
|||||||
// Prepare for a database query
|
// Prepare for a database query
|
||||||
$err = $this->_prepare();
|
$err = $this->_prepare();
|
||||||
if ($err !== true) {
|
if ($err !== true) {
|
||||||
return PEAR::raiseError($err->getMessage(), $err->getCode());
|
return DOLIPEAR::raiseError($err->getMessage(), $err->getCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->options['cryptType']) && $this->options['cryptType'] == 'none') {
|
if (isset($this->options['cryptType']) && $this->options['cryptType'] == 'none') {
|
||||||
@ -433,7 +433,7 @@ class Auth_Container_MDB2 extends Auth_Container
|
|||||||
$res = $this->query($query);
|
$res = $this->query($query);
|
||||||
|
|
||||||
if (MDB2::isError($res)) {
|
if (MDB2::isError($res)) {
|
||||||
return PEAR::raiseError($res->getMessage(), $res->code);
|
return DOLIPEAR::raiseError($res->getMessage(), $res->code);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -454,7 +454,7 @@ class Auth_Container_MDB2 extends Auth_Container
|
|||||||
// Prepare for a database query
|
// Prepare for a database query
|
||||||
$err = $this->_prepare();
|
$err = $this->_prepare();
|
||||||
if ($err !== true) {
|
if ($err !== true) {
|
||||||
return PEAR::raiseError($err->getMessage(), $err->getCode());
|
return DOLIPEAR::raiseError($err->getMessage(), $err->getCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = sprintf("DELETE FROM %s WHERE %s = %s",
|
$query = sprintf("DELETE FROM %s WHERE %s = %s",
|
||||||
@ -466,7 +466,7 @@ class Auth_Container_MDB2 extends Auth_Container
|
|||||||
$res = $this->query($query);
|
$res = $this->query($query);
|
||||||
|
|
||||||
if (MDB2::isError($res)) {
|
if (MDB2::isError($res)) {
|
||||||
return PEAR::raiseError($res->getMessage(), $res->code);
|
return DOLIPEAR::raiseError($res->getMessage(), $res->code);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -485,7 +485,7 @@ class Auth_Container_MDB2 extends Auth_Container
|
|||||||
// Prepare for a database query
|
// Prepare for a database query
|
||||||
$err = $this->_prepare();
|
$err = $this->_prepare();
|
||||||
if ($err !== true) {
|
if ($err !== true) {
|
||||||
return PEAR::raiseError($err->getMessage(), $err->getCode());
|
return DOLIPEAR::raiseError($err->getMessage(), $err->getCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($this->options['cryptType']) && $this->options['cryptType'] == 'none') {
|
if (isset($this->options['cryptType']) && $this->options['cryptType'] == 'none') {
|
||||||
@ -509,7 +509,7 @@ class Auth_Container_MDB2 extends Auth_Container
|
|||||||
$res = $this->query($query);
|
$res = $this->query($query);
|
||||||
|
|
||||||
if (MDB2::isError($res)) {
|
if (MDB2::isError($res)) {
|
||||||
return PEAR::raiseError($res->getMessage(), $res->code);
|
return DOLIPEAR::raiseError($res->getMessage(), $res->code);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -546,7 +546,7 @@ class MDB2
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is used to communicate an error and invoke error
|
* This method is used to communicate an error and invoke error
|
||||||
* callbacks etc. Basically a wrapper for DOLIDOLIPEAR::raiseError
|
* callbacks etc. Basically a wrapper for DOLIPEAR::raiseError
|
||||||
* without the message string.
|
* without the message string.
|
||||||
*
|
*
|
||||||
* @param mixed int error code
|
* @param mixed int error code
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user