DB Options Updated.
';
}
echo '
';
}
function db_manage_page() {
if ((get_option('dbmanage_abs_path') == '') || (get_option('dbmanage_web_path') == '')) {
echo '
Warning
It appears that you have not setup the DB Management Options. Please do so now.
';
} elseif (!is_dir(get_option('dbmanage_abs_path'))) {
if (!@mkdir(get_option('dbmange_abs_path'), 0777)) {
echo '
Warning
It appears that the directory you have defined in your DB Manage Options does not exist.
We attempted to create this directory for you but where unsuccessfull in doing so. You will have to manually create this directory to correct this problem.
';
}
} elseif (!is_writable(get_option('dbmanage_abs_path'))) {
if (!@chmod(get_option('dbmanage_abs_path'), 0777)) {
echo '
Warning
It appears that the directory you have select to hold backup files: is not writeable by your webserver.
We atempted to change this but we are unable to chmod the directory, you must do this manually.
';
}
} else {
if (isset($_POST['db_manage_update'])) {
$do = $_POST['submit'];
$tmp_name = $_FILES['rst_file']['tmp_name'];
$real_name = get_option('dbmanage_abs_path') . $_FILES['rst_file']['name'];
if ($do == "Backup Database") {
makeBackup();
echo '
Database Backed Up Successfully
';
} elseif ($do == "Restore Database") {
/**
* Do the checks
**/
if ($_FILES['rst_file']['name'] == '') {
echo '
Error
It appears that you forgot to select a file
';
} elseif ($_FILES['rst_file']['size'] == 0) {
echo '
Error
The file you are uploading appears to be empty
';
} else {
move_uploaded_file($tmp_name, $real_name);
makeRestore($_FILES['rst_file']['name']);
echo '
Database Restored Successfully
';
}
}
}
if (isset($_GET['del'])) {
$del = $_GET['del'];
unlink(get_option('dbmanage_abs_path') . $del);
echo '';
} elseif (isset($_GET['restore'])) {
$restore = $_GET['restore'];
makeRestore($restore);
echo '
Database Restored Successfully
';
}
echo '
Backup Files
| You can download any of the database files listed below by simply right clicking on them and selecting the "Save Target As..." option. |
| |
';
pullFiles();
echo '
';
}
}
?>