Topic: MYSQL Read-Only possible??
Subject says it all really ![]()
Is it possible?
Unfortunately no one can be told what PunBB is - you have to see it for yourself.
You are not logged in. Please login or register.
Subject says it all really ![]()
Is it possible?
Sure, make a user account that doesn't have INSERT, UPDATE or DELETE privileges.
Ahh.... I didnt think of that. So I could just do account for insert and update...
then going on to my other subject. Would this mean admin could not delete anything. ![]()
then going on to my other subject. Would this mean admin could not delete anything.
Yes, including users and search indexes =P I'm not sure if PunBB works on a MySQL account without delete. It might.
Rickard could you possibly confirm this?
EDIT: I will be testing it this evening anyway, so no rush to answer.
Last edited by StevenBullen (2006-08-28 14:00:24)
PunBB can't work without update/delete.
Last edited by Smartys (2006-08-28 14:04:08)
PunBB can't work without update/delete.
Argh... Why wont it work without delete?
DELETE is needed. First error popped up here:
An error was encountered
Error: Unable to delete from online list.I would of thought that was the only one. So I could easily remove the online offline process (I think I could anyway).
Myeah, well, I'm not going to try removing all deletes now ![]()
Have fun with it ^^
Will report back on results. ![]()
You won't have online status (at least not accurate online status), delete.php won't work, etc
Not being able to delete != read only.
You want a read only PunBB? That's possible (but it would kind of involve ripping out a lot of features and having it just as an archive)
Last edited by Smartys (2006-08-28 14:19:43)
The reason I need this... is because I have created something simliar to (opensourcecms) but instead of forums and stuff its punbb mods.
It basically shows you live demos of all the mods currently about that can run on 1.2.12.
also...
If the mod is to basic for a live demo then you have a before and after image.
Now all was fine until I started thinking... quite a few mods have plugins so admin access will have to be essential to get understanding of both sides of the mod.
Which brings me to here and now.... and finding a cure to protect my stuff.
DB is reset every single hour on the hour so in theory I could just leave everything as it is..... spammers wont get anywhere because the DB will just keep resetting.
I'd say have it reset every hour and leave it at that. Because otherwise some mods (ones that need delete access) won't work.
I'd say have it reset every hour and leave it at that. Because otherwise some mods (ones that need delete access) won't work.
Yeah, that's the best option.
I wonder how you're going to have it all fit in tho, as many mods modify the same query etc.
I wonder how you're going to have it all fit in tho, as many mods modify the same query etc.
Its not on one installation its covered over a few.
I'd say have it reset every hour and leave it at that. Because otherwise some mods (ones that need delete access) won't work.
Yeah I am going to go with this one.
But also I am going to put a reset button that resets the database instantly, incase any problems with people deleteing stuff. Will put a time limit on DB reset so cant be done every second as such.
I explored this a while back when I was helping out as an admin on OSCMS, I thought of doing the same thing so that the demos wouldn't have to be refreshed every couple of hours.
I never found a solution but it would indeed open up some great possibilities for the demoing of web apps.
Erm.. is ist not possible to change the db functions?
What you want is that if this function is called
$db->query('UPDATE....then nothing should happen, right?
So, if you change your dblayer file (may be mysql.php or mysqli.php) you could do somethng similar to
if(preg_match("/(UPDATE|DELETE|INSERT)/i",$sql) and preg_match("/admin/",$_SERVER['REQUEST_URI'])) return 1;so that it looks like
function query($sql, $unbuffered = false)
{
// CHANGED HERE.
if(preg_match("/(UPDATE|DELETE|INSERT)/i",$sql) and preg_match("/admin/",$_SERVER['REQUEST_URI'])) return 1;
if (defined('PUN_SHOW_QUERIES'))
$q_start = get_microtime();
$this->query_result = @mysqli_query($this->link_id, $sql);You would then have a positive return value without anything happening to the database. but only if th URL contains "admin"
Or so I think, haven't tested. Maybe it's worth a try?
But then a lot of mods won't actually work
The trick (I think) is to "break" some functionality (change password, change username, registering, changing group, etc) in such a way that the user can't mess with it.
The only important thing is not to demo things like the DB plugin (or at least to not allow restores and to stop anything that isn't a select from being executed in the query box)
Last edited by Smartys (2006-08-29 12:52:39)
I thought that was the idea of it:
Show the admin interface but disable actual changes.
He said live demos, I assumed that meant showing the functionality, not just how it looks ![]()
He said live demos, I assumed that meant showing the functionality, not just how it looks
This is correct... All demos have live functionality.
I thought it would be a good idea as PunBB has many mods but its sometimes hard to understand the end result. A live demo was my answer.
I will cheat and just use the DB reset idea. ![]()
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 7 official extensions. Copyright © 2003–2009 PunBB.