Welcome Guest, Not a member yet? Register   Sign In
dynamically create form from database tables
#2

[eluser]xerobytez[/eluser]
In my auth systems I always use nodes. So like i would have users.forums.post to allow posting to forums or admins.users.delete to allow an admin to delete users. Each node should always be unique, so I replace the periods in the node with underscores and use them in the form with a checkbox array and set the names to something like this name="permissions[users_forums_post]". Then in the controller on a post I remove all records from the permissions table for the user being edited, loop through the array of posted permissions, perform validation, and replace the underscores with periods. and then insert a new record into the permissions table with the new node. Hope this gives you some ideas.


Messages In This Thread
dynamically create form from database tables - by El Forum - 09-19-2012, 09:59 AM
dynamically create form from database tables - by El Forum - 09-19-2012, 03:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB