Exemplo n.º 1
0
 /**
  * Display a notice message with instructions to continue the setup of the
  * plugin, this includes the generation of the API key and other steps that need
  * to be done to fully activate this plugin.
  *
  * @return void
  */
 public static function setup_notice()
 {
     if (current_user_can('manage_options') && SucuriScan::no_notices_here() === false && !SucuriScanAPI::get_plugin_key() && SucuriScanRequest::post(':plugin_api_key') === false && SucuriScanRequest::post(':recover_key') === false && !SucuriScanRequest::post(':manual_api_key')) {
         if (SucuriScanRequest::get(':dismiss_setup') !== false) {
             SucuriScanOption::update_option(':dismiss_setup', 'enabled');
         } elseif (SucuriScanOption::is_enabled(':dismiss_setup')) {
             /* Do not display API key generation form. */
         } else {
             echo SucuriScanTemplate::get_section('setup-notice');
             echo SucuriScanTemplate::get_modal('setup-form', array('Visibility' => 'hidden', 'Title' => 'Sucuri API key generation', 'CssClass' => 'sucuriscan-setup-instructions'));
         }
     }
 }
Exemplo n.º 2
0
 /**
  * Display a notice message with instructions to continue the setup of the
  * plugin, this includes the generation of the API key and other steps that need
  * to be done to fully activate this plugin.
  *
  * @return void
  */
 public static function setup_notice()
 {
     if (current_user_can('manage_options') && SucuriScan::no_notices_here() === false && !SucuriScanAPI::get_plugin_key() && SucuriScanRequest::post(':plugin_api_key') === false && SucuriScanRequest::post(':recover_key') === false && !SucuriScanRequest::post(':manual_api_key')) {
         echo SucuriScanTemplate::get_section('setup-notice');
     }
 }
Exemplo n.º 3
0
 public static function timeoutPage($nonce)
 {
     $params = array();
     // Update the SiteCheck timeout.
     if ($nonce) {
         $timeout = (int) SucuriScanRequest::post(':sitecheck_timeout', '[0-9]+');
         if ($timeout > 0) {
             if ($timeout <= SUCURISCAN_MAX_SITECHECK_TIMEOUT) {
                 $message = 'SiteCheck timeout set to <code>' . $timeout . '</code> seconds.';
                 SucuriScanOption::update_option(':sitecheck_timeout', $timeout);
                 SucuriScanEvent::report_info_event($message);
                 SucuriScanEvent::notify_event('plugin_change', $message);
                 SucuriScanInterface::info($message);
             } else {
                 SucuriScanInterface::error('SiteCheck timeout in seconds is too high.');
             }
         }
     }
     $params['MaxRequestTimeout'] = SUCURISCAN_MAX_SITECHECK_TIMEOUT;
     $params['RequestTimeout'] = SucuriScanOption::get_option(':sitecheck_timeout') . ' seconds';
     return SucuriScanTemplate::getSection('settings-sitecheck-timeout', $params);
 }
Exemplo n.º 4
0
 /**
  * Display a notice message with instructions to continue the setup of the
  * plugin, this includes the generation of the API key and other steps that need
  * to be done to fully activate this plugin.
  *
  * @return void
  */
 public static function setup_notice()
 {
     if (current_user_can('manage_options') && SucuriScan::no_notices_here() === false && !SucuriScanAPI::get_plugin_key() && SucuriScanRequest::post(':plugin_api_key') === false && SucuriScanRequest::post(':recover_key') === false && !SucuriScanRequest::post(':manual_api_key')) {
         echo SucuriScanTemplate::get_section('setup-notice');
         echo SucuriScanTemplate::get_modal('setup-form', array('Visibility' => 'hidden', 'Title' => 'Sucuri API key generation', 'CssClass' => 'sucuriscan-setup-instructions'));
     }
 }