It took me awhile, but I managed to get phpSecurityAdm working with an Oracle database. The changes that were made did not alter functionality with a MySQL database. Implementation was done with version 2003.01.14 of metabase. For those interested, here's what you have to do:
1. Edit the include/config.php file and indicate an Oracle Service Identifier (SID) by adding an 'Options' element to the $PSA_SCR array. The 'Options' element will be an array within the $PSA_SCR array, and must have a 'SID' element. As an example, my tnsnames.ora file contains an entry for an Oracle instance called 'brians.desktop', so the line I added to the $PSA_SCR array is:
'Options' => array('SID'=>'brians.desktop'),
While you're editing the $PSA_SCR array, make sure you specify the Type as 'oci', and specify User, Password, etc.
2. Edit the include/class.phpSecurityAdm.php file, and change all occurances of GetDateFieldValue to GetTimestampFieldValue. Checking the metabase source code I can see that GetDateFieldValue does not include hours:minutes:seconds, whereas GetTimestampFieldValue does. Apparently, MySQL doesn't care about this. Oracle, on the other hand, pukes on it.
3. In the include/class.phpSecurityAdm.php file, change the syntax of all the INSERT statements. The existing syntax:
INSERT INTO whatever SET somefield="blah", someother="moreblah"
Does not work. The standard INSERT INTO sytnax will work in both MySQL and Oracle:
INSERT INTO whatever (somefield, someother) VALUES ("blah","moreblah")
4. Edit the include/sessions.php file and change the syntax of the INSERT INTO statement there also.
5. This is probably not related to Oracle, but rather to my version of Linux/Apache/PHP. The ini_set()'s in include/sessions.php did not work. I commented out the lines and switched to using session_start().
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2004-03-25
Also, the pattern that is the first argument of preg_match() must be enclosed in square brackets[] . This is probably associated more with Linux/Apache/PHP than it is with Oracle. Still, I had to add the square brackets in order to get phpSecurityAdm to work.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It took me awhile, but I managed to get phpSecurityAdm working with an Oracle database. The changes that were made did not alter functionality with a MySQL database. Implementation was done with version 2003.01.14 of metabase. For those interested, here's what you have to do:
1. Edit the include/config.php file and indicate an Oracle Service Identifier (SID) by adding an 'Options' element to the $PSA_SCR array. The 'Options' element will be an array within the $PSA_SCR array, and must have a 'SID' element. As an example, my tnsnames.ora file contains an entry for an Oracle instance called 'brians.desktop', so the line I added to the $PSA_SCR array is:
'Options' => array('SID'=>'brians.desktop'),
While you're editing the $PSA_SCR array, make sure you specify the Type as 'oci', and specify User, Password, etc.
2. Edit the include/class.phpSecurityAdm.php file, and change all occurances of GetDateFieldValue to GetTimestampFieldValue. Checking the metabase source code I can see that GetDateFieldValue does not include hours:minutes:seconds, whereas GetTimestampFieldValue does. Apparently, MySQL doesn't care about this. Oracle, on the other hand, pukes on it.
3. In the include/class.phpSecurityAdm.php file, change the syntax of all the INSERT statements. The existing syntax:
INSERT INTO whatever SET somefield="blah", someother="moreblah"
Does not work. The standard INSERT INTO sytnax will work in both MySQL and Oracle:
INSERT INTO whatever (somefield, someother) VALUES ("blah","moreblah")
4. Edit the include/sessions.php file and change the syntax of the INSERT INTO statement there also.
5. This is probably not related to Oracle, but rather to my version of Linux/Apache/PHP. The ini_set()'s in include/sessions.php did not work. I commented out the lines and switched to using session_start().
Also, the pattern that is the first argument of preg_match() must be enclosed in square brackets[] . This is probably associated more with Linux/Apache/PHP than it is with Oracle. Still, I had to add the square brackets in order to get phpSecurityAdm to work.