Ticket #10043: 10043.diff
File 10043.diff, 2.3 KB (added by , 15 years ago) |
---|
-
wp-admin/includes/file.php
678 678 $credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($_POST['hostname']) ? $_POST['hostname'] : $credentials['hostname']); 679 679 $credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? $_POST['username'] : $credentials['username']); 680 680 $credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? $_POST['password'] : ''); 681 $credentials['store_details'] = isset($_POST['store_details']) ? (bool)$_POST['store_details'] : true; 681 682 682 683 // Check to see if we are setting the public/private keys for ssh 683 684 $credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : (!empty($_POST['public_key']) ? $_POST['public_key'] : ''); … … 710 711 $stored_credentials['hostname'] .= ':' . $stored_credentials['port']; 711 712 712 713 unset($stored_credentials['password'], $stored_credentials['port'], $stored_credentials['private_key'], $stored_credentials['public_key']); 714 if ( ! $stored_credentials['store_details'] ) //Clear all details if user doesnt want to store their options. 715 $stored_credentials = array('store_details' => false ); 716 713 717 update_option('ftp_credentials', $stored_credentials); 714 718 return $credentials; 715 719 } … … 717 721 $username = ''; 718 722 $password = ''; 719 723 $connection_type = ''; 724 $store_details = true; 720 725 if ( !empty($credentials) ) 721 726 extract($credentials, EXTR_OVERWRITE); 722 727 if ( $error ) { … … 760 765 <th scope="row"><label for="password"><?php _e('Password') ?></label></th> 761 766 <td><input name="password" type="password" id="password" value="<?php if ( defined('FTP_PASS') ) echo '*****'; ?>"<?php if ( defined('FTP_PASS') ) echo ' disabled="disabled"' ?> size="40" /></td> 762 767 </tr> 768 <tr valign="top"> 769 <th scope="row" colspan="2"><input type="checkbox" name="store_details" id="store_details" <?php checked($store_details, true); ?> /><label for="store_details"><?php _e('Remember hostname and Username') ?></label></th> 770 </tr> 763 771 764 772 <?php if ( extension_loaded('ssh2') ) : ?> 765 773 <tr id="ssh_keys" valign="top" style="<?php if ( 'ssh' != $connection_type ) echo 'display:none' ?>">