" . number_format_i18n( $vulnerability_count ) . ""; } if ( ( isset( $_GET[ 'sixscan_activated' ] ) && ( $_GET[ 'sixscan_activated' ] == '1' ) ) || ( ( isset( $_GET['activate'] ) ) && ( $_GET['activate'] == 'true' ) && ( sixscan_common_is_account_active() == FALSE ) ) ){ $sixscan_menu_title .= sixscan_installation_error_description( 'OK' , '' , 'REGISTER_STARTED' , '0' ); } add_menu_page( '6Scan' , $sixscan_menu_title , 'manage_options' , SIXSCAN_COMMON_DASHBOARD_URL , '' , SIXSCAN_PLUGIN_URL . 'data/img/logo_small.png' ); add_submenu_page( SIXSCAN_COMMON_DASHBOARD_URL , '6Scan Dashboard' , 'Dashboard' , 'manage_options' , SIXSCAN_COMMON_DASHBOARD_URL , 'sixscan_menu_dashboard' ); if ( sixscan_common_is_account_operational() == TRUE ) add_submenu_page( SIXSCAN_COMMON_DASHBOARD_URL , '6Scan Settings' , 'Settings' , 'manage_options' , SIXSCAN_COMMON_SETTINGS_URL , 'sixscan_menu_settings' ); add_submenu_page( SIXSCAN_COMMON_DASHBOARD_URL , '6Scan Support' , 'Support' , 'manage_options' , SIXSCAN_COMMON_SUPPORT_URL , 'sixscan_menu_support' ); } function sixscan_menu_is_ticket_requested(){ return ( ( isset( $_GET[ 'ticket_submitted' ] ) ) && ( $_GET[ 'ticket_submitted' ] == 1 ) ) ; } function sixscan_menu_support(){ /* If user has already submitted a ticket, show him a "Thank you" */ if ( sixscan_menu_is_ticket_requested() ){ sixscan_menu_submission_ok_msg(); return; } $custom_message = "
For any questions, please visit our support community.

"; $custom_message .= "If there is a problem with 6Scan's plugin, our support team would like to help you solve it.
Please verify your email below, add any comments you may have, and click Submit to automatically open a support ticket.\n

"; $err_form = sixscan_menu_get_error_submission_form( "" , $custom_message ); print $err_form; } function sixscan_menu_settings(){ /* Create dashboard frame with settings redirect request */ sixscan_menu_create_dashboard_frame( SIXSCAN_COMMON_DASHBOARD_URL_SETTINGS ); } function sixscan_menu_dashboard(){ /* Create dashboard frame with default redirect request (to the main dashboard) */ sixscan_menu_create_dashboard_frame(); } function sixscan_menu_submission_ok_msg(){ print <<
Thank you for your submission. 6Scan support will be in touch shortly.
EOD; } function sixscan_menu_create_dashboard_frame( $redirect_request = "" ){ $user_height = '100%'; if ( $redirect_request == ""){ /* Default redirects per different plugin types */ if ( SIXSCAN_PLATFORM_TYPE == 'wordpress' ) $redirect_request = SIXSCAN_COMMON_DASHBOARD_URL_MAIN; else if ( SIXSCAN_PLATFORM_TYPE == 'wordpress_backup' ) $redirect_request = SIXSCAN_COMMON_DASHBOARD_URL_BACKUP; } /* If user has already submitted a ticket, show him a "Thank you" */ if ( sixscan_menu_is_ticket_requested() ){ sixscan_menu_submission_ok_msg(); return; } /* Do not show dashboard iframe, if account is not active */ if ( sixscan_common_is_account_active() == FALSE ) return; /* Widget has smaller iframe size */ if ( $redirect_request == SIXSCAN_COMMON_DASHBOARD_URL_WIDGET ) $user_height = '550px'; print "\n"; ?> \n"; $result_html .= "
"; $result_html .= "
"; $result_html .= $err_msg; $result_html .= "
\n"; $result_html .= ""; return $result_html; } function sixscan_menu_get_error_submission_form( $err_data = "" , $custom_form_message = "" ){ $server_request_uri = htmlspecialchars( $_SERVER[ "REQUEST_URI" ] , ENT_QUOTES ); $result_html = ""; $error_details = base64_encode( "User error: " . $err_data . "\n\n" . sixscan_common_gather_system_information_for_anonymous_support_ticket() ); $result_html .= "
\n"; $result_html .= "
"; $result_html .= "
\n"; if ( $custom_form_message == "" ) $result_html .= "6Scan's support team would like to help you solve this problem! Please verify your email below, add any comments you may have, and click Submit to automatically open a support ticket.\n

"; else $result_html .= $custom_form_message; $result_html .= "\n"; $result_html .= "
\n"; $result_html .= "\n"; $result_html .= "\n"; $result_html .= "\n"; $result_html .= "
\n"; $result_html .= "\n"; $result_html .= "\n"; $result_html .= "\n"; $result_html .= "\n"; $result_html .= "\n"; $result_html .= "
Email:
Comments*:
"; $result_html .= "
\n"; $result_html .= "We will automatically send troubleshooting information along with your ticket. 6Scan respects your privacy and will never use your information except to help you with your problem.\n"; $result_html .= "
\n"; $result_html .= "
\n"; return $result_html; } function sixscan_menu_show_vulnerabilities_warning(){ /* User has asked us not to show the message */ if ( get_option( SIXSCAN_VULN_MESSAGE_DISMISSED ) == TRUE ){ return; } /* Don't show the message on the dashboard page */ if ( isset( $_GET[ 'page' ] ) && ( $_GET[ 'page' ] == SIXSCAN_COMMON_DASHBOARD_URL ) ){ return; } /* Don't show this message to non-admins */ if ( ! current_user_can( 'manage_options' ) ){ return; } $current_vulns_found = intval( get_option( SIXSCAN_OPTION_VULNERABITILY_COUNT ) ); /* If we have 0 vulnerabilities, don't show the warning */ if ( $current_vulns_found == 0 ) return; echo '

You have ' . $current_vulns_found . ' unfixed vulnerabilities. Click here to fix them now.Dismiss this message

'; } /* Hiding the vulnerabilties warning */ add_action( 'admin_head', 'sixscan_menu_dismiss_warning_ajax' ); add_action( 'wp_ajax_sixscan_dismiss_vuln_warning' , 'sixscan_menu_dismiss_vulnerabilities_warning' ); function sixscan_menu_dismiss_warning_ajax(){ $nonce = wp_create_nonce( 'sixscan_vuln_message' ); ?> $normal_dashboard[ 'sixscan_widget' ] ); unset( $normal_dashboard[ 'sixscan_widget' ] ); $sorted_dashboard = array_merge( $sixscan_widget , $normal_dashboard ); $wp_meta_boxes['dashboard']['normal']['core'] = $sorted_dashboard; } /* Creates link to 6Scan dashboard widget */ function sixscan_menu_widget_function() { /* Create dashboard frame with settings redirect request */ sixscan_menu_create_dashboard_frame( SIXSCAN_COMMON_DASHBOARD_URL_WIDGET ); } ?>