当前位置: 首页>>代码示例>>PHP>>正文


PHP pb_backupbuddy::_POST方法代码示例

本文整理汇总了PHP中pb_backupbuddy::_POST方法的典型用法代码示例。如果您正苦于以下问题:PHP pb_backupbuddy::_POST方法的具体用法?PHP pb_backupbuddy::_POST怎么用?PHP pb_backupbuddy::_POST使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pb_backupbuddy的用法示例。


在下文中一共展示了pb_backupbuddy::_POST方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: parse_options

function parse_options($restoreData)
{
    if ('1' == pb_backupbuddy::_POST('restoreFiles')) {
        $restoreData['restoreFiles'] = true;
    } else {
        $restoreData['restoreFiles'] = false;
    }
    if ('1' == pb_backupbuddy::_POST('restoreDatabase')) {
        $restoreData['restoreDatabase'] = true;
    } else {
        $restoreData['restoreDatabase'] = false;
    }
    if ('1' == pb_backupbuddy::_POST('migrateHtaccess')) {
        $restoreData['migrateHtaccess'] = true;
    } else {
        $restoreData['migrateHtaccess'] = false;
    }
    if ('all' == pb_backupbuddy::_POST('zipMethodStrategy') || 'ziparchive' == pb_backupbuddy::_POST('zipMethodStrategy') || 'pclzip' == pb_backupbuddy::_POST('zipMethodStrategy')) {
        $restoreData['zipMethodStrategy'] = pb_backupbuddy::_POST('zipMethodStrategy');
    }
    /*
    if ( ( isset( $_POST['log_level'] ) ) && ( $_POST['log_level'] != '' ) ) {
    	pb_backupbuddy::$options['log_level'] = $_POST['log_level'];
    } else {
    	pb_backupbuddy::$options['log_level'] = '';
    }
    */
    return $restoreData;
}
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:29,代码来源:2.php

示例2: api

 function api()
 {
     die('0');
     // TODO: Internal security lockout.
     if (!isset(pb_backupbuddy::$options['api_key_test']) || pb_backupbuddy::$options['api_key_test'] == '') {
         die('0');
     }
     if (pb_backupbuddy::$options['api_key_test'] != 'dsnfilasbfisybfdjybfjalybsfaklsbfa') {
         die('0');
     }
     $run = pb_backupbuddy::_POST('run');
     // TODO: TESTING temp allow GET method:
     if ('' == $run) {
         $run = pb_backupbuddy::_GET('run');
     }
     if ('' == $run) {
         die(json_encode(array('success' => false, 'error' => 'Error #489384: Missing run command.')));
     } else {
         if (false === ($return = call_user_func('backupbuddy_api::' . $run))) {
             die(json_encode(array('success' => false, 'error' => 'Error #328983: Command failed.')));
         } else {
             die(json_encode(array('success' => true, 'version' => pb_backupbuddy::settings('version'), 'data' => $return)));
         }
     }
     die;
 }
开发者ID:elephantcode,项目名称:elephantcode,代码行数:26,代码来源:ajax.php

示例3: plugin_information

function plugin_information($plugin_slug, $data)
{
    $plugin_path = $data['path'];
    ?>
	
	<textarea readonly="readonly" rows="7" cols="65" wrap="off" style="width: 100%;"><?php 
    //echo "Version History:\n\n";
    readfile($plugin_path . '/history.txt');
    ?>
</textarea>
	<script type="text/javascript">
		jQuery(document).ready(function() {
			jQuery("#pluginbuddy_<?php 
    echo $plugin_slug;
    ?>
_debugtoggle").click(function() {
				jQuery("#pluginbuddy_<?php 
    echo $plugin_slug;
    ?>
_debugtoggle_div").slideToggle();
			});
		});
	</script>
	<?php 
    if (pb_backupbuddy::_POST('reset_defaults') == $plugin_slug) {
        if (call_user_func('pb_' . $plugin_slug . '::reset_options', true) === true) {
            pb_backupbuddy::alert('Plugin settings have been reset to defaults for plugin `' . $data['name'] . '`.');
        } else {
            pb_backupbuddy::alert('Unable to reset plugin settings. Verify you are running the latest version.');
        }
    }
    ?>
	
	<?php 
}
开发者ID:netfor,项目名称:nextrading,代码行数:35,代码来源:_other.php

示例4: fatal_test_die

function fatal_test_die()
{
    echo '<div style="padding: 10px;"><b>Fatal errors encountered during testing. Please resolve them to continue tests.</b></div>';
    if (pb_backupbuddy::_POST('skip_database_import') == '1') {
        echo '<br><span class="pb_label pb_label-info">Important</span> Database import set to be skipped based on advanced options. Any failures ignored.<br><br>';
        echo '<!-- Success. -->';
    }
    die;
}
开发者ID:FelixNong1990,项目名称:andy,代码行数:9,代码来源:mysql_test.php

示例5: check

 public static function check($force_check = false)
 {
     if (true === self::$_checked && $force_check === false) {
         // Skip checking if already skipped unless forcing.
         return self::$_authenticated;
     }
     $login_attempt_file = ABSPATH . 'importbuddy/_login_attempts.php';
     $login_attempts = 1;
     if (file_exists($login_attempt_file)) {
         $login_attempts = @file_get_contents($login_attempt_file);
     }
     if (false !== $login_attempts) {
         $login_attempts = trim(str_replace('<?php die(); ?>', '', $login_attempts));
         if ($login_attempts > self::MAX_LOGIN_ATTEMPTS_ALLOWED) {
             die('Access Denied. Maximum login attempts exceeded. You must delete "_login_attempts.php" in the importbuddy directory to unloack this script to allow it to continue.');
         }
     }
     $actual_pass_hash = PB_PASSWORD;
     if ('#PASSWORD#' == $actual_pass_hash || '' == $actual_pass_hash) {
         die('Error #84578459745. A password must be set.');
     }
     if (pb_backupbuddy::_POST('password') != '') {
         $supplied_pass_hash = md5(pb_backupbuddy::_POST('password'));
     } else {
         if (pb_backupbuddy::_GET('v') != '') {
             // Hash submitted by magic migration.
             $supplied_pass_hash = pb_backupbuddy::_GET('v');
         } else {
             // Normal form submitted hash.
             if (pb_backupbuddy::_POST('pass_hash') != '') {
                 $supplied_pass_hash = pb_backupbuddy::_POST('pass_hash');
             } elseif (pb_backupbuddy::_POST('pb_backupbuddy_pass_hash') != '') {
                 $supplied_pass_hash = pb_backupbuddy::_POST('pb_backupbuddy_pass_hash');
             } else {
                 $supplied_pass_hash = '';
             }
         }
     }
     if ($supplied_pass_hash == $actual_pass_hash) {
         self::$_authenticated = true;
     } else {
         // Incorrect hash. Reset settings & track attempts.
         if ('' != $supplied_pass_hash) {
             // Dont count blank hash as an attempt.
             if (true === self::RESET_DEFAULTS_ON_INVALID_LOGIN) {
                 pb_backupbuddy::reset_defaults();
             }
             if (false !== $login_attempts) {
                 global $pb_login_attempts;
                 $pb_login_attempts = $login_attempts;
                 @file_put_contents($login_attempt_file, '<?php die(); ?>' . ($login_attempts + 1));
             }
         }
     }
     self::$_checked = true;
     return self::$_authenticated;
 }
开发者ID:jimlongo56,项目名称:bhouse,代码行数:57,代码来源:auth.php

示例6: upload

/**
 *	upload()
 *
 *	Processes uploaded backup file.
 *
 *	@return		array		True on upload success; false otherwise.
 */
function upload()
{
    if (isset($_POST['upload']) && $_POST['upload'] == 'local') {
        if (pb_backupbuddy::$options['password'] != '#PASSWORD#') {
            $path_parts = pathinfo($_FILES['file']['name']);
            if (strtolower(substr($_FILES['file']['name'], 0, 6)) == 'backup' && strtolower($path_parts['extension']) == 'zip') {
                if (move_uploaded_file($_FILES['file']['tmp_name'], basename($_FILES['file']['name']))) {
                    pb_backupbuddy::alert('File Uploaded. Your backup was successfully uploaded.');
                    return true;
                } else {
                    pb_backupbuddy::alert('Sorry, there was a problem uploading your file.', true);
                    return false;
                }
            } else {
                pb_backupbuddy::alert('Only properly named BackupBuddy zip archives with a zip extension may be uploaded.', true);
                return false;
            }
        } else {
            pb_backupbuddy::alert('Upload Access Denied. To prevent unauthorized file uploads an importbuddy password must be configured and properly entered to use this feature.');
            return false;
        }
    }
    // DOWNLOAD FILE FROM STASH TO LOCAL.
    if (pb_backupbuddy::_POST('upload') == 'stash') {
        pb_backupbuddy::set_greedy_script_limits(true);
        /*
        echo '<pre>';
        print_r( $_POST );
        echo '</pre>';
        */
        $requestcore_file = dirname(dirname(dirname(__FILE__))) . '/lib/requestcore/requestcore.class.php';
        require_once $requestcore_file;
        $link = pb_backupbuddy::_POST('link');
        $destination_file = dirname(dirname(dirname(dirname(__FILE__)))) . '/' . basename(pb_backupbuddy::_POST('link'));
        $destination_file = substr($destination_file, 0, stripos($destination_file, '.zip') + 4);
        $_GET['file'] = basename($destination_file);
        $request = new RequestCore($link);
        $request->set_write_file($destination_file);
        echo '<div id="pb_importbuddy_working" style="padding: 20px;">Downloading backup from Stash to `' . $destination_file . '`...<br><br><img src="' . pb_backupbuddy::plugin_url() . '/images/loading_large.gif" title="Working... Please wait as this may take a moment..."><br><br></div>';
        flush();
        $response = $request->send_request(false);
        if ($response !== true) {
            pb_backupbuddy::alert('Error #8548459598. Unable to download file from Stash. You may manually download it and upload to the server via FTP.');
        } else {
            // No error.
            if (!file_exists($destination_file)) {
                pb_backupbuddy::alert('Error #34845745878. Stash returned a success but the backup file was not found locally. Check this server\'s directory write permissions. You may manually download it and upload to the server via FTP.');
            }
        }
        echo '<script type="text/javascript">jQuery("#pb_importbuddy_working").hide();</script>';
    }
}
开发者ID:brettex,项目名称:pspark,代码行数:59,代码来源:1.php

示例7: __construct

 /**
  * Class constructor sets up the environment
  *
  * @since 6.4.0.13
  *
  * @return void
  */
 function __construct()
 {
     // Register the tests
     $this->register_tests();
     // Grab the DB credentials from POST
     $creds = array();
     $creds['server'] = pb_backupbuddy::_POST('server');
     $creds['username'] = pb_backupbuddy::_POST('username');
     $creds['password'] = pb_backupbuddy::_POST('password');
     $creds['database'] = pb_backupbuddy::_POST('database');
     $creds['prefix'] = pb_backupbuddy::_POST('prefix');
     // If we don't have all the fields, die with error
     if ('' == $creds['server'] || '' == $creds['username'] || '' == $creds['database'] || '' == $creds['prefix']) {
         $this->tests['overall_error'] = 'One or more database settings was left blank. All fields except optional password are required.';
         die(json_encode($this->tests));
     }
     $this->creds = $creds;
     // Run the tests, one at a time
     $this->run_tests();
 }
开发者ID:jimlongo56,项目名称:rdiv,代码行数:27,代码来源:test-db.php

示例8: parse_options

function parse_options($restoreData)
{
    if ('1' == pb_backupbuddy::_POST('migrateDatabase')) {
        $restoreData['databaseSettings']['migrateDatabase'] = true;
    } else {
        $restoreData['databaseSettings']['migrateDatabase'] = false;
    }
    if ('1' == pb_backupbuddy::_POST('migrateDatabaseBruteForce')) {
        $restoreData['databaseSettings']['migrateDatabaseBruteForce'] = true;
    } else {
        $restoreData['databaseSettings']['migrateDatabaseBruteForce'] = false;
    }
    $restoreData['siteurl'] = preg_replace('|/*$|', '', pb_backupbuddy::_POST('siteurl'));
    // Strip trailing slashes.
    $restoreData['homeurl'] = preg_replace('|/*$|', '', pb_backupbuddy::_POST('homeurl'));
    // Strip trailing slashes.
    if ('' == $restoreData['homeurl']) {
        $restoreData['homeurl'] = $restoreData['siteurl'];
    }
    $restoreData['maxExecutionTime'] = pb_backupbuddy::_POST('max_execution_time');
    return $restoreData;
}
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:22,代码来源:5.php

示例9: parse_options

function parse_options($restoreData)
{
    if ('1' == pb_backupbuddy::_POST('delete_backup')) {
        $restoreData['cleanup']['deleteArchive'] = true;
    } else {
        $restoreData['cleanup']['deleteArchive'] = false;
    }
    if ('1' == pb_backupbuddy::_POST('delete_temp')) {
        $restoreData['cleanup']['deleteTempFiles'] = true;
    } else {
        $restoreData['cleanup']['deleteTempFiles'] = false;
    }
    if ('1' == pb_backupbuddy::_POST('delete_importbuddy')) {
        $restoreData['cleanup']['deleteImportBuddy'] = true;
    } else {
        $restoreData['cleanup']['deleteImportBuddy'] = false;
    }
    if ('1' == pb_backupbuddy::_POST('delete_importbuddylog')) {
        $restoreData['cleanup']['deleteImportLog'] = true;
    } else {
        $restoreData['cleanup']['deleteImportLog'] = false;
    }
    return $restoreData;
}
开发者ID:elephantcode,项目名称:elephantcode,代码行数:24,代码来源:6.php

示例10:

<?php

pb_backupbuddy::$ui->title(__('Deploy Database', 'it-l10n-backupbuddy') . ' &nbsp;&nbsp; <a style="font-size: 0.6em;" href="#" onClick="jQuery(\'#pb_backupbuddy_status_wrap\').toggle();">Display Status Log</a>');
if (!defined('BACKUPBUDDY_API_ENABLE') || TRUE != BACKUPBUDDY_API_ENABLE) {
    pb_backupbuddy::alert("Make sure the following is in your wp-config.php file on this server:<br><textarea style='width: 100%;' disabled='disabled'>define( 'BACKUPBUDDY_API_ENABLE', true ); // Requires API key to access.</textarea>");
    return false;
}
/*
if ( ! defined( 'BACKUPBUDDY_API_SALT' ) || ( 'CHANGEME' == BACKUPBUDDY_API_SALT ) || ( strlen( BACKUPBUDDY_API_SALT ) < 5 ) ) {
	pb_backupbuddy::alert( "Make sure the following is in your wp-config.php file on this server:<br><textarea style='width: 100%;' disabled='disabled'>define( 'BACKUPBUDDY_API_SALT', 'CHANGEME' ); // !!! IMPORTANT !!! Change CHANGEME to the left to a unique password/phrase for generating API keys. 5+ characters.</textarea>" );
	return false;
}
*/
if ('1' == pb_backupbuddy::_POST('regenerate_api_key')) {
    pb_backupbuddy::verify_nonce();
    // Security check.
    pb_backupbuddy::$options['api_key'] = backupbuddy_core::generate_api_key();
    pb_backupbuddy::save();
}
?>

<b>Note:</b> wp-config.php files as well as BackupBuddy settings will NOT be transferred in either direction. Your current BackupBuddy settings, destinations, API keys etc. will remain as they are on both sites.<br><br>

<form method="post">
	<?php 
pb_backupbuddy::nonce();
?>
	<input type="hidden" name="regenerate_api_key" value="1">
	<button class="button secondary-button" onClick="jQuery('.backupbuddy_api_key-hide').toggle(); return false;">Show API Key</button><span class="backupbuddy_api_key-hide" style="display: none;">&nbsp;&nbsp;<input type="submit" name="submit" value="Generate New API Key" class="button button-primary"></span>
	<br>
	<br>
开发者ID:Coop920,项目名称:Sterling-Wellness,代码行数:31,代码来源:deploy.php

示例11: trim

     $authCode = trim(pb_backupbuddy::_POST('dropbox_authorization_code'));
     try {
         list($accessToken, $dropboxUserId) = $webAuth->finish($authCode);
     } catch (\Exception $e) {
         pb_backupbuddy::alert('<b>Verify you authorized BackupBuddy access in Dropbox and copied the Dropbox authorization code exactly in the BackupBuddy field.</b><br><br>Error details: ' . $e->getMessage(), true);
         // '<br><br>' . pb_backupbuddy::$ui->button( pb_backupbuddy::page_url(), '&larr; go back & retry' )
         $bad_auth_code = true;
         $pb_hide_save = true;
     }
     if (false === $bad_auth_code) {
         $dropboxClient = new \Dropbox\Client($accessToken, 'BackupBuddy v' . pb_backupbuddy::settings('version'));
         $accountInfo = $dropboxClient->getAccountInfo();
         $show_config_form = true;
     }
 }
 if ('' == pb_backupbuddy::_POST('dropbox_authorization_code') || true === $bad_auth_code) {
     // No authorization code entered yet so user needs to authorize.
     try {
         $authorizeUrl = $webAuth->start();
     } catch (Exception $e) {
         pb_backupbuddy::alert('Error #8778656: Dropbox error. Details: `' . $e->getMessage() . '`.', true);
         return false;
     }
     echo '<form method="post" action="' . pb_backupbuddy::ajax_url('destination_picker') . '&add=dropbox2&callback_data=' . pb_backupbuddy::_GET('callback_data') . '">';
     echo '<br><b>Adding a Dropbox destination</b><ol>';
     echo '<li> <a href="' . $authorizeUrl . '" class="button-primary pb_dropbox_authorize" target="_new">' . __('Connect to Dropbox.com & Authorize (opens new window)', 'it-l10n-backupbuddy') . '</a></li>';
     echo '<li>Click <b>Allow</b> in the new window (you may need to login to Dropbox.com first).</li>';
     echo '<li>Enter the provided <b>Authorization Code</b>: <input type="text" name="dropbox_authorization_code" size="45"></li>';
     echo '<li><input type="submit" class="button-primary" value="' . __("Yes, I've Authorized BackupBuddy with Dropbox & Entered the Code above", 'it-l10n-backupbuddy') . '"></li>';
     echo '</ol>';
     echo '</form>';
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:31,代码来源:_configure.php

示例12: AmazonS3

		</table>
	</form>
	
	<?php 
    die;
}
$s3 = new AmazonS3($manage_data['credentials']);
// the key, secret, token
if ($settings['ssl'] == '0') {
    @$s3->disable_ssl(true);
}
// Handle deletion.
if (pb_backupbuddy::_POST('bulk_action') == 'delete_backup') {
    pb_backupbuddy::verify_nonce();
    $deleted_files = array();
    foreach ((array) pb_backupbuddy::_POST('items') as $item) {
        $response = $s3->delete_object($manage_data['bucket'], $manage_data['subkey'] . $remote_path . $item);
        if ($response->isOK()) {
            $deleted_files[] = $item;
        } else {
            pb_backupbuddy::alert('Error: Unable to delete `' . $item . '`. Verify permissions.');
        }
    }
    if (count($deleted_files) > 0) {
        pb_backupbuddy::alert('Deleted ' . implode(', ', $deleted_files) . '.');
        delete_transient('pb_backupbuddy_stashquota_' . $itxapi_username);
        // Delete quota transient since it probably has changed now.
    }
    echo '<br>';
}
// Handle copying files to local
开发者ID:AgilData,项目名称:WordPress-Skeleton,代码行数:31,代码来源:_manage.php

示例13: die

<?php

// Incoming vars: $backupFile, $step
if (!current_user_can(pb_backupbuddy::$options['role_access'])) {
    die('Error #473623. Access Denied.');
}
//pb_backupbuddy::verify_nonce();
$restoreData = unserialize(base64_decode(pb_backupbuddy::_POST('restoreData')));
require_once pb_backupbuddy::plugin_path() . '/classes/restore.php';
$rollback = new backupbuddy_restore('rollback', $restoreData);
$status = $rollback->swapDatabases();
if (false === $status) {
    $errors = $rollback->getErrors();
    if (count($errors) > 0) {
        pb_backupbuddy::alert('Errors were encountered: ' . implode(', ', $errors) . ' If seeking support please click to Show Advanced Details above and provide a copy of the log.');
    }
    return;
}
$restoreData = $rollback->getState();
?>


<h3>Test your site then select <i>Accept</i> to lock in changes or <i>Cancel</i> to undo.</h3>
<a href="<?php 
echo site_url();
?>
" target="_new"><b>Click here to test your site</b></a> before proceeding.
<br><br>
If your site functions as expected you may proceed to making these changes permanent by selecting the button below to
accept the changes. If anything appears wrong or you have not made a backup of your original site you should select to cancel
the rollback to revert your site to its prior condition.
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:31,代码来源:_step3.php

示例14: elseif

	</div>
	
	<?php 
$requested_profile = pb_backupbuddy::_GET('backupbuddy_backup');
if ('db' == $requested_profile) {
    // db profile is always index 1.
    $requested_profile = '1';
} elseif ('full' == $requested_profile) {
    // full profile is always index 2.
    $requested_profile = '2';
}
$export_plugins = array();
// Default of no exported plugins. Used by MS export.
if (pb_backupbuddy::_GET('backupbuddy_backup') == 'export') {
    // EXPORT.
    $export_plugins = pb_backupbuddy::_POST('items');
    $profile_array = pb_backupbuddy::$options['0'];
    // Run exports on default profile.
    $profile_array['type'] = 'export';
    // Pass array with export type set.
} else {
    // NOT MULTISITE EXPORT.
    if (is_numeric($requested_profile)) {
        if (isset(pb_backupbuddy::$options['profiles'][$requested_profile])) {
            $profile_array = pb_backupbuddy::$options['profiles'][$requested_profile];
        } else {
            die('Error #84537483: Invalid profile ID `' . htmlentities($requested_profile) . '`. Profile with this number was not found. Try deactivating then reactivating the plugin. If this fails please reset the plugin Settings back to Defaults from the Settings page.');
        }
    } else {
        die('Error #85489548955. Invalid profile ID not numeric: `' . htmlentities($requested_profile) . '`.');
    }
开发者ID:netfor,项目名称:nextrading,代码行数:31,代码来源:_backup-perform.php

示例15:

				<?php 
            }
            // end if type not blank.
            //echo implode( ' - ', $meta );
            echo '</div>';
            echo '</li>';
        }
        echo '</ul>';
    }
    ?>
	
<?php 
}
// End file not given in querystring.
// If one or more backup files was found then provide a button to continue.
if (!empty($backup_archives) || 'stash' == pb_backupbuddy::_POST('upload')) {
    echo '</div><!-- /wrap -->';
    ?>
	
	
	<div class="main_box_foot">
		<center>
			
			<div style="margin-top: 20px; margin-bottom: 30px;">
				<b>What would you like to restore from the backup?</b>
				&nbsp;&nbsp;
				<label style="float: inherit;">
					<input type="checkbox" name="restoreFiles" value="1" CHECKED> Files
				</label>
				&nbsp;&nbsp;
				<label style="float: inherit;">
开发者ID:RainyDayMedia,项目名称:baldwin,代码行数:31,代码来源:home.php


注:本文中的pb_backupbuddy::_POST方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。