-
Notifications
You must be signed in to change notification settings - Fork 1
Functions' description
The controller which we have created is called User_controller and contains some functions which are described below:
- Function Name: __construct()
**Functionality:**All the libraries , helper , model and some form validation functions are loaded into this function.
-
Function Name: index()
**Functionality:**The other function named 'view_login' is loaded to this function as it will be run at the first in browser.
-
Function Name: logout()
**Functionality:**In this function the user wants to logout the created session is going to be destroyed and again the 'view_login' function is loaded.
-
Function Name: update_profile()
Functionality: In this function it will be checked if the user is not logged in or a session is not set for him , then the 'view_login' function will be loaded ,but if the user is logged in or a session is set for him then his data will be taken from database and will be sent to 'view_user_update' page which is loaded to this function.
-
**Function Name:**view_login()
**Functionality:**This function sets some form validation for user and also it checks if the data is not validate then the 'view_login' page is going to be loaded , but if the data is validated then it will be checked if the user is in database then a session will be created for him and then the 'update_user' function is loaded ,but if the user in not in database then a message will be appeared and the 'view_login' page is going to be loaded.
-
**Function Name:**view_registration_form()
**Functionality:**This function loads the 'view_reg_user' page.
-
Function Name: register()
**Functionality:**Some validations are set for registration options and if the data which is given by user is validate then the data will be inserted to database by loading the 'add_user' method from model, and the 'view_reg_succ' page is loaded, but if any of them is not validate the 'view_reg_user' page is loaded again to fill it back
-
Function Name: forget_pass()
**Functionality:**The function in not complete yet ,but right now it just loads the 'view_forget_pass' page.
-
Function Name: user_update()
**Functionality:**The necessary validations are going to be check in this function and then if the data is not validate the 'view_user_update' page will be loaded ,but if all data is validate then then according to the userID of the user which is saved to session before the user data is going to be updated in database by loading the 'update_user' method from model and then the 'view_user_update' page is loaded.
-
Function Name: send_mail($username, $email)
Functionality: This function takes two parameters and when the user is registered then the function will be called by the username and email of that person and a confirmation mail is going to be sent to that person.