Hello,.. I am a newbie here, sorry for my bad english,
I start using yii authorization feature,
:using CDBAuthManager
:using ORACLE 10g
:using last yii version (got from svn)
:has created table AuthAssignment,AuthItem and AuthItemChild, using schema in framework
:has setup in main.php(config), component authManager
:has created
- role authenticated, bizRule=> 'return !Yii::app()->user->isGuest;'
- role guest, bizRule => 'return Yii::app()->user->isGuest;'
:has assign userid and role name using $auth->assign('admin',1);, 1 is the userid one of my user
:put Yii::app()->user->checkAccess('admin') at the beginning one of my controller
The problem is.. I got error like this :
CDbCommand failed to execute the SQL statement: SQLSTATE[HY000] [904] OCIStmtExecute: ORA-00904: "USERID": invalid identifier. The SQL statement executed was: SELECT *
FROM "AuthAssignment"
WHERE userid=:userid
for comparation, above mentioned error would not happen when I use sqlite database for the authManager db.
Could someone help me? or face the same problem with me? I still hope can use oracle db for authManager db.
Thank you
Page 1 of 1
Cdbauthmanager Error With Oracle Database
#3
Posted 01 October 2012 - 04:59 AM
I've never used Oracle, but it looks to me like Oracle must keep USERID as a reserved word, much like ORDER or SELECT. Obviously as the framework claims compatibility with Oracle, these column names should be identified as such using backticks (`). I'd search and replace on framework/web/auth/CDbAuthManager.php file as a quick fix. Replacing "userid=" with "`userid`=" should get them all.
#4
Posted 01 October 2012 - 03:10 PM
Thanks for quick fix tips, I've added backticks (`)as you suggested, unfortunately, it raises error like this :
CDbCommand failed to execute the SQL statement: SQLSTATE[HY000] [911] OCIStmtExecute: ORA-00911: invalid character. The SQL statement executed was: SELECT *
FROM "AuthAssignment"
WHERE `userid`=:userid
CDbCommand failed to execute the SQL statement: SQLSTATE[HY000] [911] OCIStmtExecute: ORA-00911: invalid character. The SQL statement executed was: SELECT *
FROM "AuthAssignment"
WHERE `userid`=:userid
Share this topic:
Page 1 of 1