Chapter 13: Tell-a-Friend System 451 Creating the Tell-a-Friend (Yahoo web space)

Chapter 13: Tell-a-Friend System 451 Creating the Tell-a-Friend Main Menu Manager Application This application, taf_mngr.php, is responsible for managing the main menu of the system. This application is included on the CD-ROM in the ch13/apps directory. It implements the following functionality: . Allows every user to create messages and forms. . Allows users from authenticated IP addresses to delete or modify forms or messages. . Allows users from authenticated IP addresses to view the form report. This application has the following methods. run() When the application is run, this method is called. It simply calls the displyTAFMenu() method to render the main menu for the system. displayTAFMenu() This method is responsible for showing the main menu according to the privileges based on the IP address of the client. It works in the following manner: . A menu template (TAF_MENU_TEMPLATE) is loaded in a template object called $template. . All the form names and form IDs of the database are loaded in the array $frms. . For each of those forms the AccessControl object is used to check whether the request IP is allowed to access the form. If the check result is yes, then the form name is showed in the list to the user for him to modify, delete, or view a report. . Similarly, all the messages are loaded in an array and the AccessControl object is again used to verify the request IP s eligibility to access the message and the message list is prepared thereby. . After preparing the message list and the form list and setting all the links for deletion, modification, and report for the messages or forms, the template is parsed and printed to the user.

Leave a Reply