+ /** convert epoch time function to No of days @public */
+ public converEpochToDays(date: string): number {
+ if (!isNullOrUndefined(date)) {
+ const today: Date = new Date();
+ const accountDate: Date = new Date(date);
+ return Math.floor((accountDate.getTime() -
+ today.getTime()) / this.epochTime1000 / this.epochTime60 / this.epochTime60 / this.epochTime24);
+ }
+ return this.translateService.instant('N/A');
+ }
+
+ /** show toaster for password & account expiry @public */
+ public showToaster(lastLogin: string, failedAttempts: string, passwordNoOfDays: string,
+ accountNoOfDays: string, passwordExpireMessage: string, accountExpireMessage: string,
+ passwordMessage: string, accountMessage: string): ActiveToast<string> {
+ this.lastLoginMessage = this.translateService.instant('PAGE.LOGIN.LASTACCESS');
+ this.failedAttemptsMessage = this.translateService.instant('PAGE.LOGIN.FAILED');
+ return this.toaster.info(this.lastLoginMessage + ':' + ' ' + lastLogin +
+ '</br>' + this.failedAttemptsMessage + ':' + ' ' + failedAttempts +
+ '</br>' + passwordExpireMessage + ' ' + passwordNoOfDays + ' ' + passwordMessage +
+ '</br>' + accountExpireMessage + ' ' + accountNoOfDays + ' ' + accountMessage,
+ this.translateService.instant('PAGE.LOGIN.LOGINHISTORY'), this.toasterSettings);
+ }
+
+ /** show toaster for password expiry @public */
+ public passwordToaster(lastLogin: string, failedAttempts: string, passwordNoOfDays: string,
+ passwordExpireMessage: string, passwordMessage: string): ActiveToast<string> {
+ this.lastLoginMessage = this.translateService.instant('PAGE.LOGIN.LASTACCESS');
+ this.failedAttemptsMessage = this.translateService.instant('PAGE.LOGIN.FAILED');
+ return this.toaster.info(this.lastLoginMessage + ':' + ' ' + lastLogin +
+ '</br>' + this.failedAttemptsMessage + ':' + ' ' + failedAttempts +
+ '</br>' + passwordExpireMessage + ' ' + passwordNoOfDays + ' ' + passwordMessage,
+ this.translateService.instant('PAGE.LOGIN.LOGINHISTORY'), this.toasterSettings);
+ }
+
+ /** show toaster for account expiry @public */
+ public accountToaster(lastLogin: string, failedAttempts: string,
+ accountNoOfDays: string, accountExpireMessage: string, accountMessage: string): ActiveToast<string> {
+ this.lastLoginMessage = this.translateService.instant('PAGE.LOGIN.LASTACCESS');
+ this.failedAttemptsMessage = this.translateService.instant('PAGE.LOGIN.FAILED');
+ return this.toaster.info(this.lastLoginMessage + ':' + ' ' + lastLogin +
+ '</br>' + this.failedAttemptsMessage + ':' + ' ' + failedAttempts +
+ '</br>' + accountExpireMessage + ' ' + accountNoOfDays + ' ' + accountMessage,
+ this.translateService.instant('PAGE.LOGIN.LOGINHISTORY'), this.toasterSettings);
+ }
+