/** * * customLoginPageJavascriptView * * brandon.longworth 12/02/2022 * * stokareva - 06/05/2023 - USMSPBA-5896 - During login, when Default User Role is Appellant, Agency Representative, or Appellant Representative, and "Service Method" from Person BTO is (U.S. Mail or blank) display a message and do not allow user to log in. **/ var requiredIcon = jQuery('Required'); jQuery(document).ready( function() { if(!(window.location.pathname.endsWith('login.request.do') && window.location.search === '?action=normal')){ setupLoginLook(); } if(window.location.pathname.endsWith('login.request.do') && window.location.search === '?action=normal'){ jQuery('body').css('align-items', 'center') } else if(window.location.pathname.endsWith('login.request.do') && window.location.search === '?action=login'){ setupLoginSection(); } else if(window.location.pathname.endsWith('login.request.do') && window.location.search === '?action=usernameRecovery'){ setupUsernameRecoverySection(); } else if(window.location.pathname.endsWith('login.request.do')){ setupInitialChoices(); } else if(window.location.pathname.endsWith('login.submit.do')) { setupLoginSection(); } else if(window.location.pathname.endsWith('login.reset.password.do') || window.location.pathname.endsWith('login.reset.password.do') || window.location.pathname.endsWith('login.reset.password.request.do') || window.location.pathname.endsWith('login.reset.password.change.request.do') || window.location.pathname.endsWith('login.enter.reset.code.do')) { setupPasswordResetSection(); } else if(window.location.pathname.endsWith('enforce.update.password.request.do') || window.location.pathname.endsWith('enforce.update.password.submit.do')) { setupPasswordExpirationSection(); } // USMSPBA-7208 if( window.location.href.indexOf("https://portal-eappeal.mspb.gov/") === -1 ) { if( jQuery("#signonFailure").text().indexOf("maximum number of concurrent") > -1 || (jQuery("#maxUsersFailure").length > 0 && jQuery("#maxUsersFailure").text().indexOf("maximum number of concurrent") > -1) ) { jQuery("#login-errors").hide(); } } }); function setupInitialChoices() { jQuery('form[name="signonForm"]').remove(); jQuery('#policy').after(jQuery('
' + ' ' + ' ' + ' ' + ' ' + ' ' + '
' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + '

New Users

Setup your account here. You must complete this one-time process if this is your first time accessing MSPB\'s new e-Appeal.

' + '
' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + '

Returning Users

Log in here if you have previously registered for an account in MSPB\'s new e-Appeal or are completing your account setup.

' + '
' + '
')); jQuery('body').append(jQuery('')); addSWB(); } function setupLoginSection() { jQuery('#policy').after(jQuery('
')); jQuery('#loginDiv').append(jQuery('

Returning Users

')); if(jQuery('p[class="error"]').length){ jQuery('#loginDiv').append(jQuery('#login-errors')); } jQuery('label[for="username"] span').after(requiredIcon.clone()); jQuery('label[for="password"] span').after(requiredIcon.clone()); jQuery('#loginDiv').append(jQuery('form[name="signonForm"]')); jQuery('#username').after(jQuery('Forgot username?')); jQuery('#password').after(jQuery('#ResetPassword')); jQuery('#ResetPassword').text('Forgot password?'); jQuery('#submit').val('Log in'); jQuery('#submit').parent().css('margin', '0px'); jQuery('#submit').parent().before(jQuery('
')); jQuery('#buttons').append(jQuery('#submit').parent()); jQuery('#submit').after(''); //USMSPBA-5896 jQuery('#submit').hide(); //USMSPBA-5896 //jQuery('#submit').after(jQuery('
Need help?')); } function setupUsernameRecoverySection() { jQuery('form[name="signonForm"]').remove(); jQuery('#content').css('height', 'auto'); jQuery('#policy').after(jQuery('

Forgot Username

' + '
' + '

Please enter your email address in order to recover your username.

' + '' + '
' + '

' + ' ' + '

' + '
' + ' ' + ' ' + '
' + '
' + '
')); jQuery('#policy').remove(); jQuery('label[for="emailAddress"] span').after(requiredIcon.clone()); } function setupPasswordResetSection() { if(jQuery('[name="signonForm"]').length){ setupLoginSection(); jQuery('#loginDiv').before(jQuery('
' + ' ' + '
').append(jQuery('').append(jQuery('b:contains("Your password")')))); return; } jQuery('#content').css('height', 'auto'); jQuery('#resetPassword').before(jQuery('

Forgot Password

')); var contentFormName = ''; if(jQuery('[name="requestPasswordRequestform"]').length){ contentFormName = 'requestPasswordRequestform'; } else if(jQuery('[name="enterResetCodeForm"]').length) { contentFormName = 'enterResetCodeForm'; } if(jQuery('p[class="error"]').length){ jQuery('[name="' + contentFormName + '"]').before(jQuery('#login-errors')); } jQuery('#resetPassword').append(jQuery('
')); jQuery('#contentDiv').append(jQuery('[name="' + contentFormName + '"]')); jQuery('#submit').parent().before(jQuery('
')); jQuery('#buttons').append(jQuery('#submit').parent()); jQuery('#submit').parent().append(jQuery('#submit')); jQuery('#submit').parent().children().first().addClass('formButton_secondary') jQuery('#submit').parent().children().first().attr('onclick', 'javascript:location.href="login.request.do?action=login"'); jQuery('label[for="username"] span').after(requiredIcon.clone()); jQuery('label[for="code"] span').after(requiredIcon.clone()); jQuery('label[for="password"] span').after(requiredIcon.clone()); jQuery('label[for="confirmPassword"] span').after(requiredIcon.clone()); if(contentFormName == 'requestPasswordRequestform'){ jQuery('#contentDiv').css('height', '190px'); jQuery('#resetPassword').children().first().text('Please enter your username in order to restore your password'); jQuery('#username').after(jQuery('If you already have a reset code click here to complete your password reset')); } else if (contentFormName == 'enterResetCodeForm'){ jQuery('#contentDiv').css('height', '390px'); } else { jQuery('#contentDiv').remove(); } } function setupPasswordExpirationSection() { jQuery('#login').before(jQuery('
')); jQuery('#login-notice').append(jQuery('#login')); jQuery('#content').css('height', 'auto'); jQuery('[name="passwordForm"]').before(jQuery('

Password Expiration

')); jQuery('[name="passwordForm"]').before(jQuery('
')); jQuery('#passwordExpired').append(jQuery('p:contains("This password has expired.")')); jQuery('#passwordExpired').append(jQuery('p:contains("Password should be at least")')); jQuery('#passwordExpired').append(jQuery('
')); jQuery('#contentDiv').append(jQuery('[name="passwordForm"]')); jQuery('[name="passwordForm"] br').remove(); jQuery('label[for="passwordCurrent"] span').after(requiredIcon.clone()); jQuery('label[for="password"] span').after(requiredIcon.clone()); jQuery('label[for="passwordConfirm"] span').after(requiredIcon.clone()); jQuery('[type="submit"]').parent().before(jQuery('
')); jQuery('#buttons').append(jQuery('[type="submit"]').parent()); jQuery('[type="submit"]').parent().append(jQuery('[type="submit"]')); jQuery('[type="submit"]').parent().children().first().addClass('formButton_secondary') jQuery('[type="submit"]').parent().children().first().attr('onclick', 'javascript:location.href="login.request.do?action=login"'); if(jQuery('[class="validationError"]').length){ jQuery('#contentDiv').before(jQuery('
' + '
' + ' ' + ' ' + ' ' + ' ' + ' Validation Errors' + '
' + '
    ' + '
' + '
')); jQuery('[class="validationError"]').each(function(){ jQuery('#errors').append(jQuery('
  • ').append(this)); }); } } //USMSPBA-5896 function checkIfEfiler(){ if(jQuery('#login-errors').length == 0){ var errorDiv = '
    ' + '
    ' + ' ' + ' Validation Errors ' + '
    ' + '
      ' + '
    • ' + '

      ' + '
    • ' + '
    ' + '
    '; jQuery('.sectionHeader').after(errorDiv); } jQuery('#signonFailure').text(''); jQuery('#login-errors').hide(); jQuery.ajax({ type: "POST", url : "page.request.do?page=page.public.ajax.checkIfEfiler", data: { username: jQuery('#username').val() }, cache: false, dataType: 'json' }).done(function(data) { if(!data.isEfiler) { jQuery('#signonFailure').text('You are not authorized to access the MSPB e-Appeal system because you are not currently registered as an e-Filer with MSPB. Please review the MSPB e-Appeal: FAQ on the MSPB website for additional information.'); jQuery('#login-errors').show(); } else { jQuery("#submit").click(); } }).fail(function(e) { console.log(e); }); } function recoverUsername() { jQuery('#errors').text(''); jQuery('#login-errors').hide(); if(jQuery('#emailAddress').val() === ''){ jQuery('#errors').text('Email Address is required to recover username'); jQuery('#login-errors').show(); } else { jQuery.ajax({ type: "POST", url : "page.request.do?page=page.public.ajax.usernameRecovery", data: { emailAddress: jQuery('#emailAddress').val() }, cache: false, dataType: 'json' }).done(function(data) { if(data.result === "error") { jQuery('#errors').text('An error occurred when attempting to recover your username. Please contact a system administrator for assistance.'); jQuery('#login-errors').show(); } else if (data.result === "fail") { jQuery('#errors').text('No username was found for the provided email.'); jQuery('#login-errors').show(); } else if (data.result === "success") { jQuery('#login-errors').before(jQuery('

    An email was sent to you with your username. Click here to return to the login page.

    ')); jQuery('#inputDiv').hide(); } }).fail(function(e) { console.log(e); }); } } function showModal(action){ EtkFormDialog.loadCustomDialog("Security Policy - Warning", jQuery('#securityModal'), function(){ jQuery('#securityModal').show(); }, function(){ jQuery('body').append(jQuery('#securityModal')); jQuery('#securityModal').hide(); }, 'small', { buttons: [ { text: "Acknowledge", style: "background: #0066cc; color: white; font-weight:500; border: none; border-radius: 2px; padding: 0 20px; height: 36px;", click: function() { if(action === 'register'){ window.open('page.request.do?page=page.public.efileUserRegistration', '_self'); } else if (action === 'login'){ window.open('login.request.do?action=login', '_self'); } } }, ], position: {my: "top+30px", at: "top", of: window} }); } function setupLoginLook() { addHeaderFooter(); jQuery('#content').addClass('loginBody'); jQuery('#login-notice').addClass('loginMainContent'); jQuery('#login').addClass('flexDiv'); jQuery('input').attr('placeholder', ''); jQuery('#policyFrame').remove(); jQuery('#policy').append(jQuery('Welcome to e-Appeal, the e-filing and case management system for U.S. Merit Systems Protection Board (MSPB). e-Appeal enables individuals to file new appeals and for parties to an appeal to file pleadings and view the electronic case record, including issuances from MSPB.')); jQuery('#security-notice').remove(); jQuery('#logo').remove(); jQuery('#app-title').remove(); jQuery('p:contains("Password should be at least")').removeClass("error"); jQuery('p:contains("This password has expired.")').removeClass("error"); if(jQuery('p[class="error"]').length){ jQuery('p[class="error"]').after(jQuery('
    ' + '
    ' + ' ' + ' ' + ' ' + ' ' + ' Validation Errors' + '
    ' + '
      ' + '
    • ' + '
    • ' + '
    ' + '
    ')); jQuery('#errors').append(jQuery('p[class="error"]')); } } function addHeaderFooter() { jQuery('#content').before(jQuery('
    ')) jQuery('#content').after(jQuery('
    ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + '
    ' + '
    ' + ' MSPB Logo' + ' U.S. Merit Systems Protection Board' + '
    ' + ' ' + '
    ' /*+ ' ' + ' ' + ' ' + ' ' + ' ' + '
    ' + ' ' + ' ' + ' ' + ' ' + ' ' + '
    ' + ' MSPB Logo' + ' ' + ' U.S. Merit System Protection Board' + '
    ' + '
    ' + ' Agency Contact Center
    ' + ' (202) 653-7200 mspb@mspb.gov' + '
    '*/ + '
    ')) } function addSWB() { jQuery('#login').prepend('
    '); jQuery('#login').prepend('