PluginProbe
Easy Basic Authentication – Add basic auth to site or admin area / 4.1.0
Easy Basic Authentication – Add basic auth to site or admin area v4.1.0
4.1.0 trunk 1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4 1.4.1 1.5 1.5.1 1.5.2 1.5.3 1.6 1.6.1 1.6.2 1.6.3 1.6.4 1.7 1.7.1 1.8 1.8.1 All 51 releases
easy-basic-authentication / template / settings_page.php

settings_page.php in Easy Basic Authentication – Add basic auth to site or admin area 4.1.0, at template/settings_page.php

126 lines 4.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit;
4 }
5
6 $basic_auth_dir_file = realpath(dirname(__FILE__) . '/../class/easy-basic-authentication-class.php');
7 $basic_auth_content_file = "add_action( 'init', array(\$this,'basic_auth_admin') );";
8 ?>
9
10 <div class="wrap easy-basic-settings">
11 <div class="error-message">
12 <?php settings_errors(); ?>
13 </div>
14
15 <?php if ( ! is_ssl() ) : ?>
16 <div class="notice notice-warning">
17 <p>
18 <strong><?php esc_html_e('Warning:', 'easy-basic-authentication'); ?></strong>
19 <?php esc_html_e('Your site is currently not using HTTPS. Basic Authentication may not work correctly over HTTP due to browser and server restrictions.', 'easy-basic-authentication'); ?>
20 </p>
21 </div>
22 <?php endif; ?>
23
24 <form method="post" action="options.php" class="easy-basic-form">
25 <?php
26 easy_basic_authentication_compatcheck_class::render_button_html();
27
28 settings_fields( 'basic-auth-plugin-settings' );
29 do_settings_sections( 'basic-auth-plugin-settings' );
30 submit_button(__('Save Settings', 'easy-basic-authentication'), 'primary', 'eba_submit', false);
31 ?>
32 </form>
33
34 <div id="password-recovery-alert" class="container">
35 <div class="alert alert-warning alert-dismissible fade show" role="alert">
36 <strong><?php echo esc_html__('Attention:', 'easy-basic-authentication'); ?></strong>
37 <?php echo esc_html__('To recover your password, you need to comment out a line in a file via FTP.', 'easy-basic-authentication'); ?>
38 <?php echo esc_html__('Please follow the instructions', 'easy-basic-authentication'); ?>
39 <a href="#" class="alert-link" onclick="toggleInstructions()"><?php echo esc_html__('here.', 'easy-basic-authentication');?></a>
40 </div>
41
42 <div id="instructions" style="display: none;" class="mt-3">
43 <p><strong><?php echo esc_html__('Instructions:', 'easy-basic-authentication'); ?></strong></p>
44 <ol>
45 <li><?php echo esc_html__('Connect to your website via FTP.', 'easy-basic-authentication'); ?></li>
46 <li><?php echo esc_html__('Navigate to the plugin directory.', 'easy-basic-authentication'); ?></li>
47 <li><?php
48 echo sprintf(
49 /* translators: %s: full path of the plugin file to edit. */
50 esc_html__('Locate the file named %s.', 'easy-basic-authentication'),
51 esc_attr($basic_auth_dir_file)
52 ); ?>
53 </li>
54 <li><?php
55 echo sprintf(
56 /* translators: %s: line of PHP code to comment out. */
57 esc_html__('Find the line containing %s.', 'easy-basic-authentication'),
58 esc_attr($basic_auth_content_file)
59 ); ?>
60 </li>
61 <li><?php echo esc_html__('Comment out that line by adding "#" at the beginning.', 'easy-basic-authentication'); ?></li>
62 <li><?php echo esc_html__('Save the file and re-upload it to your server.', 'easy-basic-authentication'); ?></li>
63 </ol>
64 </div>
65 </div>
66
67 <script>
68 function toggleInstructions() {
69 var instructions = document.getElementById("instructions");
70 instructions.style.display = (instructions.style.display === "none") ? "block" : "none";
71 }
72 </script>
73 </div>
74
75 <style>
76 .easy-basic-settings {
77 background-color: #f9f9f9;
78 padding: 20px;
79 border: 1px solid #ddd;
80 }
81
82 .easy-basic-form {
83 margin-top: 20px;
84 }
85
86 .easy-basic-form input[type="text"],
87 .easy-basic-form input[type="password"],
88 .easy-basic-form textarea {
89 width: 100%;
90 padding: 10px;
91 margin-top: 10px;
92 border: 1px solid #ddd;
93 border-radius: 4px;
94 }
95
96 .easy-basic-form .submit {
97 background-color: #0073aa;
98 color: #fff;
99 border: none;
100 padding: 10px 20px;
101 border-radius: 4px;
102 cursor: pointer;
103 }
104
105 .easy-basic-form .submit:hover {
106 background-color: #005b82;
107 }
108
109 .easy-basic-form input[type=checkbox],
110 .easy-basic-form input[type=radio] {
111 padding: 10px 20px;
112 height: 1.5625rem;
113 width: 1.5625rem;
114 }
115
116 .easy-basic-form input[type=checkbox]:checked:before {
117 width: 1.875rem;
118 height: 1.875rem;
119 margin: -0.1875rem -0.3125rem;
120 }
121
122 .easy-basic-settings #password-recovery-alert {
123 margin-top: 30px;
124 }
125 </style>
126