Beispiel #1
0
function mrt_sub3()
{
    // Show header
    mrt_wpss_menu_head('WP - Database Security');
    $wsd_wpConfigFile = ABSPATH . 'wp-config.php';
    // internal flag
    $canLoadPage = false;
    if (wsd_wpConfigCheckPermissions($wsd_wpConfigFile)) {
        $canLoadPage = true;
    }
    ?>
<p class="wsd_user_notify">
    <strong>Important</strong>: Make a backup of your database before using this tool!
</p>
<?php 
    if (!$canLoadPage) {
        // Display the error message
        echo wsd_eInfo('
            The <strong>wp-config.php</strong> file MUST be writable in order to perform this action.
            You have to manually change permissions for this file.');
    }
    ?>


<?php 
    /*[ BEGIN PAGE DATABASE ]*/
    ?>
<div id="wsd_db_wrapper">
    <?php 
    /* Display the Database backup page */
    echo wsd_getTemplate('db-backup');
    ?>
    
    <br/>
    <div style="clear:both;"></div>
    
    <?php 
    /* Stop here if the wp-config file is not writable or if we cannot change its permissions */
    if ($canLoadPage) {
        // Display the Change Database Table prefix page
        echo wsd_getTemplate('db-change-prefix', array('wsd_wpConfigFile' => $wsd_wpConfigFile, 'old_prefix' => $GLOBALS['table_prefix'], 'new_prefix' => empty($_POST['newPrefixInput']) ? '' : $_POST['newPrefixInput'], 'isPostBack' => $_SERVER['REQUEST_METHOD'] == 'POST' ? true : false));
    }
    ?>
</div>
<?php 
    /*[ END PAGE DATABASE ]*/
    ?>

<p style="height:200px;"></p>

<?php 
    // Show footer
    mrt_wpss_menu_footer();
}
Beispiel #2
0
                echo '<br/><span style="color:#fff;">' . __('Download backup file:') . ' </span>';
                echo '<a href="', get_option('siteurl'), '/wp-content/plugins/wp-security-scan/backups/', $fname, '" style="color:#0f0">', $fname, '</a>';
                echo '</p>';
            } else {
                echo '<p id="bck" class="wsd_user_notify">';
                echo __('The database could not be backed up!');
                echo '<br/>' . __('A posible error might be that you didn\'t set up writing permissions for the backups directory!');
                echo '</p>';
            }
        }
    }
    ?>
            <?php 
} else {
    // The directory is not writable. Display info message
    echo wsd_eInfo('<strong>Important</strong>: The <strong title="' . $wsd_bckDirPath . '" class="wsd_cursor_help">backups</strong> directory must be writable in order to use this functionality!');
}
?>

        </div>
    </div>

    <?php 
/*[ DATABASE BACKUPS ]*/
?>
    <div style="float:right;width:48%;" class="inner-sidebar1 postbox">
        <h3 class="hndle"><span><?php 
echo __('Database Backup Files');
?>
</span></h3>
        <div class="inside">
Beispiel #3
0
            $wsd_Message .= wsd_eInfo('There are no tables to rename!');
        } else {
            $result = wsd_renameTables($tables, $old_prefix, $new_prefix);
            // check for errors
            if (!empty($result)) {
                $wsd_Message .= wsd_eInfo('All tables have been successfully updated!', 'success');
                // try to rename the fields
                $wsd_Message .= wsd_renameDbFields($old_prefix, $new_prefix);
                if (wsd_updateWpConfigTablePrefix($wsd_wpConfigFile, $old_prefix, $new_prefix)) {
                    $wsd_Message .= wsd_eInfo('The wp-config file has been successfully updated!', 'success');
                } else {
                    $wsd_Message .= wsd_eInfo('The wp-config file could not be updated! You have to manually update the table_prefix variable
                            to the one you have specified: ' . $new_prefix);
                }
            } else {
                $wsd_Message .= wsd_eInfo('An error has occurred and the tables could not be updated!');
            }
        }
        // End if there are tables to rename
    }
} else {
    $new_prefix = $old_prefix;
}
?>



<br/>
<form action="#cdtp" method="post" name="prefixchanging">
	<?php 
if (function_exists('wp_nonce_field')) {