| @@ -598,8 +598,11 @@ | ||
| 598 | 598 | * |
| 599 | 599 | * @uses \MainWP\Dashboard\MainWP_Utility::update_option() |
| 600 | 600 | */ |
| 601 | 601 | public function mwp_setup_introduction_save() { |
| 602 | + if ( ! \mainwp_current_user_can( 'dashboard', 'manage_dashboard_settings' ) ) { | |
| 603 | + return; | |
| 604 | + } | |
| 602 | 605 | check_admin_referer( 'mwp-setup' ); |
| 603 | 606 | $enabled_tours = ! isset( $_POST['mainwp-guided-tours-option'] ) ? 0 : 1; // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 604 | 607 | MainWP_Utility::update_option( 'mainwp_enable_guided_tours', $enabled_tours ); |
| 605 | 608 | wp_safe_redirect( $this->get_next_step_link() ); |
| @@ -628,8 +631,11 @@ | ||
| 628 | 631 | * |
| 629 | 632 | * @uses \MainWP\Dashboard\MainWP_Utility::update_option() |
| 630 | 633 | */ |
| 631 | 634 | public function mwp_setup_system_requirements_save() { |
| 635 | + if ( ! \mainwp_current_user_can( 'dashboard', 'manage_dashboard_settings' ) ) { | |
| 636 | + return; | |
| 637 | + } | |
| 632 | 638 | check_admin_referer( 'mwp-setup' ); |
| 633 | 639 | if ( isset( $_POST['mwp_setup_openssl_lib_location'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 634 | 640 | MainWP_Utility::update_option( 'mainwp_opensslLibLocation', isset( $_POST['mwp_setup_openssl_lib_location'] ) ? sanitize_text_field( wp_unslash( $_POST['mwp_setup_openssl_lib_location'] ) ) : '' ); // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 635 | 641 | } |
| @@ -744,8 +750,9 @@ | ||
| 744 | 750 | <div class="ui toggle checkbox not-auto-init" id="addsite-uniqueid"> |
| 745 | 751 | <input type="checkbox" id="mainwp-unique-security-id-checkbox-field"><label><?php esc_html_e( 'Unique Security ID', 'mainwp' ); ?></label> |
| 746 | 752 | </div> |
| 747 | 753 | </div> |
| 754 | + <?php MainWP_Manage_Sites::render_connection_unique_security_id_note(); ?> | |
| 748 | 755 | <div class="ui hidden divider"></div> |
| 749 | 756 | <div class="ui fluid segment accordion" id="mainwp-connection-authentication-accordion" style="margin-top:1em"> |
| 750 | 757 | <div class="title"> |
| 751 | 758 | <i class="dropdown icon"></i> |
| @@ -759,9 +766,9 @@ | ||
| 759 | 766 | </div> |
| 760 | 767 | <span class="ui text"><?php esc_html_e( 'Use the sliders to control the fields shown:', 'mainwp' ); ?></span> |
| 761 | 768 | <div class="ui bulleted small list"> |
| 762 | 769 | <div class="item"><?php esc_html_e( 'Password On: Displays the Password field.', 'mainwp' ); ?></div> |
| 763 | - <div class="item"><?php esc_html_e( 'Security Key On: Displays the Security Key field.', 'mainwp' ); ?></div> | |
| 770 | + <div class="item"><?php esc_html_e( 'Unique Security ID On: Displays the Unique Security ID field.', 'mainwp' ); ?></div> | |
| 764 | 771 | <div class="item"><?php esc_html_e( 'Both On: Displays both fields.', 'mainwp' ); ?></div> |
| 765 | 772 | <div class="item"><?php esc_html_e( 'Both Off: Hides both fields.', 'mainwp' ); ?></div> |
| 766 | 773 | </div> |
| 767 | 774 | <span class="ui text"><strong><?php esc_html_e( 'This needs to match what is set on your child site. Default is Administrator password.', 'mainwp' ); ?></strong></span> |
| @@ -766,8 +773,9 @@ | ||
| 766 | 773 | </div> |
| 767 | 774 | <span class="ui text"><strong><?php esc_html_e( 'This needs to match what is set on your child site. Default is Administrator password.', 'mainwp' ); ?></strong></span> |
| 768 | 775 | </div> |
| 769 | 776 | </div> |
| 777 | + <?php MainWP_Manage_Sites::render_connection_2fa_note(); ?> | |
| 770 | 778 | <div class="field" id="mainwp-administrator-password-field"> |
| 771 | 779 | <label for="mainwp_managesites_add_admin_pwd"><?php esc_html_e( 'What is your administrator password on that site?', 'mainwp' ); ?> <span class="ui red small text"><?php esc_html_e( '(Required if enabled)', 'mainwp' ); ?></span></label> |
| 772 | 780 | <input type="password" id="mainwp_managesites_add_admin_pwd" name="mainwp_managesites_add_admin_pwd" value="" /> |
| 773 | 781 | <div class="ui up pointing basic grey label" style="line-height:1.5em"><?php esc_html_e( 'Your password is never stored by your Dashboard and never sent to MainWP.com. Once this initial connection is complete, your MainWP Dashboard generates a secure Public and Private key pair (2048 bits) using OpenSSL, allowing future connections without needing your password again. For added security, you can even change this admin password once connected, just be sure not to delete the admin account, as this would disrupt the connection.', 'mainwp' ); ?></div> |
| @@ -775,8 +783,9 @@ | ||
| 775 | 783 | <div class="ui hidden divider"></div> |
| 776 | 784 | <div class="field" id="mainwp-unique-security-id-field" style="display:none" > |
| 777 | 785 | <label for="mainwp_managesites_add_uniqueId"><?php esc_html_e( 'Did you generate unique security ID on the site? If yes, copy it here, if not, leave this field blank. ', 'mainwp' ); ?> <span class="ui red small text"><?php esc_html_e( '(Required if enabled)', 'mainwp' ); ?></span></label> |
| 778 | 786 | <input type="text" id="mainwp_managesites_add_uniqueId" name="mainwp_managesites_add_uniqueId" value="" /> |
| 787 | + <span class="ui small text"><?php esc_html_e( 'Copy this from the child site under Settings > MainWP Child. Required only when Require Unique Security ID is enabled there.', 'mainwp' ); ?></span> | |
| 779 | 788 | </div> |
| 780 | 789 | <div class="ui hidden divider"></div> |
| 781 | 790 | <div class="field"> |
| 782 | 791 | <label for="mainwp_managesites_add_wpname"><?php esc_html_e( 'Add site title: ', 'mainwp' ); ?> <span class="ui grey small text"><?php esc_html_e( '(Optional)', 'mainwp' ); ?></label> |
| @@ -1283,8 +1292,11 @@ | ||
| 1283 | 1292 | * |
| 1284 | 1293 | * @uses \MainWP\Dashboard\MainWP_Utility::update_option() |
| 1285 | 1294 | */ |
| 1286 | 1295 | public function mwp_setup_monitoring_save() { |
| 1296 | + if ( ! \mainwp_current_user_can( 'dashboard', 'manage_dashboard_settings' ) ) { | |
| 1297 | + return; | |
| 1298 | + } | |
| 1287 | 1299 | check_admin_referer( 'mwp-setup' ); |
| 1288 | 1300 | // phpcs:disable WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 1289 | 1301 | |
| 1290 | 1302 | $global_settings = MainWP_Uptime_Monitoring_Handle::get_global_monitoring_settings(); |