Beispiel #1
0
function cleanup()
{
    if (isset($_POST['delete_backup']) && $_POST['delete_backup'] == '1') {
        remove_file(pb_backupbuddy::$options['file'], 'backup .ZIP file (' . pb_backupbuddy::$options['file'] . ')', true);
    }
    if (isset($_POST['delete_temp']) && $_POST['delete_temp'] == '1') {
        // Full backup .sql file
        remove_file(ABSPATH . 'wp-content/uploads/temp_' . pb_backupbuddy::$options['zip_id'] . '/db.sql', 'db.sql (backup database dump)', false);
        remove_file(ABSPATH . 'wp-content/uploads/temp_' . pb_backupbuddy::$options['zip_id'] . '/db_1.sql', 'db_1.sql (backup database dump)', false);
        remove_file(ABSPATH . 'wp-content/uploads/backupbuddy_temp/' . pb_backupbuddy::$options['zip_id'] . '/db_1.sql', 'db_1.sql (backup database dump)', false);
        // DB only sql file
        remove_file(ABSPATH . 'db.sql', 'db.sql (backup database dump)', false);
        remove_file(ABSPATH . 'db_1.sql', 'db_1.sql (backup database dump)', false);
        // Full backup dat file
        remove_file(ABSPATH . 'wp-content/uploads/temp_' . pb_backupbuddy::$options['zip_id'] . '/backupbuddy_dat.php', 'backupbuddy_dat.php (backup data file)', false);
        remove_file(ABSPATH . 'wp-content/uploads/backupbuddy_temp/' . pb_backupbuddy::$options['zip_id'] . '/backupbuddy_dat.php', 'backupbuddy_dat.php (backup data file)', false);
        // DB only dat file
        remove_file(ABSPATH . 'backupbuddy_dat.php', 'backupbuddy_dat.php (backup data file)', false);
        remove_file(ABSPATH . 'wp-content/uploads/backupbuddy_temp/' . pb_backupbuddy::$options['zip_id'] . '/', 'Temporary backup directory.', false);
        remove_file(ABSPATH . 'importbuddy/', 'ImportBuddy Directory', true);
        remove_file(ABSPATH . 'importbuddy/_settings_dat.php', '_settings_dat.php (temporary settings file)', false);
    }
    if (isset($_POST['delete_importbuddy']) && $_POST['delete_importbuddy'] == '1') {
        remove_file('importbuddy.php', 'importbuddy.php (this script)', true);
    }
    // Delete log file last.
    if (isset($_POST['delete_importbuddylog']) && $_POST['delete_importbuddylog'] == '1') {
        remove_file('importbuddy-' . pb_backupbuddy::$options['log_serial'] . '.txt', 'importbuddy-' . pb_backupbuddy::$options['log_serial'] . '.txt log file', true);
    }
}
Beispiel #2
0
function remove_file($dirx)
{
    // This code seems pretty damn ineffective to me, maybe there is a better way..
    $dir = dir($dirx);
    while ($file = $dir->read()) {
        if ($file != "." && $file != "..") {
            if (is_dir("{$dirx}/{$file}")) {
                remove_file("{$dirx}/{$file}");
            } else {
                unlink("{$dirx}/{$file}");
            }
        }
    }
    rmdir($dirx);
}
Beispiel #3
0
function cleanup($restoreData)
{
    if (true !== $restoreData['cleanup']['deleteArchive']) {
        pb_backupbuddy::status('details', 'Skipped deleting backup archive.');
    } else {
        remove_file($restoreData['archive'], 'backup .ZIP file (' . $restoreData['archive'] . ')', true);
    }
    if (true !== $restoreData['cleanup']['deleteTempFiles']) {
        pb_backupbuddy::status('details', 'Skipped deleting temporary files.');
    } else {
        // Full backup .sql file
        remove_file(ABSPATH . 'wp-content/uploads/temp_' . $restoreData['serial'] . '/db.sql', 'db.sql (backup database dump)', false);
        remove_file(ABSPATH . 'wp-content/uploads/temp_' . $restoreData['serial'] . '/db_1.sql', 'db_1.sql (backup database dump)', false);
        remove_file(ABSPATH . 'wp-content/uploads/backupbuddy_temp/' . $restoreData['serial'] . '/db_1.sql', 'db_1.sql (backup database dump)', false);
        // DB only sql file
        remove_file(ABSPATH . 'db.sql', 'db.sql (backup database dump)', false);
        remove_file(ABSPATH . 'db_1.sql', 'db_1.sql (backup database dump)', false);
        // Full backup dat file
        remove_file(ABSPATH . 'wp-content/uploads/temp_' . $restoreData['serial'] . '/backupbuddy_dat.php', 'backupbuddy_dat.php (backup data file)', false);
        remove_file(ABSPATH . 'wp-content/uploads/backupbuddy_temp/' . $restoreData['serial'] . '/backupbuddy_dat.php', 'backupbuddy_dat.php (backup data file)', false);
        // DB only dat file
        remove_file(ABSPATH . 'backupbuddy_dat.php', 'backupbuddy_dat.php (backup data file)', false);
        remove_file(ABSPATH . 'wp-content/uploads/backupbuddy_temp/' . $restoreData['serial'] . '/', 'Temporary backup directory', false);
        // Temp restore dir.
        remove_file(ABSPATH . 'importbuddy/temp_' . $restoreData['serial'] . '/', 'Temporary restore directory', false);
        remove_file(ABSPATH . 'importbuddy/', 'ImportBuddy Directory', true);
        remove_file(ABSPATH . 'importbuddy/_settings_dat.php', '_settings_dat.php (temporary settings file)', false);
        // Remove state file (deployment/default settings).
        global $importbuddy_file;
        $importFileSerial = backupbuddy_core::get_serial_from_file($importbuddy_file);
        $state_file = ABSPATH . 'importbuddy-' . $importFileSerial . '-state.php';
        remove_file($state_file, 'Default state data file', false);
    }
    if (true !== $restoreData['cleanup']['deleteImportBuddy']) {
        pb_backupbuddy::status('details', 'Skipped deleting ' . $importbuddy_file . ' (this script).');
    } else {
        global $importbuddy_file;
        remove_file(ABSPATH . $importbuddy_file, $importbuddy_file . ' (this script)', true);
    }
    // Delete log file last.
    if (true !== $restoreData['cleanup']['deleteImportLog']) {
        pb_backupbuddy::status('details', 'Skipped deleting import log.');
    } else {
        remove_file('importbuddy-' . pb_backupbuddy::$options['log_serial'] . '.txt', 'importbuddy-' . pb_backupbuddy::$options['log_serial'] . '.txt log file', true);
    }
}
Beispiel #4
0
    exit;
}
if (isset($_GET["l7filter-status"])) {
    l7filter_status();
    exit;
}
if (isset($_GET["artica-status-restart"])) {
    artica_status_restart();
    exit;
}
if (isset($_GET["account-progress"])) {
    account_progress();
    exit;
}
if (isset($_GET["remove-logs-file"])) {
    remove_file();
    exit;
}
if (isset($_GET["install-artica-tgz"])) {
    install_artica_tgz();
    exit;
}
if (isset($_GET["mii-tool-save"])) {
    MII_TOOLS_SAVE();
    exit;
}
if (isset($_GET["mii-tools"])) {
    MII_TOOLS();
    exit;
}
if (isset($_GET["create-new-uuid"])) {
Beispiel #5
0
		writelogs("_GET:: receive $num=$line",__FUNCTION__,__FILE__,__LINE__);
	}			
	
		if(!IsRights()){
			$tpl=new templates();
			$error=$tpl->javascript_parse_text("{ERROR_NO_PRIVS}");
			echo "alert('$error')";
			die();
		}
		

		if(isset($_GET["chgperms-js"])){chgperms_js();exit;}
		if(isset($_POST["chgperms-file"])){chgperms_file();exit;}
		
		if(isset($_GET["remove-file-js"])){remove_file_js();exit;}
		if(isset($_POST["remove-file"])){remove_file();exit;}
		if(isset($_GET["popup"])){popup();exit;}
		if(isset($_GET["browse-folder"])){browse_folder();exit;}
		if(isset($_GET["folder-infos"])){folder_infos();exit;}
		if(isset($_GET["top-bar"])){top_bar();exit;}
		if(isset($_GET["file-info"])){file_info();exit;}
		if(isset($_GET["download-file"])){download_file();exit;}
		if(isset($_GET["create-folder"])){create_folder();exit;}
		if(isset($_GET["delete-folder"])){delete_folder();exit;}
		if(isset($_GET["share-folder"])){share_folder();exit;}
		if(isset($_GET["unshare-rsync"])){rsync_unshare();exit;}
		if(isset($_GET["upload-file"])){upload_file_popup();exit;}
		if(isset($_GET["form-upload"])){upload_file_iframe();exit;}
		if( isset($_GET['TargetpathUploaded']) ){upload_form_perform();exit();}
		if(isset($_GET["loupe-js"])){loupe_js();exit;}
		if(isset($_GET["loupe-popup"])){loupe_popup();exit;}
Beispiel #6
0
function remove($ct, $id)
{
    global $g;
    $db = $g['db'];
    $ctdb = $g['content'][$ct];
    foreach ($ctdb->references as $v) {
        if ($v == 'image' || $v == 'video' || $v == 'doc') {
            remove_file($ct, $id, $v);
        }
    }
    $i = $ctdb->get($id);
    if ($i == 0) {
        return false;
    }
    $ctdb->delete();
    return true;
}
Beispiel #7
0
function delete_slot()
{
    global $nodeinfo, $HTTP_POST_VARS, $field_image_file, $field_image_file_name, $sess, $HTTP_HOST;
    if (!defined("RED_NOTIFICATION_INC")) {
    }
    include "messages/red_notification.inc";
    $slotobj = get_slot_info($HTTP_POST_VARS['id']);
    rm_slot_ex($slotobj, true);
    remove_file($HTTP_POST_VARS['id']);
    //Notify users only if god (admin) wants them to be notified (the default)
    if (isset($HTTP_POST_VARS['field_notify_users']) and $slotobj['islive'] == "y") {
        $trail1 = get_node_info($slotobj['trail_1_id']);
        $trail2 = $slotobj['trail_2_id'] ? get_node_info($slotobj['trail_2_id']) : -1;
        send_red_notification(LTMSG_SLOTTERM, $trail1['userid'], $trail1['id'], $slotobj['node']);
        if ($trail2 != -1) {
            send_red_notification(LTMSG_SLOTTERM, $trail2['userid'], $trail2['id'], $slotobj['node']);
        }
    }
    // page_close();
    header("Location: " . $sess->url($nodeinfo['path']));
    echo "blepp";
    exit;
}