当前位置: 首页>>代码示例>>PHP>>正文


PHP ITSEC_Modules::deactivate方法代码示例

本文整理汇总了PHP中ITSEC_Modules::deactivate方法的典型用法代码示例。如果您正苦于以下问题:PHP ITSEC_Modules::deactivate方法的具体用法?PHP ITSEC_Modules::deactivate怎么用?PHP ITSEC_Modules::deactivate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ITSEC_Modules的用法示例。


在下文中一共展示了ITSEC_Modules::deactivate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute_upgrade

 /**
  * Execute module upgrade
  *
  * @return void
  */
 public function execute_upgrade($itsec_old_version)
 {
     if ($itsec_old_version < 4000) {
         global $itsec_bwps_options;
         $current_options = get_site_option('itsec_ssl');
         // Don't do anything if settings haven't already been set, defaults exist in the module system and we prefer to use those
         if (false !== $current_options) {
             $current_options['frontend'] = isset($itsec_bwps_options['ssl_frontend']) ? intval($itsec_bwps_options['ssl_frontend']) : 0;
             update_site_option('itsec_ssl', $current_options);
             ITSEC_Response::regenerate_wp_config();
         }
     }
     if ($itsec_old_version < 4041) {
         $current_options = get_site_option('itsec_ssl');
         // If there are no current options, go with the new defaults by not saving anything
         if (is_array($current_options)) {
             // If anything in this module is being used activate it, otherwise deactivate it
             $activate = false;
             foreach ($current_options as $on) {
                 if ($on) {
                     $activate = true;
                     break;
                 }
             }
             if ($activate) {
                 ITSEC_Modules::activate('ssl');
             } else {
                 ITSEC_Modules::deactivate('ssl');
             }
             // remove 'enabled' which isn't used in the new module
             unset($current_options['enabled']);
             ITSEC_Modules::set_settings('ssl', $current_options);
         }
     }
 }
开发者ID:Garth619,项目名称:Femi9,代码行数:40,代码来源:setup.php

示例2: handle_ajax_request

 public function handle_ajax_request()
 {
     global $itsec_globals;
     if (WP_DEBUG) {
         ini_set('display_errors', 1);
     }
     $method = isset($_POST['method']) && is_string($_POST['method']) ? $_POST['method'] : '';
     $module = isset($_POST['module']) && is_string($_POST['module']) ? $_POST['module'] : '';
     if (false === check_ajax_referer('itsec-settings-nonce', 'nonce', false)) {
         ITSEC_Response::add_error(new WP_Error('itsec-settings-page-failed-nonce', __('A nonce security check failed, preventing the request from completing as expected. Please try reloading the page and trying again.', 'better-wp-security')));
     } else {
         if (!ITSEC_Core::current_user_can_manage()) {
             ITSEC_Response::add_error(new WP_Error('itsec-settings-page-insufficient-privileges', __('A permissions security check failed, preventing the request from completing as expected. The currently logged in user does not have sufficient permissions to make this request. Please try reloading the page and trying again.', 'better-wp-security')));
         } else {
             if (empty($method)) {
                 ITSEC_Response::add_error(new WP_Error('itsec-settings-page-missing-method', __('The server did not receive a valid request. The required "method" argument is missing. Please try again.', 'better-wp-security')));
             } else {
                 if ('save' === $method) {
                     $this->handle_post();
                 } else {
                     if (empty($module)) {
                         ITSEC_Response::add_error(new WP_Error('itsec-settings-page-missing-module', __('The server did not receive a valid request. The required "module" argument is missing. Please try again.', 'better-wp-security')));
                     } else {
                         if ('activate' === $method) {
                             ITSEC_Response::set_response(ITSEC_Modules::activate($module));
                         } else {
                             if ('deactivate' === $method) {
                                 ITSEC_Response::set_response(ITSEC_Modules::deactivate($module));
                             } else {
                                 if ('is_active' === $method) {
                                     ITSEC_Response::set_response(ITSEC_Modules::is_active($module));
                                 } else {
                                     if ('get_refreshed_module_settings' === $method) {
                                         ITSEC_Response::set_response($this->get_module_settings($module));
                                     } else {
                                         if ('get_refreshed_widget_settings' === $method) {
                                             ITSEC_Response::set_response($this->get_widget_settings($module));
                                         } else {
                                             if ('handle_module_request' === $method) {
                                                 if (isset($this->modules[$module])) {
                                                     if (isset($_POST['data'])) {
                                                         $returned_value = $this->modules[$module]->handle_ajax_request($_POST['data']);
                                                         if (!is_null($returned_value)) {
                                                             ITSEC_Response::set_response($returned_value);
                                                         }
                                                     } else {
                                                         ITSEC_Response::add_error(new WP_Error('itsec-settings-page-module-request-missing-data', __('The server did not receive a valid request. The required "data" argument for the module is missing. Please try again.', 'better-wp-security')));
                                                     }
                                                 } else {
                                                     ITSEC_Response::add_error(new WP_Error('itsec-settings-page-module-request-invalid-module', __("The server did not receive a valid request. The supplied module, \"{$module}\", does not exist. Please try again.", 'better-wp-security')));
                                                 }
                                             } else {
                                                 if ('handle_widget_request' === $method) {
                                                     if (isset($this->widgets[$module])) {
                                                         if (isset($_POST['data'])) {
                                                             $this->widgets[$module]->handle_ajax_request($_POST['data']);
                                                         } else {
                                                             ITSEC_Response::add_error(new WP_Error('itsec-settings-page-widget-request-missing-data', __('The server did not receive a valid request. The required "data" argument for the widget is missing. Please try again.', 'better-wp-security')));
                                                         }
                                                     } else {
                                                         ITSEC_Response::add_error(new WP_Error('itsec-settings-page-widget-request-invalid-widget', __("The server did not receive a valid request. The supplied widget, \"{$module}\", does not exist. Please try again.", 'better-wp-security')));
                                                     }
                                                 } else {
                                                     ITSEC_Response::add_error(new WP_Error('itsec-settings-page-unknown-method', __('The server did not receive a valid request. An unknown "method" argument was supplied. Please try again.', 'better-wp-security')));
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     ITSEC_Response::send_json();
 }
开发者ID:AcademicTechnologyCenter,项目名称:ATC-Quality-Tracking,代码行数:78,代码来源:page-settings.php


注:本文中的ITSEC_Modules::deactivate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。