Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wordfenc.../lib
File: menu_tools_twoFactor.php
<?php
[0] Fix | Delete
if (!defined('WORDFENCE_VERSION')) { exit; }
[1] Fix | Delete
[2] Fix | Delete
$helpLink = wfSupportController::supportURL(wfSupportController::ITEM_TOOLS_TWO_FACTOR);
[3] Fix | Delete
[4] Fix | Delete
if (function_exists('network_admin_url') && is_multisite()) {
[5] Fix | Delete
$lsModuleURL = network_admin_url('admin.php?page=WFLS');
[6] Fix | Delete
}
[7] Fix | Delete
else {
[8] Fix | Delete
$lsModuleURL = admin_url('admin.php?page=WFLS');
[9] Fix | Delete
}
[10] Fix | Delete
[11] Fix | Delete
echo wfView::create('common/section-title', array(
[12] Fix | Delete
'title' => __('Two-Factor Authentication', 'wordfence'),
[13] Fix | Delete
'helpLink' => $helpLink,
[14] Fix | Delete
'helpLabelHTML' => wp_kses(__('Learn more<span class="wf-hidden-xs"> about Two-Factor Authentication</span>', 'wordfence'), array('span'=>array('class'=>array()))),
[15] Fix | Delete
))->render();
[16] Fix | Delete
?>
[17] Fix | Delete
[18] Fix | Delete
<script type="application/javascript">
[19] Fix | Delete
(function($) {
[20] Fix | Delete
$(function() {
[21] Fix | Delete
document.title = "<?php esc_attr_e('Two-Factor Authentication', 'wordfence'); ?>" + " \u2039 " + WFAD.basePageName;
[22] Fix | Delete
});
[23] Fix | Delete
})(jQuery);
[24] Fix | Delete
</script>
[25] Fix | Delete
[26] Fix | Delete
<div id="wordfenceMode_twoFactor"></div>
[27] Fix | Delete
[28] Fix | Delete
<div id="wf-tools-two-factor">
[29] Fix | Delete
<?php if (wfCredentialsController::useLegacy2FA()): ?>
[30] Fix | Delete
<div class="wf-row">
[31] Fix | Delete
<div class="wf-col-xs-12">
[32] Fix | Delete
<div id="wordfenceTwoFactorLegacy">
[33] Fix | Delete
<p><strong><?php esc_html_e('2FA Mode: Legacy', 'wordfence') ?>.</strong> <?php esc_html_e('Two-factor authentication is using legacy support, which enables SMS-based codes but is less compatible. An improved interface and use by non-administrators is available by activating the new login security module.', 'wordfence'); ?></p>
[34] Fix | Delete
<p><a id="wf-migrate2fanew-start" class="wf-btn wf-btn-default wf-btn-sm wf-dismiss-link" href="#" role="button"><?php esc_html_e('Switch to New 2FA', 'wordfence'); ?></a></p>
[35] Fix | Delete
</div>
[36] Fix | Delete
</div>
[37] Fix | Delete
</div>
[38] Fix | Delete
<?php if (!wfConfig::get('isPaid')): ?>
[39] Fix | Delete
<div class="wf-premium-callout wf-add-bottom">
[40] Fix | Delete
<h3><?php esc_html_e("Take Login Security to the next level with Two-Factor Authentication", 'wordfence') ?></h3>
[41] Fix | Delete
<p><?php echo wp_kses(__('Used by banks, government agencies, and military worldwide, two-factor authentication is one of the most secure forms of remote system authentication available. With it enabled, an attacker needs to know your username, password, <em>and</em> have control of your phone to log into your site. Upgrade to Premium now to enable this powerful feature.', 'wordfence'), array('em'=>array())) ?></p>
[42] Fix | Delete
[43] Fix | Delete
<p class="wf-nowrap">
[44] Fix | Delete
<img id="wf-two-factor-img1" src="<?php echo wfUtils::getBaseURL() . 'images/2fa1.svg' ?>" alt="">
[45] Fix | Delete
<img id="wf-two-factor-img2" src="<?php echo wfUtils::getBaseURL() . 'images/2fa2.svg' ?>" alt="">
[46] Fix | Delete
</p>
[47] Fix | Delete
[48] Fix | Delete
<p class="center">
[49] Fix | Delete
<a class="wf-btn wf-btn-primary wf-btn-callout" href="https://www.wordfence.com/gnl1twoFac1/wordfence-signup/" target="_blank" rel="noopener noreferrer"><?php esc_html_e('Upgrade to Premium', 'wordfence') ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a>
[50] Fix | Delete
</p>
[51] Fix | Delete
</div>
[52] Fix | Delete
[53] Fix | Delete
<?php else: ?>
[54] Fix | Delete
<div class="wf-row">
[55] Fix | Delete
<div class="wf-col-xs-12 wf-flex-row">
[56] Fix | Delete
<div class="wf-flex-row-1">
[57] Fix | Delete
<p><?php echo wp_kses(__('With Two-Factor Authentication enabled, an attacker needs to know your username, password <em>and</em> have control of your phone to log in to your site. We recommend you enable Two-Factor Authentication for all Administrator level accounts.', 'wordfence'), array('em'=>array())) ?></p>
[58] Fix | Delete
</div>
[59] Fix | Delete
<div class="wf-flex-row-0 wf-padding-add-left">
[60] Fix | Delete
<?php
[61] Fix | Delete
echo wfView::create('options/block-controls', array(
[62] Fix | Delete
'suppressLogo' => true,
[63] Fix | Delete
'restoreDefaultsSection' => wfConfig::OPTIONS_TYPE_TWO_FACTOR,
[64] Fix | Delete
'restoreDefaultsMessage' => __('Are you sure you want to restore the default Two-Factor Authentication settings? This will undo any custom changes you have made to the options on this page. If you have configured any users to use two-factor authentication, they will not be changed.', 'wordfence'),
[65] Fix | Delete
))->render();
[66] Fix | Delete
?>
[67] Fix | Delete
</div>
[68] Fix | Delete
</div>
[69] Fix | Delete
</div>
[70] Fix | Delete
[71] Fix | Delete
<div class="wf-row">
[72] Fix | Delete
<div class="wf-col-xs-12">
[73] Fix | Delete
<div class="wf-block wf-active">
[74] Fix | Delete
<?php if (!wfConfig::get('loginSecurityEnabled')): ?>
[75] Fix | Delete
<ul class="wf-block-banner">
[76] Fix | Delete
<li><?php echo wp_kses(__('<strong>Note:</strong> Two-Factor Authentication is disabled when the option "Enable Brute Force Protection" is off.', 'wordfence'), array('strong'=>array())); ?></li>
[77] Fix | Delete
<li><a href="#" class="wf-btn wf-btn-default" id="wf-2fa-enable" role="button"><?php esc_html_e('Turn On', 'wordfence'); ?></a></li>
[78] Fix | Delete
</ul>
[79] Fix | Delete
<?php endif; ?>
[80] Fix | Delete
<div class="wf-block-header">
[81] Fix | Delete
<div class="wf-block-header-content">
[82] Fix | Delete
<div class="wf-block-title">
[83] Fix | Delete
<strong><?php esc_html_e('Enable Two-Factor Authentication', 'wordfence') ?></strong>
[84] Fix | Delete
</div>
[85] Fix | Delete
</div>
[86] Fix | Delete
</div>
[87] Fix | Delete
<div class="wf-block-content">
[88] Fix | Delete
<ul class="wf-block-list">
[89] Fix | Delete
<li>
[90] Fix | Delete
<ul class="wf-form-field">
[91] Fix | Delete
<li style="width: 450px;" class="wf-option-text">
[92] Fix | Delete
<input placeholder="<?php echo esc_attr(__('Enter username to enable Two-Factor Authentication for', 'wordfence')) ?>" type="text" id="wfUsername" class="wf-form-control" value="">
[93] Fix | Delete
</li>
[94] Fix | Delete
</ul>
[95] Fix | Delete
</li>
[96] Fix | Delete
<li>
[97] Fix | Delete
<ul class="wf-form-field">
[98] Fix | Delete
<li>
[99] Fix | Delete
<input class="wf-option-radio" type="radio" name="wf2faMode" id="wf2faMode-authenticator" value="authenticator" checked>
[100] Fix | Delete
<label for="wf2faMode-authenticator">&nbsp;&nbsp;</label>
[101] Fix | Delete
</li>
[102] Fix | Delete
<li class="wf-option-title"><?php esc_html_e('Use authenticator app', 'wordfence') ?></li>
[103] Fix | Delete
</ul>
[104] Fix | Delete
</li>
[105] Fix | Delete
<li>
[106] Fix | Delete
<ul class="wf-form-field">
[107] Fix | Delete
<li>
[108] Fix | Delete
<input class="wf-option-radio" type="radio" name="wf2faMode" id="wf2faMode-phone" value="phone">
[109] Fix | Delete
<label for="wf2faMode-phone">&nbsp;&nbsp;</label>
[110] Fix | Delete
</li>
[111] Fix | Delete
<li class="wf-option-title"><?php esc_html_e('Send code to a phone number:', 'wordfence') ?>&nbsp;&nbsp;</li>
[112] Fix | Delete
<li class="wf-option-text">
[113] Fix | Delete
<input class="wf-form-control" type="text" value="" id="wfPhone" placeholder="<?php echo esc_attr(__('+1 (000) 000 0000', 'wordfence')) ?>">
[114] Fix | Delete
</li>
[115] Fix | Delete
</ul>
[116] Fix | Delete
[117] Fix | Delete
</li>
[118] Fix | Delete
<li>
[119] Fix | Delete
<p>
[120] Fix | Delete
<input type="button" class="wf-btn wf-btn-primary pull-right" value="Enable User" onclick="WFAD.addTwoFactor(jQuery('#wfUsername').val(), jQuery('#wfPhone').val(), jQuery('input[name=wf2faMode]:checked').val());">
[121] Fix | Delete
</p>
[122] Fix | Delete
</li>
[123] Fix | Delete
[124] Fix | Delete
</ul>
[125] Fix | Delete
[126] Fix | Delete
</div>
[127] Fix | Delete
</div>
[128] Fix | Delete
</div>
[129] Fix | Delete
</div>
[130] Fix | Delete
<div class="wf-row">
[131] Fix | Delete
<div class="wf-col-xs-12">
[132] Fix | Delete
<h2><?php esc_html_e('Two-Factor Authentication Users', 'wordfence') ?></h2>
[133] Fix | Delete
[134] Fix | Delete
<div id="wfTwoFacUsers"></div>
[135] Fix | Delete
</div>
[136] Fix | Delete
</div>
[137] Fix | Delete
<?php
[138] Fix | Delete
echo wfView::create('tools/options-group-2fa', array(
[139] Fix | Delete
'stateKey' => 'wf-2fa-options',
[140] Fix | Delete
))->render();
[141] Fix | Delete
?>
[142] Fix | Delete
[143] Fix | Delete
<script type="text/javascript">
[144] Fix | Delete
jQuery('.twoFactorOption').on('click', function() {
[145] Fix | Delete
WFAD.updateConfig(jQuery(this).attr('name'), jQuery(this).is(':checked') ? 1 : 0, function() {
[146] Fix | Delete
[147] Fix | Delete
});
[148] Fix | Delete
});
[149] Fix | Delete
[150] Fix | Delete
jQuery('input[name=wf2faMode]').on('change', function() {
[151] Fix | Delete
var selectedMode = jQuery('input[name=wf2faMode]:checked').val();
[152] Fix | Delete
jQuery('#wfPhone').prop('disabled', selectedMode != 'phone');
[153] Fix | Delete
}).triggerHandler('change');
[154] Fix | Delete
[155] Fix | Delete
(function($) {
[156] Fix | Delete
$(function() {
[157] Fix | Delete
$('#wf-2fa-enable').on('click', function(e) {
[158] Fix | Delete
e.preventDefault();
[159] Fix | Delete
e.stopPropagation();
[160] Fix | Delete
[161] Fix | Delete
WFAD.setOption('loginSecurityEnabled', 1, function() {
[162] Fix | Delete
window.location.reload(true);
[163] Fix | Delete
});
[164] Fix | Delete
});
[165] Fix | Delete
});
[166] Fix | Delete
})(jQuery);
[167] Fix | Delete
</script>
[168] Fix | Delete
[169] Fix | Delete
<script type="text/x-jquery-template" id="wfTwoFacUserTmpl">
[170] Fix | Delete
<table class="wf-striped-table wf-table-twofactor">
[171] Fix | Delete
<thead>
[172] Fix | Delete
<tr>
[173] Fix | Delete
<th><?php esc_html_e('User', 'wordfence') ?></th>
[174] Fix | Delete
<th><?php esc_html_e('Mode', 'wordfence') ?></th>
[175] Fix | Delete
<th><?php esc_html_e('Status', 'wordfence') ?></th>
[176] Fix | Delete
<th class="wf-center"><?php esc_html_e('Delete', 'wordfence') ?></th>
[177] Fix | Delete
</tr>
[178] Fix | Delete
</thead>
[179] Fix | Delete
<tbody>
[180] Fix | Delete
{{each(idx, user) users}}
[181] Fix | Delete
<tr id="twoFactorUser-${user.userID}">
[182] Fix | Delete
<td style="white-space: nowrap;">${user.username}</td>
[183] Fix | Delete
{{if user.mode == 'phone'}}
[184] Fix | Delete
<td style="white-space: nowrap;"><?php echo esc_html(sprintf(/* translators: Phone number. */ __('Phone (%s)', 'wordfence'), '${user.phone}')) ?></td>
[185] Fix | Delete
{{else}}
[186] Fix | Delete
<td style="white-space: nowrap;"><?php esc_html_e('Authenticator', 'wordfence') ?></td>
[187] Fix | Delete
{{/if}}
[188] Fix | Delete
<td style="white-space: nowrap;">
[189] Fix | Delete
{{if user.status == 'activated'}}
[190] Fix | Delete
<span style="color: #0A0;"><?php esc_html_e('Cellphone Sign-in Enabled', 'wordfence') ?></span>
[191] Fix | Delete
{{else}}
[192] Fix | Delete
<div class="wf-form-inline">
[193] Fix | Delete
<div class="wf-form-group">
[194] Fix | Delete
<label class="wf-plain wf-hidden-xs" style="margin: 0;" for="wfActivate-${user.userID}"><?php esc_html_e('Enter activation code:', 'wordfence') ?></label>
[195] Fix | Delete
<input class="wf-form-control" type="text" id="wfActivate-${user.userID}" size="6" placeholder="<?php esc_attr_e('Code', 'wordfence') ?>">
[196] Fix | Delete
</div>
[197] Fix | Delete
<input class="wf-btn wf-btn-default" type="button" value="<?php esc_attr_e('Activate', 'wordfence') ?>" onclick="WFAD.twoFacActivate('${user.userID}', jQuery('#wfActivate-${user.userID}').val());">
[198] Fix | Delete
</div>
[199] Fix | Delete
{{/if}}
[200] Fix | Delete
</td>
[201] Fix | Delete
<td style="white-space: nowrap; text-align: center;" class="wf-twofactor-delete">
[202] Fix | Delete
<a href="#" onclick="WFAD.delTwoFac('${user.userID}'); return false;" role="button"><i class="wf-ion-ios-trash-outline"></i></a>
[203] Fix | Delete
</td>
[204] Fix | Delete
</tr>
[205] Fix | Delete
{{/each}}
[206] Fix | Delete
{{if (users.length == 0)}}
[207] Fix | Delete
<tr id="twoFactorUser-none">
[208] Fix | Delete
<td colspan="4"><?php esc_html_e('No users currently have cellphone sign-in enabled.', 'wordfence') ?></td>
[209] Fix | Delete
</tr>
[210] Fix | Delete
{{/if}}
[211] Fix | Delete
</tbody>
[212] Fix | Delete
</table>
[213] Fix | Delete
</script>
[214] Fix | Delete
<?php endif; ?>
[215] Fix | Delete
<?php else: ?>
[216] Fix | Delete
<div class="wf-row">
[217] Fix | Delete
<div class="wf-col-xs-12">
[218] Fix | Delete
<div id="wordfenceTwoFactorModern">
[219] Fix | Delete
<p><strong><?php esc_html_e('2FA Mode: Normal', 'wordfence') ?>.</strong> <?php esc_html_e('Legacy support for SMS-based two-factor authentication is being phased out, as it is less secure than using a modern authenticator app.', 'wordfence') ?></p>
[220] Fix | Delete
<p><?php esc_html_e('If you have a conflict with the new 2FA method, you can temporarily switch back to the Legacy version.', 'wordfence'); ?></p>
[221] Fix | Delete
<p><a id="wf-migrate2faold-start" class="wf-btn wf-btn-default wf-btn-sm wf-dismiss-link" href="#" role="button"><?php esc_html_e('Revert to Legacy 2FA', 'wordfence'); ?></a></p>
[222] Fix | Delete
</div>
[223] Fix | Delete
</div>
[224] Fix | Delete
</div>
[225] Fix | Delete
<?php endif; ?>
[226] Fix | Delete
</div>
[227] Fix | Delete
<script type="text/x-jquery-template" id="wfTmpl_migrate2FANew">
[228] Fix | Delete
<?php
[229] Fix | Delete
echo wfView::create('common/modal-prompt', array(
[230] Fix | Delete
'title' => __('Migrate or switch to new two-factor authentication?', 'wordfence'),
[231] Fix | Delete
'message' => __('Use the buttons below to migrate to the new two-factor authentication system or switch without migration. Migration will copy all existing authenticator-based user activations over to the new system while switching will use only users already set up in the new system. Existing SMS-based two-factor authentication activations must be disabled prior to migration.', 'wordfence'),
[232] Fix | Delete
'primaryButton' => array('id' => 'wf-migrate2fanew-prompt-confirm', 'label' => __('Migrate', 'wordfence'), 'link' => '#'),
[233] Fix | Delete
'secondaryButtons' => array(array('id' => 'wf-migrate2fanew-prompt-switch', 'label' => __('Switch', 'wordfence'), 'link' => '#'), array('id' => 'wf-migrate2fanew-prompt-cancel', 'label' => __('Cancel', 'wordfence'), 'link' => '#')),
[234] Fix | Delete
'progressIndicator' => 'wf-migrate2fanew-progress',
[235] Fix | Delete
))->render();
[236] Fix | Delete
?>
[237] Fix | Delete
</script>
[238] Fix | Delete
<script type="text/x-jquery-template" id="wfTmpl_migrate2FANewComplete">
[239] Fix | Delete
<?php
[240] Fix | Delete
echo wfView::create('common/modal-prompt', array(
[241] Fix | Delete
'title' => __('New Two-Factor Authentication Active', 'wordfence'),
[242] Fix | Delete
'message' => __('Your site is now using the new login security module and two-factor authentication. Before logging out, we recommend testing your login in a different browser or a private/incognito window. If any plugins or your theme cause conflicts with logging in, you can revert to the old 2FA method.', 'wordfence'),
[243] Fix | Delete
'primaryButton' => array('id' => 'wf-migrate2fanewcomplete-prompt-navigate', 'label' => __('Go To New 2FA', 'wordfence'), 'link' => $lsModuleURL),
[244] Fix | Delete
'secondaryButtons' => array(array('id' => 'wf-migrate2fanewcomplete-prompt-close', 'label' => __('Close', 'wordfence'), 'link' => '#')),
[245] Fix | Delete
))->render();
[246] Fix | Delete
?>
[247] Fix | Delete
</script>
[248] Fix | Delete
<script type="text/x-jquery-template" id="wfTmpl_migrate2FASMSActive">
[249] Fix | Delete
<?php
[250] Fix | Delete
echo wfView::create('common/modal-prompt', array(
[251] Fix | Delete
'title' => __('Migration Cannot Proceed', 'wordfence'),
[252] Fix | Delete
'message' => __('One or more users with two-factor authentication active are using SMS, which is unsupported in the new login security module. Please either deactivate two-factor authentication for those users or change them to use an authenticator app prior to migration.', 'wordfence'),
[253] Fix | Delete
'primaryButton' => array('id' => 'wf-migrate2fasmsactive-prompt-close', 'label' => __('Close', 'wordfence'), 'link' => '#'),
[254] Fix | Delete
))->render();
[255] Fix | Delete
?>
[256] Fix | Delete
</script>
[257] Fix | Delete
<script type="text/x-jquery-template" id="wfTmpl_migrate2FANewFail">
[258] Fix | Delete
<?php
[259] Fix | Delete
echo wfView::create('common/modal-prompt', array(
[260] Fix | Delete
'title' => __('Migration Failed', 'wordfence'),
[261] Fix | Delete
'message' => __('Automatic migration of the 2FA-enabled accounts failed. Please verify that your server is reachable via the internet and try again.', 'wordfence'),
[262] Fix | Delete
'primaryButton' => array('id' => 'wf-migrate2fanewfail-prompt-close', 'label' => __('Close', 'wordfence'), 'link' => '#'),
[263] Fix | Delete
))->render();
[264] Fix | Delete
?>
[265] Fix | Delete
</script>
[266] Fix | Delete
<script type="text/x-jquery-template" id="wfTmpl_migrate2FAOld">
[267] Fix | Delete
<?php
[268] Fix | Delete
echo wfView::create('common/modal-prompt', array(
[269] Fix | Delete
'title' => __('Revert back to legacy two-factor authentication?', 'wordfence'),
[270] Fix | Delete
'message' => __('All two-factor authentication settings and users\' codes will revert to your older settings. If any users had set up two-factor authentication after the update, they will no longer have 2FA enabled until you switch to the new version again.', 'wordfence'),
[271] Fix | Delete
'primaryButton' => array('id' => 'wf-migrate2faold-prompt-cancel', 'label' => __('Cancel', 'wordfence'), 'link' => '#'),
[272] Fix | Delete
'secondaryButtons' => array(array('id' => 'wf-migrate2faold-prompt-switch', 'label' => __('Revert', 'wordfence'), 'link' => '#')),
[273] Fix | Delete
'progressIndicator' => 'wf-migrate2faold-progress',
[274] Fix | Delete
))->render();
[275] Fix | Delete
?>
[276] Fix | Delete
</script>
[277] Fix | Delete
<script type="text/x-jquery-template" id="wfTmpl_migrate2FAOldComplete">
[278] Fix | Delete
<?php
[279] Fix | Delete
echo wfView::create('common/modal-prompt', array(
[280] Fix | Delete
'title' => __('Legacy Two-Factor Authentication Active', 'wordfence'),
[281] Fix | Delete
'message' => __('Your site is now using the legacy two-factor authentication system.', 'wordfence'),
[282] Fix | Delete
'primaryButton' => array('id' => 'wf-migrate2faoldcomplete-prompt-close', 'label' => __('Close', 'wordfence'), 'link' => '#'),
[283] Fix | Delete
))->render();
[284] Fix | Delete
?>
[285] Fix | Delete
</script>
[286] Fix | Delete
<script type="application/javascript">
[287] Fix | Delete
(function($) {
[288] Fix | Delete
$(function() {
[289] Fix | Delete
$('#wf-migrate2fanew-start').on('click', function(e) {
[290] Fix | Delete
e.preventDefault();
[291] Fix | Delete
e.stopPropagation();
[292] Fix | Delete
[293] Fix | Delete
var prompt = $('#wfTmpl_migrate2FANew').tmpl();
[294] Fix | Delete
var promptHTML = $("<div />").append(prompt).html();
[295] Fix | Delete
WFAD.colorboxHTML((WFAD.isSmallScreen ? '300px' : '500px'), promptHTML, {overlayClose: false, closeButton: false, className: 'wf-modal', onComplete: function() {
[296] Fix | Delete
$('#wf-migrate2fanew-prompt-cancel').on('click', function(e) {
[297] Fix | Delete
e.preventDefault();
[298] Fix | Delete
e.stopPropagation();
[299] Fix | Delete
[300] Fix | Delete
WFAD.colorboxClose();
[301] Fix | Delete
});
[302] Fix | Delete
[303] Fix | Delete
$('#wf-migrate2fanew-prompt-switch').on('click', function(e) {
[304] Fix | Delete
e.preventDefault();
[305] Fix | Delete
e.stopPropagation();
[306] Fix | Delete
[307] Fix | Delete
$('#wf-migrate2fanew-progress').show();
[308] Fix | Delete
$('#wf-migrate2fanew-prompt-cancel, #wf-migrate2fanew-prompt-confirm').addClass('wf-disabled');
[309] Fix | Delete
[310] Fix | Delete
WFAD.ajax('wordfence_switchTo2FANew', {migrate: false}, function(res) {
[311] Fix | Delete
var prompt = $('#wfTmpl_migrate2FANewComplete').tmpl();
[312] Fix | Delete
var promptHTML = $("<div />").append(prompt).html();
[313] Fix | Delete
WFAD.colorboxClose();
[314] Fix | Delete
setTimeout(function() {
[315] Fix | Delete
WFAD.colorboxHTML((WFAD.isSmallScreen ? '300px' : '500px'), promptHTML, {overlayClose: false, closeButton: false, className: 'wf-modal', onComplete: function() {
[316] Fix | Delete
$('#wf-migrate2fanewcomplete-prompt-close').on('click', function(e) {
[317] Fix | Delete
e.preventDefault();
[318] Fix | Delete
e.stopPropagation();
[319] Fix | Delete
[320] Fix | Delete
window.location.reload();
[321] Fix | Delete
WFAD.colorboxClose();
[322] Fix | Delete
});
[323] Fix | Delete
}});
[324] Fix | Delete
}, 500);
[325] Fix | Delete
});
[326] Fix | Delete
});
[327] Fix | Delete
[328] Fix | Delete
$('#wf-migrate2fanew-prompt-confirm').on('click', function(e) {
[329] Fix | Delete
e.preventDefault();
[330] Fix | Delete
e.stopPropagation();
[331] Fix | Delete
[332] Fix | Delete
$('#wf-migrate2fanew-progress').show();
[333] Fix | Delete
$('#wf-migrate2fanew-prompt-cancel, #wf-migrate2fanew-prompt-confirm').addClass('wf-disabled');
[334] Fix | Delete
[335] Fix | Delete
WFAD.ajax('wordfence_switchTo2FANew', {migrate: true}, function(res) {
[336] Fix | Delete
if (res.ok) {
[337] Fix | Delete
var prompt = $('#wfTmpl_migrate2FANewComplete').tmpl(res);
[338] Fix | Delete
var promptHTML = $("<div />").append(prompt).html();
[339] Fix | Delete
WFAD.colorboxClose();
[340] Fix | Delete
setTimeout(function() {
[341] Fix | Delete
WFAD.colorboxHTML((WFAD.isSmallScreen ? '300px' : '500px'), promptHTML, {overlayClose: false, closeButton: false, className: 'wf-modal', onComplete: function() {
[342] Fix | Delete
$('#wf-migrate2fanewcomplete-prompt-close').on('click', function(e) {
[343] Fix | Delete
e.preventDefault();
[344] Fix | Delete
e.stopPropagation();
[345] Fix | Delete
[346] Fix | Delete
WFAD.colorboxClose();
[347] Fix | Delete
});
[348] Fix | Delete
}});
[349] Fix | Delete
}, 500);
[350] Fix | Delete
}
[351] Fix | Delete
else if (res.smsActive) {
[352] Fix | Delete
var prompt = $('#wfTmpl_migrate2FASMSActive').tmpl();
[353] Fix | Delete
var promptHTML = $("<div />").append(prompt).html();
[354] Fix | Delete
WFAD.colorboxClose();
[355] Fix | Delete
setTimeout(function() {
[356] Fix | Delete
WFAD.colorboxHTML((WFAD.isSmallScreen ? '300px' : '500px'), promptHTML, {overlayClose: false, closeButton: false, className: 'wf-modal', onComplete: function() {
[357] Fix | Delete
$('#wf-migrate2fasmsactive-prompt-close').on('click', function(e) {
[358] Fix | Delete
e.preventDefault();
[359] Fix | Delete
e.stopPropagation();
[360] Fix | Delete
[361] Fix | Delete
WFAD.colorboxClose();
[362] Fix | Delete
});
[363] Fix | Delete
}});
[364] Fix | Delete
}, 500);
[365] Fix | Delete
}
[366] Fix | Delete
else {
[367] Fix | Delete
var prompt = $('#wfTmpl_migrate2FANewFail').tmpl();
[368] Fix | Delete
var promptHTML = $("<div />").append(prompt).html();
[369] Fix | Delete
WFAD.colorboxClose();
[370] Fix | Delete
setTimeout(function() {
[371] Fix | Delete
WFAD.colorboxHTML((WFAD.isSmallScreen ? '300px' : '500px'), promptHTML, {overlayClose: false, closeButton: false, className: 'wf-modal', onComplete: function() {
[372] Fix | Delete
$('#wf-migrate2fanewfail-prompt-close').on('click', function(e) {
[373] Fix | Delete
e.preventDefault();
[374] Fix | Delete
e.stopPropagation();
[375] Fix | Delete
[376] Fix | Delete
WFAD.colorboxClose();
[377] Fix | Delete
});
[378] Fix | Delete
}});
[379] Fix | Delete
}, 500);
[380] Fix | Delete
}
[381] Fix | Delete
});
[382] Fix | Delete
});
[383] Fix | Delete
}});
[384] Fix | Delete
});
[385] Fix | Delete
[386] Fix | Delete
$('#wf-migrate2faold-start').on('click', function(e) {
[387] Fix | Delete
e.preventDefault();
[388] Fix | Delete
e.stopPropagation();
[389] Fix | Delete
[390] Fix | Delete
var prompt = $('#wfTmpl_migrate2FAOld').tmpl();
[391] Fix | Delete
var promptHTML = $("<div />").append(prompt).html();
[392] Fix | Delete
WFAD.colorboxHTML((WFAD.isSmallScreen ? '300px' : '500px'), promptHTML, {overlayClose: false, closeButton: false, className: 'wf-modal', onComplete: function() {
[393] Fix | Delete
$('#wf-migrate2faold-prompt-cancel').on('click', function(e) {
[394] Fix | Delete
e.preventDefault();
[395] Fix | Delete
e.stopPropagation();
[396] Fix | Delete
[397] Fix | Delete
WFAD.colorboxClose();
[398] Fix | Delete
});
[399] Fix | Delete
[400] Fix | Delete
$('#wf-migrate2faold-prompt-switch').on('click', function(e) {
[401] Fix | Delete
e.preventDefault();
[402] Fix | Delete
e.stopPropagation();
[403] Fix | Delete
[404] Fix | Delete
$('#wf-migrate2faold-progress').show();
[405] Fix | Delete
$('#wf-migrate2faold-prompt-cancel, #wf-migrate2faold-prompt-switch').addClass('wf-disabled');
[406] Fix | Delete
[407] Fix | Delete
WFAD.ajax('wordfence_switchTo2FAOld', {migrate: false}, function(res) {
[408] Fix | Delete
var prompt = $('#wfTmpl_migrate2FAOldComplete').tmpl();
[409] Fix | Delete
var promptHTML = $("<div />").append(prompt).html();
[410] Fix | Delete
WFAD.colorboxClose();
[411] Fix | Delete
setTimeout(function() {
[412] Fix | Delete
WFAD.colorboxHTML((WFAD.isSmallScreen ? '300px' : '500px'), promptHTML, {overlayClose: false, closeButton: false, className: 'wf-modal', onComplete: function() {
[413] Fix | Delete
$('#wf-migrate2faoldcomplete-prompt-close').on('click', function(e) {
[414] Fix | Delete
e.preventDefault();
[415] Fix | Delete
e.stopPropagation();
[416] Fix | Delete
[417] Fix | Delete
window.location.reload();
[418] Fix | Delete
WFAD.colorboxClose();
[419] Fix | Delete
});
[420] Fix | Delete
}});
[421] Fix | Delete
}, 500);
[422] Fix | Delete
});
[423] Fix | Delete
});
[424] Fix | Delete
}});
[425] Fix | Delete
});
[426] Fix | Delete
});
[427] Fix | Delete
})(jQuery);
[428] Fix | Delete
</script>
[429] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function