2

I created an web app that has a admin control panel, it's almost done but suddenly i found that i should launch the control panel as demo, where public can login with public user id and password and do changes but restore the default data from database for another user. how can i do this? which way is faster?

1
  • +1 for the thrilling suddenly there. :)
    – hjpotter92
    Feb 12, 2013 at 9:51

1 Answer 1

2
  1. Make database for this demo user. Think which functionality should be blocked (for example password, change etc).
  2. Make database dump with demo data.
  3. Every hour (or on every login) run script which will be truncate all tables (if you have constraints, remember about correct truncate queue) and then run your dump file.
2
  • what about if multiple users at the same time is logged in?
    – h0mayun
    Feb 12, 2013 at 10:53
  • Depends. There can be many users logged at the same time, if you won't refresh database on user login. You have to remember about blocking critical functionality. As i metioned before, it should be changing user password, delete him and so on. Think about another dangerous functionality which should be blocked. You're asking about the fastest way, which i suggested - block critical functionality and refresh database in some period of time. If you're looking for more complex solution, you should prepare more complex 'blockades' but it takes time.
    – Kasyx
    Feb 12, 2013 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.