PluginProbe
HTTP Headers / trunk
HTTP Headers vtrunk
1.19.5 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.11.0 1.12.0 1.12.1 1.12.2 1.13.0 1.13.1 1.13.2 1.13.3 1.13.4 1.14.0 1.14.1 1.14.2 1.15.0 All 60 releases
http-headers / views / www-authenticate.php

www-authenticate.php in HTTP Headers trunk, at views/www-authenticate.php

94 lines 4.2 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 <tr valign="top">
7 <th scope="row">WWW-Authenticate
8 <p class="description"><?php esc_html_e('HTTP supports the use of several authentication mechanisms to control access to pages and other resources. These mechanisms are all based around the use of the 401 status code and the WWW-Authenticate response header.', 'http-headers'); ?></p>
9 <hr>
10 <p class="description"><?php esc_html_e('Read more at', 'http-headers'); ?>
11 <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/WWW-Authenticate"><?php esc_html_e('MDN Web Docs', 'http-headers'); ?></a>
12 </p>
13 </th>
14 <td>
15 <fieldset>
16 <legend class="screen-reader-text">WWW-Authenticate</legend>
17 <?php
18 $http_headers_www_authenticate = get_option ( 'hh_www_authenticate', 0 );
19 foreach ( $http_headers_bools as $http_headers_k => $http_headers_v ) {
20 ?><p>
21 <label><input type="radio" class="http-header" name="hh_www_authenticate" value="<?php echo esc_attr($http_headers_k); ?>" <?php checked($http_headers_www_authenticate, $http_headers_k, true); ?> /> <?php echo esc_html($http_headers_v); ?></label>
22 </p><?php
23 }
24 ?>
25 </fieldset>
26 </td>
27 <td>
28 <?php settings_fields( 'http-headers-wwa' ); ?>
29 <?php do_settings_sections( 'http-headers-wwa' ); ?>
30 <table>
31 <tbody>
32 <tr>
33 <td>Type</td>
34 <td colspan="3">
35 <select name="hh_www_authenticate_type" class="http-header-value"<?php echo $http_headers_www_authenticate == 1 ? NULL : ' readonly'; ?>>
36 <?php
37 $http_headers_items = array ('Basic', 'Digest');
38 $http_headers_www_authenticate_type = get_option ( 'hh_www_authenticate_type' );
39 foreach ( $http_headers_items as $http_headers_item ) {
40 ?><option value="<?php echo esc_attr($http_headers_item); ?>" <?php selected($http_headers_www_authenticate_type, $http_headers_item); ?>><?php echo esc_html($http_headers_item); ?></option><?php
41 }
42 ?>
43 </select>
44 </td>
45 </tr>
46 <tr>
47 <td>Realm</td>
48 <td colspan="3"><input type="text" name="hh_www_authenticate_realm" class="http-header-value" size="30" value="<?php echo esc_attr(get_option('hh_www_authenticate_realm')); ?>"<?php echo $http_headers_www_authenticate == 1 ? NULL : ' readonly'; ?> placeholder="Restricted area"></td>
49 </tr>
50 <tr>
51 <td>&nbsp;</td>
52 <td><strong><?php esc_html_e('Username', 'http-headers'); ?></strong></td>
53 <td><strong><?php esc_html_e('Password', 'http-headers'); ?></strong></td>
54 <td>&nbsp;</td>
55 </tr>
56 <?php
57 $http_headers_usernames = get_option('hh_www_authenticate_user', array());
58 $http_headers_passwords = get_option('hh_www_authenticate_pswd', array());
59 if (!is_array($http_headers_usernames)) {
60 $http_headers_usernames = array($http_headers_usernames);
61 }
62 if (!is_array($http_headers_passwords)) {
63 $http_headers_passwords = array($http_headers_passwords);
64 }
65 $http_headers_i = 0;
66 foreach ($http_headers_usernames as $http_headers_k => $http_headers_user) {
67 ?>
68 <tr>
69 <td>&nbsp;</td>
70 <td><input type="text" name="hh_www_authenticate_user[]" class="http-header-value" value="<?php echo esc_attr($http_headers_user); ?>"<?php echo $http_headers_www_authenticate == 1 ? NULL : ' readonly'; ?>></td>
71 <td><input type="text" name="hh_www_authenticate_pswd[]" class="http-header-value" value="<?php echo esc_attr($http_headers_passwords[$http_headers_k]); ?>"<?php echo $http_headers_www_authenticate == 1 ? NULL : ' readonly'; ?>></td>
72 <td><?php
73 if ($http_headers_i > 0)
74 {
75 ?><button type="button" class="button button-small hh-btn-delete-user" title="<?php esc_attr_e('Delete', 'http-headers'); ?>">x</button><?php
76 } else {
77 echo "&nbsp;";
78 }
79 ?></td>
80 </tr>
81 <?php
82 $http_headers_i += 1;
83 }
84 ?>
85 <tr>
86 <td>&nbsp;</td>
87 <td colspan="3">
88 <button type="button" class="button hh-btn-add-user">+ <?php esc_html_e('Add user', 'http-headers'); ?></button>
89 </td>
90 </tr>
91 </tbody>
92 </table>
93 </td>
94 </tr>