コード例 #1
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);
 }
コード例 #2
0
ファイル: sucuri.php プロジェクト: sirhair/SH_WP_PluginRepo
 /**
  * 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'));
         }
     }
 }
コード例 #3
0
ファイル: sucuri.php プロジェクト: GaryJones/gobrenix.com
 /**
  * Create a folder in the WordPress upload directory where the plugin will
  * store all the temporal or dynamic information.
  *
  * @return void
  */
 public static function create_datastore_folder()
 {
     $plugin_upload_folder = SucuriScan::datastore_folder_path();
     if (!file_exists($plugin_upload_folder)) {
         $datastore_folder_created = @mkdir($plugin_upload_folder, 0755, true);
         if ($datastore_folder_created) {
             // Create last-logins datastore file.
             sucuriscan_lastlogins_datastore_exists();
             // Create a htaccess file to deny access from all.
             @file_put_contents($plugin_upload_folder . '/.htaccess', "Order Deny,Allow\nDeny from all\n", LOCK_EX);
             // Create an index.html to avoid directory listing.
             @file_put_contents($plugin_upload_folder . '/index.html', '<!-- Prevent the directory listing. -->', LOCK_EX);
         } else {
             SucuriScanOption::delete_option(':datastore_path');
             SucuriScanInterface::error('Data folder does not exists and could not be created. Try to <a href="' . SucuriScanTemplate::get_url('settings') . '">click this link</a> to see
                 if the plugin is able to fix this error automatically, if this message
                 reappears you will need to either change the location of the directory from
                 the plugin general settings page or create this directory manually and give it
                 write permissions:<code>' . $plugin_upload_folder . '</code>.');
         }
     }
 }