Home » Authentication » LiveUser » Bug #2213
LiveUser_Admin_Auth_Container_DB::removeUser() not using authTableCols w/patch
Details
| Submitted | 2004-08-25 13:19 UTC |
|---|---|
| From | mflaherty at clearmessage dot com |
| Assigned | dufuz |
| Status | Closed |
| Package | LiveUser |
| PHP Version | 4.3.3 |
| Roadmaps | (Not assigned) |
Comments
[2004-08-25 13:19 UTC] mflaherty at clearmessage dot com
Description:
------------
Query is written as:
----^snip----
DELETE FROM
' . $this->authTable . '
WHERE
auth_user_id = '.$this->dbc->quoteSmart($authId);
----^snip----
instead of...
----^snip----
DELETE FROM
' . $this->authTable . '
WHERE
! ' . $this->authTableCols['required']['auth_user_id']['name'] . ' = '.$this->dbc->quoteSmart($authId);
----^snip----
...which it really ought to be. Very simple to fix. Here is a patch. Apply it to the affected file: LiveUser/Admin/Auth/Container/DB.php
Reproduce code:
---------------
db_error Object
(
[error_message_prefix] =>
[mode] => 16
[level] => 1024
[code] => -19
[message] => DB Error: no such field
[userinfo] =>
DELETE FROM
cm_users
WHERE
auth_user_id = '73' [nativecode=ERROR: Attribute "auth_user_id" not found]
[backtrace] => Array
(....
etc, etc.
Expected result:
----------------
Query should execute without an error if backend DB is setup correctly.
Actual result:
--------------
Query fails with "DB Error: no such field" when auth_user_id is not a field in LiveUser_Admin_Auth_Container_DB::authTable.
[2004-08-25 13:21 UTC] mflaherty at clearmessage dot com
Patch inside of "----^snip----" boundaries.
----^snip----
*** DB.php.orig 2004-08-25 01:25:36.000000000 +0100
--- DB.php 2004-08-25 01:36:37.000000000 +0100
***************
*** 243,249 ****
DELETE FROM
' . $this->authTable . '
WHERE
! auth_user_id = '.$this->dbc->quoteSmart($authId);
$result = $this->dbc->query($query);
--- 243,249 ----
DELETE FROM
' . $this->authTable . '
WHERE
! ' . $this->authTableCols['required']['auth_user_id']['name'] . ' = '.$this->dbc->quoteSmart($authId);
$result = $this->dbc->query($query);
***************
*** 464,467 ****
return $res;
}
}
! ?>
\ No newline at end of file
--- 464,467 ----
return $res;
}
}
! ?>
----^snip----