How to handle password entry and storage
When a program requires password entry, along with the ability to change and save a new password, these operations can be handled by adding an edit field to a graphical page for password entry and creating a separate graphical page where the password can be modified and the new password saved.
A set of functions is also used to manage these operations.
The following example demonstrates how password entry and modification are handled in a project.
Further down, you will also find the relevant code sections written in the .c files associated with the pages.
In common.h (or in any .h files included in common):
In start.c.:
On the page_reqPassword.c page, where the user is prompted to enter a password, the my_password variable is associated with an edit field that allows the user to enter the password. A confirmation button is also provided, along with a label (label1) that displays whether the password is correct or incorrect.
On the page_modPassword.c page, where passwords can be changed, superadmin_password and manutentore_password are associated with two input fields in the graphical interface, allowing users to enter new passwords.
There is also a reset button that restores the default password characters, as well as a bitmap that can be clicked to save the newly entered passwords.
Finally, two labels display either the message "Save successful" or "Save failed".


