예제 #1
0
        if ('live' == $destination['type']) {
            include 'destinations/live/live.php';
            backupbuddy_live::init();
            break;
        }
    }
}
include 'classes/constants.php';
include 'classes/api.php';
// Handle API calls if backupbuddy_api_key is posted. If anything fails security checks pretend nothing at all happened.
if ('' != pb_backupbuddy::_POST('backupbuddy_api_key')) {
    // Remote API access.
    if (isset(pb_backupbuddy::$options['remote_api']) && count(pb_backupbuddy::$options['remote_api']['keys']) > 0 && defined('BACKUPBUDDY_API_ENABLE') && TRUE == BACKUPBUDDY_API_ENABLE) {
        // Verify API is enabled. && defined( 'BACKUPBUDDY_API_SALT' ) && ( 'CHANGEME' != BACKUPBUDDY_API_SALT ) && ( strlen( BACKUPBUDDY_API_SALT ) >= 5 )
        include 'classes/remote_api.php';
        backupbuddy_remote_api::localCall($secure = true);
        die;
    }
}
// Internal cron (disabled by default).
if ('1' == pb_backupbuddy::$options['use_internal_cron'] && 'process_backup' == pb_backupbuddy::_POST('backupbuddy_cron_action')) {
    // Verify access to trigger cron.
    if (pb_backupbuddy::$options['log_serial'] != pb_backupbuddy::_POST('backupbuddy_key')) {
        die('Access Denied.');
    }
    // Ignore anything older than 5 min.
    $max_cron_age = 60 * 5;
    if (time() - pb_backupbuddy::_POST('backupbuddy_time') > $max_cron_age) {
        die('Cron action too old.');
    }
    // Try to prevent any caching layer.
예제 #2
0
            }
            if (is_array($statedata)) {
                // Valid content.
                pb_backupbuddy::status('details', 'Loaded default state overwrite file data and gave it priority over current state. File: `' . $override_state_file . '`.');
                pb_backupbuddy::$options['default_state_overrides'] = $statedata;
                pb_backupbuddy::save();
            } else {
                pb_backupbuddy::status('warning', 'Default state overwrite file found but unable to access it.');
            }
        }
    }
}
// Handle API calls if backupbuddy_api_key is posted. If anything fails security checks pretend nothing at all happened.
if ('' != pb_backupbuddy::_POST('backupbuddy_api_key')) {
    // Remote API access.
    if (isset(pb_backupbuddy::$options['remote_api']['keys']) && count(pb_backupbuddy::$options['remote_api']['keys']) > 0) {
        // Remote API enabled and 1 or more keys defined.
        include 'classes/remote_api.php';
        backupbuddy_remote_api::localCall($secure = true, $importbuddy = true);
        die;
    }
}
if (pb_backupbuddy::_GET('display_mode') == 'embed') {
    pb_backupbuddy::$options['display_mode'] = 'embed';
    pb_backupbuddy::save();
}
// ********** ACTIONS (global) **********
// ********** AJAX (global) **********
// ********** CRON (global) **********
// ********** FILTERS (global) **********
// ********** WIDGETS (global) **********