Changeset 8865 for trunk/wp-admin/includes/file.php
- Timestamp:
- 09/11/2008 05:44:43 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/file.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/file.php
r8852 r8865 406 406 $tmppath = $to . implode('/', array_slice($path, 0, $i) ); 407 407 if ( $fs->is_dir($tmppath) ) {//Found the highest folder that exists, Create from here 408 for ( $i = $i + 1; $i < count($path); $i++ ) { //< count() no file component please.408 for ( $i = $i + 1; $i <= count($path); $i++ ) { //< count() no file component please. 409 409 $tmppath = $to . implode('/', array_slice($path, 0, $i) ); 410 410 if ( ! $fs->mkdir($tmppath, 0755) ) … … 511 511 $credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? $_POST['password'] : $credentials['password']); 512 512 513 // Check to see if we are setting the public/private keys for ssh 514 $credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : (!empty($_POST['public_key']) ? $_POST['public_key'] : $credentials['public_key']); 515 $credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($_POST['private_key']) ? $_POST['private_key'] : $credentials['private_key']); 516 513 517 if ( strpos($credentials['hostname'], ':') ) 514 518 list( $credentials['hostname'], $credentials['port'] ) = explode(':', $credentials['hostname'], 2); … … 523 527 if ( ! $error && !empty($credentials['password']) && !empty($credentials['username']) && !empty($credentials['hostname']) ) { 524 528 $stored_credentials = $credentials; 525 unset($stored_credentials['password'] );529 unset($stored_credentials['password'], $stored_credentials['private_key'], $stored_credentials['public_key']); 526 530 update_option('ftp_credentials', $stored_credentials); 527 531 return $credentials; … … 540 544 } 541 545 ?> 546 <script type="text/javascript"> 547 <!-- 548 jQuery(function($){ 549 jQuery("#ssh").click(function () { 550 jQuery("#ssh_keys").show(); 551 }); 552 jQuery("#ftp").click(function () { 553 jQuery("#ssh_keys").hide(); 554 }); 555 jQuery("#ftps").click(function () { 556 jQuery("#ssh_keys").hide(); 557 }); 558 jQuery(document).ready(function(){ 559 if ( jQuery("#ssh:checked").length ) 560 { 561 jQuery("#ssh_keys").show(); 562 } 563 }); 564 }); 565 --> 566 </script> 542 567 <form action="<?php echo $form_post ?>" method="post"> 543 568 <div class="wrap"> … … 557 582 <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> 558 583 </tr> 584 <tr id="ssh_keys" valign="top" style="display:none"> 585 <th scope="row"><label id="keys" for="keys"><?php _e('Authentication Keys') ?></label></th> 586 <td><label for="public_key"><?php _e('Public Key:') ?></label ><input name="public_key" type="text" id="public_key" value=""<?php if( defined('FTP_PUBKEY') ) echo ' disabled="disabled"' ?> size="40" /> <label for="private_key"><?php _e('Private Key:') ?></label> <input name="private_key" type="text" id="private_key" value=""<?php if( defined('FTP_PRIKEY') ) echo ' disabled="disabled"' ?> size="40" /><br/><div><?php _e('Enter the location on the server where the keys are located. If a passphrase is needed, enter that in the password field above.') ?></div></td> 587 </tr> 559 588 <tr valign="top"> 560 589 <th scope="row"><?php _e('Connection Type') ?></th> 561 590 <td> 562 591 <fieldset><legend class="hidden"><?php _e('Connection Type') ?> </legend> 563 <p><label><input name="connection_type" type="radio" value="ftp" <?php checked('ftp', $connection_type); ?> /> <?php _e('FTP') ?></label><br />564 <label><input name="connection_type" type="radio" value="ftps" <?php checked('ftps', $connection_type); ?> /> <?php _e('FTPS (SSL)') ?></label><br />565 <?php if ( extension_loaded('ssh2') ) { ?><label><input name="connection_type" type="radio" value="ssh" <?php checked('ssh', $connection_type); ?> /> <?php _e('SSH') ?></label><?php } ?></p>592 <p><label><input id="ftp" name="connection_type" type="radio" value="ftp" <?php checked('ftp', $connection_type); ?> /> <?php _e('FTP') ?></label><br /> 593 <label><input id="ftps" name="connection_type" type="radio" value="ftps" <?php checked('ftps', $connection_type); ?> /> <?php _e('FTPS (SSL)') ?></label><br /> 594 <?php if ( extension_loaded('ssh2') ) { ?><label><input id="ssh" name="connection_type" type="radio" value="ssh" <?php checked('ssh', $connection_type); ?> /> <?php _e('SSH') ?></label><?php } ?></p> 566 595 </fieldset> 567 596 </td>
Note: See TracChangeset
for help on using the changeset viewer.