Beispiel #1
0
<?php

// This code runs everywhere. pb_backupbuddy::$options preloaded.
// TODO: Remove file check?
if (file_exists('destinations/live/live.php')) {
    foreach (pb_backupbuddy::$options['remote_destinations'] as $destination) {
        // See if we have Live activated.
        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.');