Beispiel #1
0
 /**
  * Send a request to recover a previously registered API key.
  *
  * @return boolean true if the API key was sent to the administrator email, false otherwise.
  */
 public static function recover_key()
 {
     $clean_domain = self::get_domain();
     $response = self::api_call_wordpress('GET', array('e' => self::get_site_email(), 's' => $clean_domain, 'a' => 'recover_key'), false);
     if (self::handle_response($response)) {
         SucuriScanEvent::notify_event('plugin_change', 'API key recovered for domain: ' . $clean_domain);
         SucuriScanInterface::info($response['body']->output->message);
         return true;
     }
     return false;
 }
 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);
 }