| 1 |
<?php |
| 2 |
$dir_file = realpath(dirname(__FILE__) . '/../class/easy-basic-authentication-class.php'); |
| 3 |
$content_file = "add_action( 'init', array(\$this,'basic_auth_admin') );"; |
| 4 |
?> |
| 5 |
|
| 6 |
<div class="wrap easy-basic-settings"> |
| 7 |
<div class="error-message"> |
| 8 |
<?php settings_errors(); ?> |
| 9 |
</div> |
| 10 |
<form method="post" action="options.php" class="easy-basic-form"> |
| 11 |
<?php |
| 12 |
settings_fields( 'basic-auth-plugin-settings' ); |
| 13 |
do_settings_sections( 'basic-auth-plugin-settings' ); |
| 14 |
submit_button(__('save', 'easy-basic-authentication'), 'primary', 'eba_submit', false); |
| 15 |
?> |
| 16 |
</form> |
| 17 |
<div id="password-recovery-alert" class="container"> |
| 18 |
<div class="alert alert-warning alert-dismissible fade show" role="alert"> |
| 19 |
<strong><?php echo esc_html__('Attention:', 'easy-basic-authentication'); ?></strong> <?php echo esc_html__('To recover your password, you need to comment out a line in a file via FTP.', 'easy-basic-authentication'); ?> |
| 20 |
<?php echo esc_html__('Please follow the instructions', 'easy-basic-authentication'); ?> <a href="#" class="alert-link" onclick="toggleInstructions()"><?php echo esc_html__('here.', 'easy-basic-authentication');?></a> |
| 21 |
</div> |
| 22 |
|
| 23 |
<div id="instructions" style="display: none;" class="mt-3"> |
| 24 |
<p><strong><?php echo esc_html__('Instructions:', 'easy-basic-authentication'); ?></strong></p> |
| 25 |
<ol> |
| 26 |
<li><?php echo esc_html__('Connect to your website via FTP.', 'easy-basic-authentication'); ?></li> |
| 27 |
<li><?php echo esc_html__('Navigate to the plugin directory.', 'easy-basic-authentication'); ?></li> |
| 28 |
<li><?php |
| 29 |
// translators: %s è il percorso del file del plugin |
| 30 |
echo sprintf(esc_html__('Locate the file named %s.', 'easy-basic-authentication'), esc_attr($dir_file)); ?> |
| 31 |
</li> |
| 32 |
<li><?php |
| 33 |
// translators: %s is the content file path |
| 34 |
echo sprintf(esc_html__('Find the line containing %s.', 'easy-basic-authentication'), esc_attr($content_file)); ?> |
| 35 |
</li> |
| 36 |
<li><?php echo esc_html__('Comment out that line by adding "#" at the beginning.', 'easy-basic-authentication'); ?></li> |
| 37 |
<li><?php echo esc_html__('Save the file and re-upload it to your server.', 'easy-basic-authentication'); ?></li> |
| 38 |
</ol> |
| 39 |
</div> |
| 40 |
</div> |
| 41 |
|
| 42 |
<script> |
| 43 |
function toggleInstructions() { |
| 44 |
var instructions = document.getElementById("instructions"); |
| 45 |
if (instructions.style.display === "none") { |
| 46 |
instructions.style.display = "block"; |
| 47 |
} else { |
| 48 |
instructions.style.display = "none"; |
| 49 |
} |
| 50 |
} |
| 51 |
</script> |
| 52 |
|
| 53 |
</div> |
| 54 |
|
| 55 |
<style> |
| 56 |
.easy-basic-settings { |
| 57 |
background-color: #f9f9f9; |
| 58 |
padding: 20px; |
| 59 |
border: 1px solid #ddd; |
| 60 |
} |
| 61 |
|
| 62 |
.easy-basic-form { |
| 63 |
margin-top: 20px; |
| 64 |
} |
| 65 |
|
| 66 |
.easy-basic-form input[type="text"], |
| 67 |
.easy-basic-form input[type="password"], |
| 68 |
.easy-basic-form textarea { |
| 69 |
width: 100%; |
| 70 |
padding: 10px; |
| 71 |
margin-top: 10px; |
| 72 |
border: 1px solid #ddd; |
| 73 |
border-radius: 4px; |
| 74 |
} |
| 75 |
|
| 76 |
.easy-basic-form .submit { |
| 77 |
background-color: #0073aa; |
| 78 |
color: #fff; |
| 79 |
border: none; |
| 80 |
padding: 10px 20px; |
| 81 |
border-radius: 4px; |
| 82 |
cursor: pointer; |
| 83 |
} |
| 84 |
|
| 85 |
.easy-basic-form .submit:hover { |
| 86 |
background-color: #005b82; |
| 87 |
} |
| 88 |
|
| 89 |
.easy-basic-form input[type=checkbox], |
| 90 |
.easy-basic-form input[type=radio] { |
| 91 |
padding: 10px 20px; |
| 92 |
height: 1.5625rem; |
| 93 |
width: 1.5625rem; |
| 94 |
} |
| 95 |
|
| 96 |
.easy-basic-form input[type=checkbox]:checked:before { |
| 97 |
width: 1.875rem; |
| 98 |
height: 1.875rem; |
| 99 |
margin: -0.1875rem -0.3125rem; |
| 100 |
} |
| 101 |
|
| 102 |
.easy-basic-settings #password-recovery-alert { |
| 103 |
margin-top: 30px; |
| 104 |
} |
| 105 |
</style> |