Signup-Login-Change Password-Show Password Icon-User Active


 My Table Structure is :-

CREATE TABLE USER_INFO

(

ID                 NUMBER(10), --- PK
ORGANISATION_ID   NUMBER(10), ---- FK
FULLNAME           VARCHAR2(25),
USERNAME           VARCHAR2(25),
EMAIL              VARCHAR2(25),
BIRTH_DATE         DATE,
GENDER             NUMBER(4),
PSSWRD             VARCHAR2(50),
CONFIRM_PSSWRD     VARCHAR2(50),
USER_TYPE          NUMBER(10),
ACTIVE             VARCHAR2(5),
CONSTRAINT PK_USER_INFO_ID PRIMARY KEY (ID),
CONSTRAINT UK_USER_INFO_USERNAME UNIQUE (USERNAME),
CONSTRAINT FK_USER_INFO_ORGANISATION_ID FOREIGN KEY (ORGANISATION_ID)
           REFERENCES ORGANISATIONS (ORGANISATION_ID)
);

--------------------------------------------------------------------------

Signup :
=====

Step-1 :

Create Page and Design Signup base.

--> Click-- Page15: Signup 

    Title : Are you new ? Please Sign up now...

    Page Model : Modal Dialog

    Authorization : Page is public


Step-2 : Create save Process And by default process delete

BEGIN

SELECT NVL(MAX(ID),1000)+1 INTO :P15_ID FROM USER_INFO;

INSERT INTO USER_INFO (ID,ORGANISATION_ID,FULLNAME,USERNAME,EMAIL,BIRTH_DATE,GENDER,PSSWRD,CONFIRM_PSSWRD,USER_TYPE,ACTIVE)

VALUES (:P15_ID,:P15_ORGANISATION_ID,:P15_FULLNAME,:P15_USERNAME,:P15_EMAIL,:P15_BIRTH_DATE,:P15_GENDER,:P15_PSSWRD,:P15_CONFIRM_PSSWRD,4,'NO');

END;

Step-3 :

--> Buttons delete (Apply Change, Delete, CANCEL)

Step-4 :

Create "Signup" button in the page9999. (Go to login page)

Button Position : EDIT

Behavior : Action - Redirect to page in this application

           Target - Page 15

Quick Edit : Size - Large
                   Width - Stretch
                   Spacing Top - Large

------------------------------------------------------------------------



Show Password Icon:
==============

Step-1 : Function and Global Variable Declaration :

function viewPassword()

{  var passwordInput = document.getElementById('P9999_PASSWORD');

  var passStatus = document.getElementById('pass-status');

  if (passwordInput.type == 'password'){

    passwordInput.type='text';

    passStatus.className='fa fa-eye-slash field-icon';    

  }

  else{

    passwordInput.type='password';

    passStatus.className='fa fa-eye field-icon';

  }}

Step-2 : Inline :

.field-icon {

    right : 5px;

    margin-left: -25px;

    margin-top: 14px;

    position: relative;

    z-index: 2;}


Step-3 : P9999_PASSWORD --> Post Text :

<i id="pass-status" class="fa fa-eye field-icon" aria-hidden="true" onClick="viewPassword()"></i>

--------------------------------------------------------------------------------------------------

Login :
=====

Step-1 : Go to page9999 and copy to paste below the PLSQL Code in the "Login" process.

declare

  CURSOR C_USER IS SELECT USERNAME,PSSWRD,ACTIVE FROM USER_INFO

  WHERE UPPER(LTRIM(RTRIM(USERNAME)))=UPPER(LTRIM(RTRIM(:P9999_USERNAME)));

  R_USER C_USER%ROWTYPE;

  vMess varchar2(2000):='';

BEGIN

  OPEN C_USER; FETCH C_USER INTO R_USER; CLOSE C_USER;

  if R_USER.USERNAME is null then

    vMess:=vMess||'User Not Found,';

  end if;

  IF R_USER.ACTIVE='NO' THEN

    vMess:=vMess||'You are In-Active ! Please contact with Administrator Rafiqul Islam ( +8801571796878 ).';

  END IF;

  IF :P9999_USERNAME is null then

    vMess:=vMess||'Give User Name,';

  END IF;

  IF :P9999_PASSWORD is null then

    vMess:=vMess||'Give Password,';

  END IF;

  IF UPPER(ltrim(rtrim(:P9999_USERNAME)))<>UPPER(LTRIM(RTRIM(R_USER.USERNAME))) THEN

    vMess:=vMess||'User Name Not Found,';

  END IF;

  IF UPPER(ltrim(rtrim(:P9999_USERNAME)))=UPPER(LTRIM(RTRIM(R_USER.USERNAME))) 

     and UPPER(ltrim(rtrim(:P9999_PASSWORD)))!=UPPER(LTRIM(RTRIM(R_USER.PSSWRD))) THEN

    vMess:=vMess||'Password Not Matched,';

  END IF;

  IF LENGTH(LTRIM(RTRIM(vMess)))>3 then

    apex_error.add_error(p_message => VMESS,p_display_location => apex_error.c_inline_in_notification);

  ELSE

    Wwv_Flow_Custom_Auth_Std.Post_Login(:P9999_USERNAME -- p_User_Name

                                       ,:P9999_PASSWORD -- p_Password

                                       ,v('APP_SESSION') -- p_Session_Id

                                       ,:APP_ID || ':1' -- p_Flow_page

                                       );

  END IF;

END;


Logo and Background setup :
===================

--> Shared Components\Static Application Files (upload your image)

--> Login Page --> Inline :

.t-Login-region{  

    background:none;      

}

.t-PageBody--login {

    background-image: url(#APP_FILES#ffmsbg2.jpeg);

     background-size: cover;

     background-repeat: no-repeat;

}


.t-Login-logo {

background-image: url(#APP_IMAGES#logo/WhatsApp_Image_2022-09-20_at_9.42.15_AM-removebg-preview.png);

background-size: cover;

width: 100px;

height: 100px;

}

.field-icon {

    right : 5px;

    margin-left: -25px;

    margin-top: 14px;

    position: relative;

    z-index: 2;}


------------------------------------------------------------------------------

Change password :
============

Step-1 :

Create Page and Design Change password base.

--> Create new item --> "P15_NEW_PASSWORD"

Step-2 : Delete all by default process And Button.

Create Save Button and wrigth "Update pass" Process (copy to paste below the PLSQL Code)


UPDATE USER_INFO SET

PSSWRD=:P15_NEW_PASSWORD,

CONFIRM_PSSWRD=:P15_CONFIRM_PSSWRD

WHERE USERNAME=:P15_USERNAME

AND PSSWRD=:P15_PSSWRD;


apex_application.g_print_success_message := '<span>'||:P15_USERNAME||' You Change Password  successfully.'||'</span>';


Step-3 : Create Validation

Name--> notnull_and_macth

Type--> PL/SQL Function Body Returning Error Text


IF    :P15_USERNAME IS NULL THEN

 RETURN 'Please! At first, give Username';

 end if;

IF :P15_PSSWRD IS NULL THEN

 RETURN 'Please! give old Password';

END IF;

IF :P15_NEW_PASSWORD IS NULL THEN

 RETURN 'Please! New Password.';

END IF;

IF :P15_CONFIRM_PSSWRD IS NULL THEN

 RETURN 'Please! give Confirm Password.';

END IF;

IF :P15_NEW_PASSWORD<>:P15_CONFIRM_PSSWRD THEN

 RETURN 'Confirm Password doesn''t match with new Password.';

END IF;

--> When Button Pressed : Save

Step-4 : Create Validation

Name-->  wrong_validation

Type--> PL/SQL Function Body Returning Error Text


DECLARE

  CURSOR C IS SELECT USERNAME,PSSWRD FROM USER_INFO

  WHERE USERNAME=:P15_USERNAME;

  R   C%ROWTYPE;

BEGIN

 OPEN     C;

 FETCH    C

 INTO     R; 

 CLOSE    C;

IF r.USERNAME IS NULL  THEN

RETURN 'Username is wrong!.';

END IF;

IF R.PSSWRD!=:P15_PSSWRD  THEN

RETURN 'Old Password is wrong!';

END IF;

end;

--> When Button Pressed : Save

==========================================


New Application Change password



Step-1:
Create a new form : User Profile Update

All Item Default SQL query set Without Password.

As Like --> Name Item Default SQL query :

select       NAME
From UMS_USER_LOGING
where id=:GUSER_ID

As Like --> ID Item Default SQL query :

Select     ID 
from UMS_USER_LOGING
where id=:GUSER_ID

Step-2:

    Create a New Item OLD_PASSWORD for the previous Matching.

Validation on OLD_PASSWORD :

Type--> PL/SQL Function Body Returning Error Text

DECLARE

  CURSOR C IS SELECT LOGIN, PASSWORD FROM UMS_USER_LOGING

  WHERE id=:P32_ID;

  R   C%ROWTYPE;

BEGIN

 OPEN     C;

 FETCH    C

 INTO     R; 

 CLOSE    C;

IF r.LOGIN IS NULL  THEN

RETURN 'Username is wrong!.';

END IF;


IF R.PASSWORD!=:P32_OLD_PASSWORD  THEN

RETURN 'Old Password is wrong!';

END IF;


end;


--> When Button Pressed : Save

Step-3:

You set the Default process never.

Create a new Update process.

update UMS_USER_LOGING set

      LOGIN=:P309_LOGIN,

      PASSWORD=:P309_PASSWORD,

       NAME=:P309_NAME,

       EMAIL=:P309_EMAIL  ,

       PHONE_NUMBER=:P309_PHONE_NUMBER     

  where id=:P309_ID;


  apex_application.g_print_success_message := '<span>'||:P309_NAME||' You Profile updated successfully.'||'</span>';


--> When Button Pressed : Save


Step-4:

--> Show Navigation



Go to Shared Components --> Navigation Bar List --> Navigation Bar--> Create Entry: Update Profile

Parent List Entry : &APP_USER


Post a Comment

Previous Post Next Post