This topic is locked

Change database connection for 'guest' user

3/9/2009 8:46:28 AM
PHPRunner General questions
E
emilio833 author

I have not found in forum topic nor in phprunner documentation the possibility to change the name of database (and relative connection) only for "guest" account.

I need to change database environment because my guest account could change database demo data in the same way of the production environment and must not view production data.

Is there a simple way to manage this?
I am trying phprunner but I have found a little problem with security: if login as guest is enabled in advanced security setting and you cut&paste the url link of previous navigation after logout, you can view database table with "guest" account. Is this normal or a bug?
Thanks for help.
Emil

Sergey Kornilov admin 3/9/2009

Emil,
make sure you are not looking at the cached version of the page after logout.
Changing database connection on the fly is also possible however requires changes in generated code. See include/dbconnection.php file, db_connect() function. This is the place where you can change connection string. If $_SESSION["AccessLevel"] equals ACCESS_LEVEL_GUEST that means current user is logged in as guest.

E
emilio833 author 3/9/2009

make sure you are not looking at the cached version of the page after logout.



I have found the problem with IE7 and Firefox, and the cache was cleared before the test.

You can duplicate it simply clearing the cache of your browser and clicking on this link:
and you are logges as guest...
For my request on guest connection, you can insert in the next release a new event to trigger before database connection that enables the modification of connection parameters?
Thanks.

Emil

R
randall 3/9/2009



I have found the problem with IE7 and Firefox, and the cache was cleared before the test.

You can duplicate it simply clearing the cache of your browser and clicking on this link:
and you are logges as guest...


Try clearing the templates-c directory in PHPRunner's output.

Sergey Kornilov admin 3/9/2009

Emil,
if guest account is enabled and you proceed directly to one of pages you will be logged in as a guest automatically. The idea is to allow guest users bypass the login page.
Note: guest users still won't be able to access pages and tables they are not allowed to use.