Check for POST.>
(annotation) <#2. Retrieve form data.>
(annotation) <#3. Setup database adapter.>
(annotation) <#4. Do the work.>
(annotation) <#5. Store in the session.>
(annotation) <#6. Send message to next action.>
Licensed to Menshu You
Please post comments or corrections to the Author Online forum at
http://www.manning-sandbox.com/forum.jspa?forumID=329
(#1) We are only interested in this request if it is a POST. This is a minor security improvement, but
prevents us using GET where the username and password would be displayed on the address bar and hence
may be bookmarked.
(#2) We use a helper function within the class to collect the data from the request and put into an array.
The helper function filters the data to ensure that it is okay for use.
(#3) Setting up the Zend_Auth_Adapter_Dbtable instance is complicated enough that we factor it out to its
own function.
(#4) The authenticate() message does the authentication and returns a result object. The result??™s isValid()
member function is used to test for successful log in.
(#5) If we have successfully authenticated, then we store the user??™s database record (except the password
field) to the session.
(#6) Finally, if authentication has failed, we set up the Flash Messenger action helper to pass through the
error message to the next request which is the log in form.
Pages:
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194