Create Login and Register Page in Custom Portal

AlhussainiM
Tera Contributor

Hello every body , 
I have a question about login and register page in the portal , 
My scenario is :  I am working on application to automate issue the certificates to citizens(birth .. etc)  I have two tables ,
1- called user (core table),
2- citizen (custom) table 
I suppose in the citizen table I have all citizens data in my country , but not all citizens are users in my application. 
So I want in my register page in the portal write National ID of his and then I go to check if the Citizen table contain this National ID or not. 
if yes I allow to he write additional information like email and phone then I will create new user by his data in the citizen table and additional data that he entered it then I will redirect to home page in the portal  . 
I didn't know How I will custom register page and login page( it refuse redirect to home page).
I read that I will need plugin called self registration. 
Please Can you help me?
Thank in advance.

 

1 REPLY 1

Matthew_13
Mega Sage

Yes, this is doable, and you don’t need to customize login.do.

The usual approach is to use portal self-registration (or a custom portal registration page), not the login page itself.

What you want is:
User enters National ID → system checks the Citizen table → if found, allow email/phone → create a sys_user → redirect to portal home.

You can do this in two ways:

Best / closest to OOB
Enable self-registration for the portal and add a National ID field to the registration form. On submit, validate that National ID exists in your Citizen table. If it does, create the user using citizen data + entered fields. If not, show an error.

More custom
Create a custom portal “Register” page + widget. The widget checks the Citizen table via a Script Include, creates the user, then redirects to /sp?id=home.

If users are not redirecting after login/registration, that’s usually a portal entry page / redirect configuration issue, not a login issue.

At the end of the day:  don’t touch the login page; handle this in portal registration, then control the redirect to your home page.

 

@AlhussainiM - Please mark Accepted Solution and Thumbs Up if you find Helpful!!