hi everyone!
Recently, i wrote an authentication script in php, using a MySQL database and php sessions.
The authentication part works ok, i use a mysql user which has read-only privileges within the MySQL database, so no password is needed... even if anyone finds out that username, he/she cannot really harm the database (unless, of course read it, which is bad enough)
Along with the authentication script, i also wrote a backoffice to insert/remove/edit users that are allowed to see the protected pages. The back-office has to work with a full-privileged (not really full, but able to insert, delete, update the database) user, which obviously has a password.
My problem starts here:
That username+password is stored in a file, that i need to hide. How can i do that? It is an empty file in terms of php code (if you run it on a browser, the result is a blank screen (not blue...)), but if anyone writes a program to read the file, it becomes completely uncovered. How can i hide the damn file???
Second problem:
I would like to set up MySQL in a way that when a user logs in the server and makes a 'show databases' command, sees only the databases that the user is allowed to read. I know that this can be done by setting a MySQL variable (like safe-show-database) in /etc/my.cnf, but it doesn't work. Is this because the mysql manual refers to mysql 4.0 and i am using mysql 3.23?
(i know this last question is not really related to the topic, but it relates to the previous in a way...)
thanx!
[]