Ejemplo n.º 1
0
 // Form submitted.
 if (count($settings_result['errors']) > 0) {
     // Form errors.
     echo $login_welcome;
     pb_backupbuddy::alert(implode('<br>', $settings_result['errors']));
     $credentials_form->display_settings('Submit');
     $pb_hide_test = true;
     $pb_hide_save = true;
     return;
 } else {
     // No form errors; process!
     require_once dirname(__FILE__) . '/class.itx_helper2.php';
     global $wp_version;
     $itxapi_username = strtolower($settings_result['data']['itxapi_username']);
     $itxapi_password = iThemes_Credentials::get_password_hash($itxapi_username, $settings_result['data']['itxapi_password_raw']);
     $itxapi_token = ITXAPI_Helper2::get_wordpress_phpass('jwooley', $itxapi_password, 'http://jordan.dev.ithemes.com', '4.1');
     //site_url(), $wp_version );
     $url_params = array('action' => 'connect', 'user' => $itxapi_username, 'wp' => $wp_version, 'site' => site_url(), 'timestamp' => time());
     $post_params = array('auth_token' => $itxapi_token);
     echo 'username: '******'passhash: ';
     echo $itxapi_password . '<br>';
     echo '<pre>';
     print_r($url_params);
     print_r($post_params);
     echo '</pre>';
     $response = ITXAPI_Helper2::remote_post($url_params, $post_params);
     if (!is_array($response)) {
         // Error message.
         die($response);