network-settings.php
| 1 | <?php |
| 2 | /** |
| 3 | * Jetpack Network Settings view template. |
| 4 | * |
| 5 | * @package automattic/jetpack |
| 6 | */ |
| 7 | |
| 8 | if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] ) : // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 9 | ?> |
| 10 | <div class="updated"><p><?php esc_html_e( 'Jetpack Network Settings Updated!', 'jetpack' ); ?></p></div> |
| 11 | <?php endif; ?> |
| 12 | |
| 13 | <?php |
| 14 | if ( isset( $_GET['error'] ) && 'jetpack_protect_whitelist' === $_GET['error'] ) : // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 15 | ?> |
| 16 | <div class="error"><p><?php esc_html_e( 'One of your IP addresses was not valid.', 'jetpack' ); ?></p></div> |
| 17 | <?php endif; ?> |
| 18 | |
| 19 | <div class="wrap"> |
| 20 | <h2><?php esc_html_e( 'Network Settings', 'jetpack' ); ?></h2> |
| 21 | <form action="edit.php?action=jetpack-network-settings" method="POST"> |
| 22 | <h3><?php echo esc_html_x( 'Global', 'Affects all sites in a Multisite network.', 'jetpack' ); ?></h3> |
| 23 | <p><?php esc_html_e( 'These settings affect all sites on the network.', 'jetpack' ); ?></p> |
| 24 | <?php wp_nonce_field( 'jetpack-network-settings' ); ?> |
| 25 | <table class="form-table"> |
| 26 | <tr valign="top"> |
| 27 | <th scope="row"><label for="sub-site-override"><?php esc_html_e( 'Sub-site override', 'jetpack' ); ?></label></th> |
| 28 | <td> |
| 29 | <input type="checkbox" name="sub-site-connection-override" id="sub-site-override" value="1" <?php checked( $data['options']['sub-site-connection-override'] ); // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable ?> /> |
| 30 | <label for="sub-site-override"><?php esc_html_e( 'Allow individual site administrators to manage their own connections (connect and disconnect) to WordPress.com', 'jetpack' ); ?></label> |
| 31 | </td> |
| 32 | </tr> |
| 33 | |
| 34 | <tr valign="top"> |
| 35 | <th scope="row"><label for="sub-site-override"><?php esc_html_e( 'Protect whitelist', 'jetpack' ); ?></label></th> |
| 36 | <td> |
| 37 | <p><strong> |
| 38 | <?php |
| 39 | $protect_ip = jetpack_protect_get_ip(); |
| 40 | if ( ! empty( $protect_ip ) ) { |
| 41 | printf( |
| 42 | /* Translators: placeholder is an IP address. */ |
| 43 | esc_html__( 'Your current IP: %1$s', 'jetpack' ), |
| 44 | esc_html( $protect_ip ) |
| 45 | ); |
| 46 | } |
| 47 | ?> |
| 48 | </strong></p> |
| 49 | <?php |
| 50 | echo '<textarea name="global-whitelist" style="width: 100%;" rows="8">'; // echo to avoid tabs displayed in textarea. See https://github.com/Automattic/jetpack/pull/21151/files#r713922521. |
| 51 | |
| 52 | foreach ( $data['jetpack_protect_whitelist']['global'] as $ip ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable |
| 53 | echo esc_html( $ip ) . "\n"; |
| 54 | } |
| 55 | ?> |
| 56 | </textarea> <br /> |
| 57 | <label for="global-whitelist"> |
| 58 | <?php esc_html_e( 'IPv4 and IPv6 are acceptable. Enter multiple IPs on separate lines.', 'jetpack' ); ?> |
| 59 | <br /> |
| 60 | <?php esc_html_e( 'To specify a range, enter the low value and high value separated by a dash. Example: 12.12.12.1-12.12.12.100', 'jetpack' ); ?> |
| 61 | </label> |
| 62 | </td> |
| 63 | </tr> |
| 64 | </table> |
| 65 | <?php submit_button(); ?> |
| 66 | |
| 67 | </form> |
| 68 | </div> |
| 69 |