PluginProbe
HTTP Headers / 1.11.0
HTTP Headers v1.11.0
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 1.11.0, at views/www-authenticate.php

90 lines 3.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 <tr valign="top">
7 <th scope="row">WWW-Authenticate
8 <p class="description"><?php _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 </th>
10 <td>
11 <fieldset>
12 <legend class="screen-reader-text">WWW-Authenticate</legend>
13 <?php
14 $www_authenticate = get_option ( 'hh_www_authenticate', 0 );
15 foreach ( $bools as $k => $v ) {
16 ?><p>
17 <label><input type="radio" class="http-header" name="hh_www_authenticate" value="<?php echo $k; ?>" <?php checked($www_authenticate, $k, true); ?> /> <?php echo $v; ?></label>
18 </p><?php
19 }
20 ?>
21 </fieldset>
22 </td>
23 <td>
24 <?php settings_fields( 'http-headers-wwa' ); ?>
25 <?php do_settings_sections( 'http-headers-wwa' ); ?>
26 <table>
27 <tbody>
28 <tr>
29 <td>Type</td>
30 <td colspan="3">
31 <select name="hh_www_authenticate_type" class="http-header-value"<?php echo $www_authenticate == 1 ? NULL : ' readonly'; ?>>
32 <?php
33 $items = array ('Basic', 'Digest');
34 $www_authenticate_type = get_option ( 'hh_www_authenticate_type' );
35 foreach ( $items as $item ) {
36 ?><option value="<?php echo $item; ?>" <?php selected($www_authenticate_type, $item); ?>><?php echo $item; ?></option><?php
37 }
38 ?>
39 </select>
40 </td>
41 </tr>
42 <tr>
43 <td>Realm</td>
44 <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 $www_authenticate == 1 ? NULL : ' readonly'; ?> placeholder="Restricted area"></td>
45 </tr>
46 <tr>
47 <td>&nbsp;</td>
48 <td><strong><?php _e('Username', 'http-headers'); ?></strong></td>
49 <td><strong><?php _e('Password', 'http-headers'); ?></strong></td>
50 <td>&nbsp;</td>
51 </tr>
52 <?php
53 $usernames = get_option('hh_www_authenticate_user', array());
54 $passwords = get_option('hh_www_authenticate_pswd', array());
55 if (!is_array($usernames)) {
56 $usernames = array($usernames);
57 }
58 if (!is_array($passwords)) {
59 $passwords = array($passwords);
60 }
61 $i = 0;
62 foreach ($usernames as $k => $user) {
63 ?>
64 <tr>
65 <td>&nbsp;</td>
66 <td><input type="text" name="hh_www_authenticate_user[]" class="http-header-value" value="<?php echo esc_attr($user); ?>"<?php echo $www_authenticate == 1 ? NULL : ' readonly'; ?>></td>
67 <td><input type="text" name="hh_www_authenticate_pswd[]" class="http-header-value" value="<?php echo esc_attr($passwords[$k]); ?>"<?php echo $www_authenticate == 1 ? NULL : ' readonly'; ?>></td>
68 <td><?php
69 if ($i > 0)
70 {
71 ?><button type="button" class="button button-small hh-btn-delete-user" title="<?php esc_attr_e('Delete', 'http-headers'); ?>">x</button><?php
72 } else {
73 echo "&nbsp;";
74 }
75 ?></td>
76 </tr>
77 <?php
78 $i += 1;
79 }
80 ?>
81 <tr>
82 <td>&nbsp;</td>
83 <td colspan="3">
84 <button type="button" class="button hh-btn-add-user">+ <?php _e('Add user', 'http-headers'); ?></button>
85 </td>
86 </tr>
87 </tbody>
88 </table>
89 </td>
90 </tr>