Ejemplo n.º 1
0
$acxFileList = WpsSettings::getScanFileList();
$acx_isPostBack = false;
$acx_message = '';
//@ IF POSTBACK
if (!WsdUtil::isWinOs()) {
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        // check nonce
        if (isset($_POST['wsdplugin_update_paths_field'])) {
            if (!wp_verify_nonce($_POST['wsdplugin_update_paths_field'], 'wsdplugin_update_paths')) {
                wp_die(__('Invalid request.'));
            }
        } else {
            wp_die(__('Invalid request.'));
        }
        $acx_isPostBack = true;
        $result = WsdUtil::changeFilePermissions($acxFileList);
        if (empty($result)) {
            $acx_message = __('No changes applied. You are running PHP on a Windows server thus chmod cannot be used');
        } else {
            $acx_message = __('Successful changes') . ': ' . $result['success'] . ', ' . __('Failed') . ': ' . $result['failed'];
        }
    }
}
//@ Check the files
if (empty($acxFileList)) {
    echo __('There are currently no files set for scanning!');
} else {
    echo '<form method="post">';
    wp_nonce_field('wsdplugin_update_paths', 'wsdplugin_update_paths_field');
    echo '<table class="widefat acx-table" cellpadding="0" cellspacing="0">';
    echo '<thead class="widget-top">';