當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AIOWPSecurity_Utility::disable_file_edits方法代碼示例

本文整理匯總了PHP中AIOWPSecurity_Utility::disable_file_edits方法的典型用法代碼示例。如果您正苦於以下問題:PHP AIOWPSecurity_Utility::disable_file_edits方法的具體用法?PHP AIOWPSecurity_Utility::disable_file_edits怎麽用?PHP AIOWPSecurity_Utility::disable_file_edits使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在AIOWPSecurity_Utility的用法示例。


在下文中一共展示了AIOWPSecurity_Utility::disable_file_edits方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: render_tab2

    function render_tab2()
    {
        global $aio_wp_security;
        global $aiowps_feature_mgr;
        if (isset($_POST['aiowps_disable_file_edit'])) {
            $nonce = $_REQUEST['_wpnonce'];
            if (!wp_verify_nonce($nonce, 'aiowpsec-disable-file-edit-nonce')) {
                $aio_wp_security->debug_logger->log_debug("Nonce check failed on disable PHP file edit options save!", 4);
                die("Nonce check failed on disable PHP file edit options save!");
            }
            if (isset($_POST['aiowps_disable_file_editing'])) {
                $res = AIOWPSecurity_Utility::disable_file_edits();
                //$this->disable_file_edits();
            } else {
                $res = AIOWPSecurity_Utility::enable_file_edits();
                //$this->enable_file_edits();
            }
            if ($res) {
                //Save settings if no errors
                $aio_wp_security->configs->set_value('aiowps_disable_file_editing', isset($_POST["aiowps_disable_file_editing"]) ? '1' : '');
                $aio_wp_security->configs->save_config();
                //Recalculate points after the feature status/options have been altered
                $aiowps_feature_mgr->check_feature_status_and_recalculate_points();
                $this->show_msg_updated(__('Your PHP file editing settings were saved successfully.', 'aiowpsecurity'));
            } else {
                $this->show_msg_error(__('Operation failed! Unable to modify or make a backup of wp-config.php file!', 'aiowpsecurity'));
            }
            //$this->show_msg_settings_updated();
        }
        ?>
        <h2><?php 
        _e('File Editing', 'aiowpsecurity');
        ?>
</h2>
        <div class="aio_blue_box">
            <?php 
        echo '<p>' . __('The Wordpress Dashboard by default allows administrators to edit PHP files, such as plugin and theme files.', 'aiowpsecurity') . '
            <br />' . __('This is often the first tool an attacker will use if able to login, since it allows code execution.', 'aiowpsecurity') . '
            <br />' . __('This feature will disable the ability for people to edit PHP files via the dashboard.', 'aiowpsecurity') . '    
            </p>';
        ?>
        </div>

        <div class="postbox">
        <h3><label for="title"><?php 
        _e('Disable PHP File Editing', 'aiowpsecurity');
        ?>
</label></h3>
        <div class="inside">
        <?php 
        //Display security info badge
        global $aiowps_feature_mgr;
        $aiowps_feature_mgr->output_feature_details_badge("filesystem-file-editing");
        ?>

        <form action="" method="POST">
        <?php 
        wp_nonce_field('aiowpsec-disable-file-edit-nonce');
        ?>
            
        <table class="form-table">
            <tr valign="top">
                <th scope="row"><?php 
        _e('Disable Ability To Edit PHP Files', 'aiowpsecurity');
        ?>
:</th>                
                <td>
                <input name="aiowps_disable_file_editing" type="checkbox"<?php 
        if ($aio_wp_security->configs->get_value('aiowps_disable_file_editing') == '1') {
            echo ' checked="checked"';
        }
        ?>
 value="1"/>
                <span class="description"><?php 
        _e('Check this if you want to remove the ability for people to edit PHP files via the WP dashboard', 'aiowpsecurity');
        ?>
</span>
                </td>
            </tr>            
        </table>
        <input type="submit" name="aiowps_disable_file_edit" value="<?php 
        _e('Save Settings', 'aiowpsecurity');
        ?>
" class="button-primary" />
        </form>
        </div></div>
    <?php 
    }
開發者ID:Rudchyk,項目名稱:wp-framework,代碼行數:88,代碼來源:wp-security-filesystem-menu.php


注:本文中的AIOWPSecurity_Utility::disable_file_edits方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。