Changeset 8811
- Timestamp:
- 09/05/2008 05:35:58 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-filesystem-ftpext.php
r8645 r8811 73 73 $this->options['password'] = $opt['password']; 74 74 75 $this->options['ssl'] = ( !empty($opt['ssl']) ); 75 $this->options['ssl'] = false; 76 if ( isset($opt['ssl']) ) 77 $this->options['ssl'] = ( !empty($opt['ssl']) ); 78 elseif ( isset( $opt['connection_type']) ) 79 $this->options['ssl'] = ( 'ftps' == $opt['connection_type'] ); 76 80 } 77 81 -
trunk/wp-admin/includes/file.php
r8718 r8811 449 449 require_once(ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php'); 450 450 451 $method = get_filesystem_method( );451 $method = get_filesystem_method($args); 452 452 453 453 if ( ! $method ) … … 472 472 } 473 473 474 function get_filesystem_method( ) {474 function get_filesystem_method($args = array()) { 475 475 $method = false; 476 476 if( function_exists('getmyuid') && function_exists('fileowner') ){ … … 481 481 } 482 482 483 if ( isset($args['connection_type']) && 'ssh' == $args['connection_type'] ) { 484 $method = 'SSH2'; 485 return apply_filters('filesystem_method', $method); 486 } 487 483 488 if ( ! $method && extension_loaded('ftp') ) $method = 'ftpext'; 484 489 if ( ! $method && ( extension_loaded('sockets') || function_exists('fsockopen') ) ) $method = 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread … … 503 508 $credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? $_POST['username'] : $credentials['username']); 504 509 $credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? $_POST['password'] : $credentials['password']); 505 $credentials['ssl'] = defined('FTP_SSL') ? FTP_SSL : ( isset($_POST['ssl']) ? $_POST['ssl'] : $credentials['ssl']); 510 if ( defined('FTP_SSH') || 'ssh' == $_POST['connection_type'] ) 511 $credentials['connection_type'] = 'ssh'; 512 else if ( defined('FTP_SSL') || 'ftps' == $_POST['connection_type'] ) 513 $credentials['connection_type'] = 'ftps'; 514 else 515 $credentials['connection_type'] = 'ftp'; 506 516 507 517 if ( ! $error && !empty($credentials['password']) && !empty($credentials['username']) && !empty($credentials['hostname']) ) { … … 517 527 if ( !empty($credentials) ) 518 528 extract($credentials, EXTR_OVERWRITE); 519 if( $error ) 520 echo '<div id="message" class="error"><p>' . __('<strong>Error:</strong> There was an error connecting to the server, Please verify the settings are correct.') . '</p></div>'; 529 if ( $error ) { 530 $error_string = __('<strong>Error:</strong> There was an error connecting to the server, Please verify the settings are correct.'); 531 if ( is_wp_error($error) ) 532 $error_string = $error->get_error_message(); 533 echo '<div id="message" class="error"><p>' . $error_string . '</p></div>'; 534 } 521 535 ?> 522 536 <form action="<?php echo $form_post ?>" method="post"> … … 526 540 <table class="form-table"> 527 541 <tr valign="top"> 528 <th scope="row"><label for="hostname"><?php _e('Hostname :') ?></label></th>542 <th scope="row"><label for="hostname"><?php _e('Hostname') ?></label></th> 529 543 <td><input name="hostname" type="text" id="hostname" value="<?php echo attribute_escape($hostname) ?>"<?php if( defined('FTP_HOST') ) echo ' disabled="disabled"' ?> size="40" /></td> 530 544 </tr> 531 545 <tr valign="top"> 532 <th scope="row"><label for="username"><?php _e('Username :') ?></label></th>546 <th scope="row"><label for="username"><?php _e('Username') ?></label></th> 533 547 <td><input name="username" type="text" id="username" value="<?php echo attribute_escape($username) ?>"<?php if( defined('FTP_USER') ) echo ' disabled="disabled"' ?> size="40" /></td> 534 548 </tr> 535 549 <tr valign="top"> 536 <th scope="row"><label for="password"><?php _e('Password :') ?></label></th>550 <th scope="row"><label for="password"><?php _e('Password') ?></label></th> 537 551 <td><input name="password" type="password" id="password" value=""<?php if( defined('FTP_PASS') ) echo ' disabled="disabled"' ?> size="40" /><?php if( defined('FTP_PASS') && !empty($password) ) echo '<em>'.__('(Password not shown)').'</em>'; ?></td> 538 552 </tr> 539 553 <tr valign="top"> 540 <th scope="row">< label for="ssl"><?php _e('Use SSL:') ?></label></th>554 <th scope="row"><?php _e('Connection Type') ?></th> 541 555 <td> 542 <select name="ssl" id="ssl"<?php if( defined('FTP_SSL') ) echo ' disabled="disabled"' ?>> 543 <?php 544 foreach ( array(0 => __('No'), 1 => __('Yes')) as $key => $value ) : 545 $selected = ($ssl == $value) ? 'selected="selected"' : ''; 546 echo "\n\t<option value='$key' $selected>" . $value . '</option>'; 547 endforeach; 548 ?> 549 </select> 556 <fieldset><legend class="hidden"><?php _e('Connection Type') ?> </legend> 557 <p><label><input name="connection_type" type="radio" value="ftp" <?php checked('ftp', $connection_type); ?> /> <?php _e('FTP') ?></label><br /> 558 <label><input name="connection_type" type="radio" value="ftps" <?php checked('ftps', $connection_type); ?> /> <?php _e('FTPS (SSL)') ?></label><br /> 559 <label><input name="connection_type" type="radio" value="ssh" <?php checked('ssh', $connection_type); ?> /> <?php _e('SSH') ?></label></p> 560 </fieldset> 550 561 </td> 551 562 </tr> -
trunk/wp-admin/update.php
r8656 r8811 28 28 29 29 if ( ! WP_Filesystem($credentials) ) { 30 request_filesystem_credentials($url, '', true); //Failed to connect, Error and request again 30 $error = true; 31 if ( is_object($wp_filesystem) && $wp_filesystem->errors->get_error_code() ) 32 $error = $wp_filesystem->errors; 33 request_filesystem_credentials($url, '', $error); //Failed to connect, Error and request again 31 34 return; 32 35 } -
trunk/wp-includes/pluggable.php
r8810 r8811 635 635 do_action('set_logged_in_cookie', $logged_in_cookie, $expire, $expiration, $user_id, 'logged_in'); 636 636 637 global $is_safari;638 // No HTTPOnly for Safari639 if ( $is_safari ) {640 setcookie($auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN, $secure);641 setcookie($auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, $secure);642 setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN);643 if ( COOKIEPATH != SITECOOKIEPATH )644 setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN);645 return;646 }647 648 637 // Set httponly if the php version is >= 5.2.0 649 638 if ( version_compare(phpversion(), '5.2.0', 'ge') ) { … … 654 643 setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, false, true); 655 644 } else { 656 setcookie($auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN . '; HttpOnly', $secure); 657 setcookie($auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN . '; HttpOnly', $secure); 658 setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN . '; HttpOnly'); 645 $cookie_domain = COOKIE_DOMAIN; 646 if ( !empty($cookie_domain) ) 647 $cookie_domain .= '; HttpOnly'; 648 setcookie($auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, $cookie_domain, $secure); 649 setcookie($auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, $cookie_domain, $secure); 650 setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, $cookie_domain); 659 651 if ( COOKIEPATH != SITECOOKIEPATH ) 660 setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN . '; HttpOnly');652 setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, $cookie_domain); 661 653 } 662 654 }
Note: See TracChangeset
for help on using the changeset viewer.