RadCORE uses "UniLoginForm" by default for the access control example.


We have a field with LOGIN( email ) and PASSWORD by default. Some users add a third field referring to the company code (a document for example) and associate a different database for each document.


Observe all components and their events to better understand the flow of execution.


Note: In case you don't want to use it, you can select the option in the RC WIZARD.


Images used by RadCORE 


The images used in Login, MainForm and Demos can be replaced without changes to the code, simply create your images with the same dimensions and nomenclature as the images used by RadCORE:


Folder "C:\RadCORE_SOURCES_uniGUI\inetpub\wwwroot\radcore\files\images\":


- logo_login.png

- icon_mainmenu.png

- icon_mainmenu_light.png

- favicon.ico


Some folders containing images used by RadCORE:


- C:\RadCORE_SOURCES_uniGUI\inetpub\wwwroot\radcore\files\images\menu

- C:\RadCORE_SOURCES_uniGUI\inetpub\wwwroot\radcore\files\images\avatars

- C:\RadCORE_SOURCES_uniGUI\inetpub\wwwroot\radcore\files\images\loaders

- C:\RadCORE_SOURCES_uniGUI\inetpub\wwwroot\radcore\files\images\lotties

- C:\RadCORE_SOURCES_uniGUI\inetpub\wwwroot\radcore\files\images\messages

- C:\RadCORE_SOURCES_uniGUI\inetpub\wwwroot\radcore\files\images\slides


The background images used in "frmLOGIN" use a resource to be able to follow a context.

See the "mainmodulecreate" event described in the previous topic.


Let's follow a little bit of each event. As programmers, we must analyze all the code to better understand.


FORMCREATE


In this event, a series of settings are prepared such as cookies, default language, activation of RTL mode, etc.


ONREADY


In this event, the treatment of the "rc_translate"


btnLog_InClick


When the user clicks the Login button ( btnLog_In ) the first connection to the Database is made ( ...\files\database ).


It is checked if the username and password are correct or if it is a SUPER USER ( mm.varC_UserPassAdmin ).


Once the access data are correct, an animation is run that brings up the selection of the company (if there is more than one).


Note: When a user is registered, he/she must have the association of companies that he/she can access. If it is MASTER, it will have access to all companies.



btnEnterClick


When selecting the company, its data is captured (CNPJ or CPF - documents used in Brazil).


Licensing control uses one of these documents to be able to link to customer data.


Some global variables are fed and can be used throughout the application.


At this point, the licensing review of your application can be made.


 


In the registration forms there is already a critical lock ( varC_Locked ).




You can further enhance this feature or not use it at your discretion.


License control is a usage suggestion. If you want to use your own login and license controls, study the events of the components involved.


Study the code in its entirety.

Created with the Personal Edition of HelpNDoc: Free EPub and documentation generator