SECURITY Flaws in this design for User authentication.
From: http://wiki.pylonshq.com/display/pylonscookbook/Simple+Homegrown+Authentication
Note: a. Project follows the MVC pattern. b. Only a user with a valid username and password is allowed submit something.
Design: a. Have a base controller from which all controllers are derived from. b. Before any of the actions in the derived controllers are called the system calls a before action in the base controller. c. In each controller user hardcodes the actions that need to be verified in an array. d. The before action first looks in the array that has the actions that are protected and sees if a user is logged in or not by peaking into the session. If a user is present then user is allowed to submit otherwise user is redirected to login page.
What do you think?