暫無描述

network-settings.php 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * Jetpack Network Settings view template.
  4. *
  5. * @package automattic/jetpack
  6. */
  7. if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] ) : // phpcs:ignore WordPress.Security.NonceVerification.Recommended
  8. ?>
  9. <div class="updated"><p><?php esc_html_e( 'Jetpack Network Settings Updated!', 'jetpack' ); ?></p></div>
  10. <?php endif; ?>
  11. <?php
  12. if ( isset( $_GET['error'] ) && 'jetpack_protect_whitelist' === $_GET['error'] ) : // phpcs:ignore WordPress.Security.NonceVerification.Recommended
  13. ?>
  14. <div class="error"><p><?php esc_html_e( 'One of your IP addresses was not valid.', 'jetpack' ); ?></p></div>
  15. <?php endif; ?>
  16. <div class="wrap">
  17. <h2><?php esc_html_e( 'Network Settings', 'jetpack' ); ?></h2>
  18. <form action="edit.php?action=jetpack-network-settings" method="POST">
  19. <h3><?php echo esc_html_x( 'Global', 'Affects all sites in a Multisite network.', 'jetpack' ); ?></h3>
  20. <p><?php esc_html_e( 'These settings affect all sites on the network.', 'jetpack' ); ?></p>
  21. <?php wp_nonce_field( 'jetpack-network-settings' ); ?>
  22. <table class="form-table">
  23. <tr valign="top">
  24. <th scope="row"><label for="sub-site-override"><?php esc_html_e( 'Sub-site override', 'jetpack' ); ?></label></th>
  25. <td>
  26. <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 ?> />
  27. <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>
  28. </td>
  29. </tr>
  30. <tr valign="top">
  31. <th scope="row"><label for="sub-site-override"><?php esc_html_e( 'Protect whitelist', 'jetpack' ); ?></label></th>
  32. <td>
  33. <p><strong>
  34. <?php
  35. $protect_ip = jetpack_protect_get_ip();
  36. if ( ! empty( $protect_ip ) ) {
  37. printf(
  38. /* Translators: placeholder is an IP address. */
  39. esc_html__( 'Your current IP: %1$s', 'jetpack' ),
  40. esc_html( $protect_ip )
  41. );
  42. }
  43. ?>
  44. </strong></p>
  45. <?php
  46. 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.
  47. foreach ( $data['jetpack_protect_whitelist']['global'] as $ip ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable
  48. echo esc_html( $ip ) . "\n";
  49. }
  50. ?>
  51. </textarea> <br />
  52. <label for="global-whitelist">
  53. <?php esc_html_e( 'IPv4 and IPv6 are acceptable. Enter multiple IPs on separate lines.', 'jetpack' ); ?>
  54. <br />
  55. <?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' ); ?>
  56. </label>
  57. </td>
  58. </tr>
  59. </table>
  60. <?php submit_button(); ?>
  61. </form>
  62. </div>