Ejemplo n.º 1
0
     removeMolecules($cid);
     break;
 case 'packagedelete':
     packageDelete($option);
     break;
 case 'deletepackage':
     pakageDeleteProcess();
     break;
 case 'cancel':
     cancelMolecule();
     break;
 case 'about':
     aboutComponent();
     break;
 case 'exportdb':
     exportDB();
     break;
 case 'importdb':
     importDB($option);
     break;
 case 'importdbprocess':
     importDBProcess();
     break;
 case 'listoffiles':
     listOfFiles($option);
     break;
 case 'viewlog':
     showLogFile();
     break;
 case 'delfiles':
     delFiles($fid);
Ejemplo n.º 2
0
// database server configuration
include "config.php";
// common functions
include "common/functions.php";
// strict error reporting while debugging
error_reporting(E_ALL);
ini_set('display_errors', 'On');
// connect to db server
$connection = @mysql_connect($config["host"]["name"], $config["host"]["user"], $config["host"]["password"]) or die('Couldn\'t connect: ' . mysql_error());
// get the database list
$dbs = listDBs($connection);
// run the backup
$backupResult = false;
if (isset($_POST["export"])) {
    // dump this database to a file
    exportDB($connection, $_POST["db"], $_POST["filename"], $_POST["local-host-url"], $_POST["remote-host-url"]);
    $backupResult = true;
}
// if this is a file download, we have to send via headers before showing the page
if (isset($_POST["download"])) {
    // security check: does the file exist? Is it something other than a .php file? Then okay.
    // otherwise: DIE.
    // adapted from http://safalra.com/programming/php/prevent-hotlinking/
    if (!($file = realpath($_POST["filename"])) || substr($file, -4) == '.php') {
        header('HTTP/1.0 404 Not Found');
        exit;
    }
    // if the temporary file is there, send it then delete it from the server after download
    if (file_exists($_POST["filename"])) {
        $size = filesize($_POST["filename"]);
        header('Content-Type: application/octet-stream');
Ejemplo n.º 3
0
        array_push($dbs, $row->Database);
    }
    if (count($dbs)) {
        return $dbs;
    }
}
// strict error reporting while debugging
error_reporting(E_ALL);
ini_set('display_errors', 'On');
// connect to db server
$connection = @mysql_connect($config["host"]["name"], $config["host"]["user"], $config["host"]["password"]) or die('Couldn\'t connect: ' . mysql_error());
$dbs = listDBs($connection);
$backupResult = false;
if (isset($_POST["export"])) {
    // dump this database to a file
    exportDB($connection, $_POST["db"], $_POST["filename"]);
    $backupResult = true;
}
if (isset($_POST["download"])) {
    // security check: does the file exist? Is it something other than a .php file? Then okay.
    // otherwise: DIE.
    // adapted from http://safalra.com/programming/php/prevent-hotlinking/
    if (!($file = realpath($_POST["filename"])) || substr($file, -4) == '.php') {
        //header('HTTP/1.0 404 Not Found');
        echo "no dice";
        exit;
    }
    if (file_exists($_POST["filename"])) {
        $size = filesize($_POST["filename"]);
        header('Content-Type: application/octet-stream');
        header('Content-Disposition: attachment; filename=' . $_POST["filename"]);
Ejemplo n.º 4
0
     if ($tableResult) {
         echo $tableResult;
     }
 }
 // display the tables on screen so we can see they were created
 echo "<h2>Showing script-created tables</h2>";
 if ($tables = getTableList($connection, $config["db"]["name"])) {
     foreach ($tables as $id => $table) {
         printTable($connection, $table);
     }
 }
 //
 // export and kill database
 //
 // dump this database to a file
 exportDB($connection, $config["db"]["name"], $config["db"]["backupFile"]);
 // remove the tables we just created
 foreach ($db_schema as $table => $keys) {
     $tableResult = deleteTable($connection, $table);
     // if there's an error, show it
     if ($tableResult) {
         echo $tableResult;
     }
 }
 // display the tables on screen so we can see they were dumped
 echo "<h2>Showing tables after database export and table dump</h2>";
 if ($tables = getTableList($connection, $config["db"]["name"])) {
     foreach ($tables as $id => $table) {
         printTable($connection, $table);
     }
 } else {