Changeset 587313
- Timestamp:
- 08/19/2012 05:34:45 AM (14 years ago)
- Location:
- 6scan-backup/trunk
- Files:
-
- 7 edited
-
6scan.php (modified) (2 diffs)
-
admin/includes/6scan-menu.php (modified) (3 diffs)
-
admin/includes/common.php (modified) (7 diffs)
-
admin/includes/htaccess.php (modified) (2 diffs)
-
admin/includes/installation.php (modified) (6 diffs)
-
modules/signatures/update.php (modified) (9 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
6scan-backup/trunk/6scan.php
r579277 r587313 5 5 Description: 6Scan Backup goes beyond existing backup plugins, easily and automatically creating backups of your site and securely storing them in the cloud. 6 6 Author: 6Scan 7 Version: 2.2. 77 Version: 2.2.8 8 8 Author URI: http://www.6scan.com 9 9 */ … … 24 24 define( 'SIXSCAN_PLUGIN_DIR', trailingslashit( dirname(__FILE__) ) ); 25 25 define( 'SIXSCAN_PLUGIN_URL', trailingslashit( plugins_url( basename (dirname (__FILE__) ) ) ) ); 26 define( 'SIXSCAN_PLUGIN_DIRNAME' , basename( dirname ( __FILE__ ) ) ); 26 27 27 28 /* Platform type */ -
6scan-backup/trunk/admin/includes/6scan-menu.php
r579277 r587313 128 128 else 129 129 $result_html .= $custom_form_message; 130 $result_html .= "<form action=\"" . SIXSCAN_BODYGUARD_ERROR_REPORT_FORM_URL . "\" method=POST>\n"; 130 $result_html .= "<script language='Javascript'> function sanity_error_report(){ if (document.getElementById('admin_comments').value ==''){ alert('Please add the error desription into comments field'); return false;} else {return true;} }</script>\n"; 131 $result_html .= "<form action=\"" . SIXSCAN_BODYGUARD_ERROR_REPORT_FORM_URL . "\" method=POST onsubmit='return sanity_error_report();'>\n"; 131 132 $result_html .= "<input type=hidden name=root_url value=\"" . get_option( 'siteurl' ) . "\">\n"; 132 133 $result_html .= "<input type=hidden name=wordpress_version value=\"" . get_bloginfo('version') . "\">\n"; … … 135 136 $result_html .= "<table>\n"; 136 137 $result_html .= "<tr><td width='80'>Email:</td><td><input type=text name=admin_email value=\"" . get_option( "admin_email" ) . "\"></td></tr>\n"; 137 $result_html .= "<tr><td width='80'>Comments (*):</td><td><textarea name=admin_comments cols=60 rows=3></textarea></td></tr>\n";138 $result_html .= "<tr><td width='80'>Comments*:</td><td><textarea name=admin_comments id=admin_comments cols=60 rows=3></textarea></td></tr>\n"; 138 139 $result_html .= "<input type=hidden name=return_url value='" . SERVER_HTTP_PREFIX . $_SERVER[ "SERVER_NAME" ] . $server_request_uri . "&ticket_submitted=1'>\n"; 139 140 $result_html .= "<tr><td width='80'></td><td><input type=submit value='Submit error log'></td>\n"; … … 158 159 return; 159 160 } 161 162 /* Don't show this message to non-admins */ 163 if ( ! current_user_can( 'manage_options' ) ){ 164 return; 165 } 160 166 161 167 $current_vulns_found = intval( get_option( SIXSCAN_OPTION_VULNERABITILY_COUNT ) ); -
6scan-backup/trunk/admin/includes/common.php
r579609 r587313 4 4 die( 'No direct access allowed' ); 5 5 6 define ( 'SIXSCAN_VERSION' , '2.2. 7.1' );6 define ( 'SIXSCAN_VERSION' , '2.2.8.2' ); 7 7 define ( 'SIXSCAN_HTACCESS_VERSION' , '1' ); 8 8 … … 111 111 define ( 'SIXSCAN_ANALYTICS_OK_STRING', 'ok' ); 112 112 define ( 'SIXSCAN_ANALYTICS_FAIL_PREFIX_STRING', 'error_' ); 113 114 define( 'SIXSCAN_HTACCESS_FILE', ABSPATH . '/.htaccess' ); 115 define ( 'SIXSCAN_HTACCESS_6SCAN_GATE_FILE_NAME', '6scan-gate.php' );113 define ( 'SIXSCAN_HTACCESS_FILE', ABSPATH . '/.htaccess' ); 114 115 define ( 'SIXSCAN_HTACCESS_6SCAN_GATE_FILE_NAME', '6scan-gate.php' ); 116 116 117 117 define( 'SIXSCAN_ADMIN_ACCESS_COOKIE_NAME', 'sixscan_wpblog_admin' ); … … 123 123 124 124 /* If this script is included from outside, we will not have SIXSCAN_PLUGIN_DIR defined, but we do not really need it */ 125 if ( defined( 'SIXSCAN_PLUGIN_DIR' ) ){ 125 if ( defined( 'SIXSCAN_PLUGIN_DIR' ) ){ 126 126 127 define( 'SIXSCAN_HTACCESS_6SCAN', SIXSCAN_PLUGIN_DIR . '/data/.htaccess.dat' ); 128 function sixscan_common_get_src_htaccess( $is_direct = TRUE ){ 129 if ( $is_direct == TRUE ) 130 return SIXSCAN_HTACCESS_6SCAN; 131 132 global $wp_filesystem; 133 return untrailingslashit ( $wp_filesystem->find_folder( SIXSCAN_HTACCESS_6SCAN ) ); 134 } 135 136 127 137 define( 'SIXSCAN_SIGNATURE_SRC', SIXSCAN_PLUGIN_DIR . '/data/' . SIXSCAN_COMM_SIGNATURE_FILENAME ); 138 function sixscan_common_get_signature_src( $is_direct = TRUE ){ 139 if ( $is_direct == TRUE ) 140 return SIXSCAN_SIGNATURE_SRC; 141 142 global $wp_filesystem; 143 return untrailingslashit( $wp_filesystem->find_folder( SIXSCAN_SIGNATURE_SRC ) ); 144 } 145 128 146 define( 'SIXSCAN_HTACCESS_6SCAN_GATE_SOURCE', SIXSCAN_PLUGIN_DIR . '/data/' . SIXSCAN_HTACCESS_6SCAN_GATE_FILE_NAME ); 147 function sixscan_common_get_gate_src( $is_direct = TRUE ){ 148 if ( $is_direct == TRUE ) 149 return SIXSCAN_HTACCESS_6SCAN_GATE_SOURCE; 150 151 global $wp_filesystem; 152 return untrailingslashit( $wp_filesystem->find_folder( SIXSCAN_HTACCESS_6SCAN_GATE_SOURCE ) ); 153 } 129 154 define( 'SIXSCAN_ANALYZER_LOG_FILEPATH', SIXSCAN_PLUGIN_DIR . SIXSCAN_SECURITY_LOG_FILENAME ); 130 155 } 131 156 132 define( 'SIXSCAN_HTACCESS_6SCAN_GATE_DEST', ABSPATH . SIXSCAN_HTACCESS_6SCAN_GATE_FILE_NAME ); 133 define( 'SIXSCAN_SIGNATURE_DEST', ABSPATH . SIXSCAN_COMM_SIGNATURE_FILENAME ); 157 134 158 define( 'SIXSCAN_COMMON_DASHBOARD_URL', 'six-scan-dashboard' ); 135 159 define( 'SIXSCAN_COMMON_SETTINGS_URL', 'six-scan-settings' ); … … 156 180 EOD 157 181 ); 182 183 184 function sixscan_common_get_htaccess_file_path( $is_direct ){ 185 if ( $is_direct == TRUE ) 186 return SIXSCAN_HTACCESS_FILE; 187 188 global $wp_filesystem; 189 return $wp_filesystem->abspath() . '.htaccess'; 190 } 191 192 function sixscan_common_get_htaccess_dest_path( $is_direct = TRUE ){ 193 if ( $is_direct == TRUE ) 194 return ABSPATH . SIXSCAN_HTACCESS_6SCAN_GATE_FILE_NAME; 195 196 global $wp_filesystem; 197 return $wp_filesystem->abspath() . SIXSCAN_HTACCESS_6SCAN_GATE_FILE_NAME; 198 } 199 200 function sixscan_common_get_signature_dest_path( $is_direct = TRUE ){ 201 if ( $is_direct == TRUE ) 202 return ABSPATH . SIXSCAN_COMM_SIGNATURE_FILENAME; 203 204 global $wp_filesystem; 205 return $wp_filesystem->abspath() . SIXSCAN_COMM_SIGNATURE_FILENAME; 206 } 158 207 159 208 function sixscan_common_set_site_id( $site_id ){ … … 376 425 $submission_data .= "Is access through proxy: $is_through_proxy\n"; 377 426 378 $htaccess_contents = file_get_contents( SIXSCAN_HTACCESS_FILE);427 $htaccess_contents = file_get_contents( sixscan_common_get_htaccess_file_path( TRUE ) ); 379 428 if ( $htaccess_contents == FALSE ) 380 429 $htaccess_contents = "Empty"; … … 406 455 global $wp_filesystem; 407 456 408 $tmp_fname = tempnam( untrailingslashit( $dir_name ) , 'sixscantmp_');457 $tmp_fname = untrailingslashit( $dir_name ) . 'sixscantmp_'; 409 458 410 459 $ftmp_result = $wp_filesystem->put_contents( $tmp_fname , 'write_test' ); … … 414 463 415 464 /* Cleanup */ 416 unlink( $tmp_fname );465 $wp_filesystem->delete( $tmp_fname ); 417 466 return TRUE; 418 467 } -
6scan-backup/trunk/admin/includes/htaccess.php
r579277 r587313 7 7 $ret_error = array(); 8 8 9 $htaccess_sixscan = trim ( $wp_filesystem->get_contents( SIXSCAN_HTACCESS_6SCAN . $htaccess_sixscan_version ) ) . "\n\n"; 10 11 if ( ! $wp_filesystem->copy( SIXSCAN_HTACCESS_6SCAN_GATE_SOURCE, SIXSCAN_HTACCESS_6SCAN_GATE_DEST , TRUE , 0755 ) ) { 12 $ret_error[ 'user_message' ] = 'Failed copying ' . SIXSCAN_HTACCESS_6SCAN_GATE_FILE_NAME . ' during installation'; 9 $is_direct = ( $wp_filesystem->method == 'direct' ); 10 $local_htaccess_path = sixscan_common_get_htaccess_file_path( $is_direct ); 11 $htaccess_sixscan = trim ( $wp_filesystem->get_contents( sixscan_common_get_src_htaccess( $is_direct ) . $htaccess_sixscan_version ) ) . "\n\n"; 12 13 if ( ! $wp_filesystem->copy( sixscan_common_get_gate_src( $is_direct ) , sixscan_common_get_htaccess_dest_path( $is_direct ) , TRUE , 0755 ) ) { 14 $ret_error[ 'user_message' ] = 'Failed copying ' . sixscan_common_get_htaccess_dest_path( $is_direct ) . ' during installation'; 13 15 $ret_error[ 'short_description' ] = 'Failed copying htaccess during installation'; 14 16 return $ret_error; 15 17 } 16 18 17 if ( ! $wp_filesystem->copy( SIXSCAN_SIGNATURE_SRC, SIXSCAN_SIGNATURE_DEST , TRUE , 0755 ) ) {18 $ret_error[ 'user_message' ] = 'Failed copying ' . SIXSCAN_SIGNATURE_SRC. ' during installation';19 if ( ! $wp_filesystem->copy( sixscan_common_get_signature_src( $is_direct ), sixscan_common_get_signature_dest_path( $is_direct ) , TRUE , 0755 ) ) { 20 $ret_error[ 'user_message' ] = 'Failed copying ' . sixscan_common_get_signature_src( $is_direct ) . ' during installation'; 19 21 $ret_error[ 'short_description' ] = 'Failed copying signature during installation'; 20 22 return $ret_error; 21 23 } 22 24 23 if ( $wp_filesystem->exists( SIXSCAN_HTACCESS_FILE) ) {24 $htaccess_content = $wp_filesystem->get_contents( SIXSCAN_HTACCESS_FILE);25 if ( $wp_filesystem->exists( $local_htaccess_path ) ) { 26 $htaccess_content = $wp_filesystem->get_contents( $local_htaccess_path ); 25 27 $htaccess_sixscan .= preg_replace( '@# Created by 6Scan plugin(.*?)# End of 6Scan plugin@s' , '' , $htaccess_content ) ; 26 $wp_filesystem->delete( SIXSCAN_HTACCESS_FILE);28 $wp_filesystem->delete( $local_htaccess_path ); 27 29 } 28 30 29 if ( $wp_filesystem->put_contents( SIXSCAN_HTACCESS_FILE, $htaccess_sixscan ) === FALSE ){31 if ( $wp_filesystem->put_contents( $local_htaccess_path , $htaccess_sixscan ) === FALSE ){ 30 32 $ret_error[ 'user_message' ] = 'Failed opening htaccess during installation'; 31 33 $ret_error[ 'short_description' ] = 'Failed opening htaccess during installation'; … … 42 44 WP_Filesystem(); 43 45 46 $is_direct = ( $wp_filesystem->method == 'direct' ); 47 $local_htaccess_path = sixscan_common_get_htaccess_file_path( $is_direct ); 48 44 49 try { 45 if ( $wp_filesystem->exists( SIXSCAN_HTACCESS_FILE) ) {46 $htaccess_content = $wp_filesystem->get_contents( SIXSCAN_HTACCESS_FILE);50 if ( $wp_filesystem->exists( $local_htaccess_path ) ) { 51 $htaccess_content = $wp_filesystem->get_contents( $local_htaccess_path ); 47 52 $a = preg_replace( '@# Created by 6Scan plugin(.*?)# End of 6Scan plugin@s', '', $htaccess_content) ; 53 54 if ( $wp_filesystem->put_contents( $local_htaccess_path , $a ) === FALSE ) 55 throw new Exception('Failed to open htaccess during installation'); 48 56 } 49 50 if ( $wp_filesystem->put_contents( SIXSCAN_HTACCESS_FILE , $a ) === FALSE )51 throw new Exception('Failed to open htaccess during installation');52 53 if ( filesize( SIXSCAN_HTACCESS_FILE ) == 1 )54 $wp_filesystem->delete( SIXSCAN_HTACCESS_FILE );55 57 56 if ( $wp_filesystem->exists( SIXSCAN_HTACCESS_6SCAN_GATE_DEST) )57 $wp_filesystem->delete( SIXSCAN_HTACCESS_6SCAN_GATE_DEST);58 if ( $wp_filesystem->exists( sixscan_common_get_htaccess_dest_path( $is_direct ) ) ) 59 $wp_filesystem->delete( sixscan_common_get_htaccess_dest_path( $is_direct ) ); 58 60 59 if ( $wp_filesystem->exists( SIXSCAN_SIGNATURE_DEST) )60 $wp_filesystem->delete ( SIXSCAN_SIGNATURE_DEST) ;61 if ( $wp_filesystem->exists( sixscan_common_get_signature_dest_path( $is_direct ) ) ) 62 $wp_filesystem->delete ( sixscan_common_get_signature_dest_path( $is_direct ) ) ; 61 63 62 64 } catch( Exception $e ) { -
6scan-backup/trunk/admin/includes/installation.php
r579277 r587313 15 15 if ( sixscan_installation_wpfs_init( $tmp_key ) == FALSE) 16 16 return; 17 17 18 18 /* Run the install */ 19 19 $install_result = sixscan_installation_install( $tmp_key ); … … 117 117 118 118 /* Make sure we can create signature file and update the site's .htaccess file */ 119 if ( sixscan_common_test_dir_writable( ABSPATH) == FALSE ){119 if ( sixscan_common_test_dir_writable( $wp_filesystem->abspath() ) == FALSE ){ 120 120 $err_message = "6Scan Install <b>Error</b>: Failed creating signature file at Wordpress directory " . ABSPATH . SIXSCAN_COMM_SIGNATURE_FILENAME . 121 121 "<br/><br/>Please see <a href='http://codex.wordpress.org/Changing_File_Permissions' target='_blank'>this Wordpress article</a> for more information on how to add write permissions." . … … 183 183 update_option( SIXSCAN_OPTION_STAT_OK_REQ_COUNT , 0); 184 184 update_option( SIXSCAN_OPTION_WAF_REQUESTED , array() ); 185 update_option( SIXSCAN_OPTION_LOGIN_SETTINGS , array() ); 185 update_option( SIXSCAN_OPTION_LOGIN_SETTINGS , array() ); 186 186 update_option( SIXSCAN_VULN_MESSAGE_DISMISSED , FALSE ); 187 187 … … 241 241 delete_option( SIXSCAN_OPTION_COMM_LAST_SIG_UPDATE_NONCE ); 242 242 delete_option( SIXSCAN_OPTION_VULNERABITILY_COUNT ); 243 delete_option( SIXSCAN_OPTION_LOGIN_SETTINGS ); 243 delete_option( SIXSCAN_OPTION_LOGIN_SETTINGS ); 244 244 delete_option( SIXSCAN_LOGIN_LOGS ); 245 245 delete_option( SIXSCAN_OPTION_WPFS_CONFIG ); … … 333 333 /* Returns TRUE if wpfs is already initialized, FALSE if we are waiting for user to enter reg_data */ 334 334 function sixscan_installation_wpfs_init( &$config_key ){ 335 335 /* Wordpress doesn't always detect the fs method correctly. If we detect, that we can write to the filesystem directly - 336 we can force the method to be direct */ 337 $wpfs_detect_try = sixscan_installation_wpfs_detect(); 338 if ( $wpfs_detect_try == 'direct' ) 339 define( 'FS_METHOD' , 'direct' ); 340 else if ( $wpfs_detect_try == 'ftpext' ) 341 define( 'FS_METHOD' , 'ftpext' ); 336 342 if ( WP_Filesystem() ){ 337 343 $config_key = ""; … … 360 366 return FALSE; 361 367 } 368 369 /* Since Wordpress FTP method detection is not always correct (The newly created test-file is compared to the owner of Wordpress scrit) 370 We will run the test ourself */ 371 function sixscan_installation_wpfs_detect(){ 372 373 /* First of all - we are checking whether the .htaccess is writable via direct */ 374 if ( file_exists( SIXSCAN_HTACCESS_FILE ) && ( sixscan_installation_try_direct_write_file( SIXSCAN_HTACCESS_FILE , FALSE ) == FALSE ) ){ 375 if ( extension_loaded( 'ftp' ) ){ 376 return 'ftpext'; 377 } 378 return FALSE; 379 } 380 381 /* Taken from Wordpress file.php, with minor changes for our needs, we are testing direct file access */ 382 $context = trailingslashit( $context ); 383 $temp_file_name = WP_CONTENT_DIR . 'temp-write-test-' . time(); 384 if ( sixscan_installation_try_direct_write_file( $temp_file_name , TRUE ) == TRUE ) 385 return 'direct'; 386 387 return FALSE; 388 } 389 390 function sixscan_installation_try_direct_write_file( $fname , $is_to_delete = FALSE ){ 391 392 $temp_handle = @fopen( $fname , 'a+' ); 393 if ( $temp_handle ) { 394 @fclose( $temp_handle ); 395 396 if ( $is_to_delete == TRUE ) 397 @unlink( $fname ); 398 399 return TRUE; 400 } 401 402 return FALSE; 403 } 362 404 363 405 ?> -
6scan-backup/trunk/modules/signatures/update.php
r566111 r587313 66 66 global $wp_filesystem; 67 67 /* Prepare temporary names */ 68 $temp_upgrade_dir = get_temp_dir() . trailingslashit( "6scan_update" ); 69 $temp_zip_file = get_temp_dir() . "bguard.zip"; 70 68 $temp_upgrade_dir_local = trailingslashit( WP_CONTENT_DIR ) . trailingslashit( "6scan_update" ); 69 $temp_upgrade_dir = $wp_filesystem->wp_content_dir() . trailingslashit( "6scan_update" ); 70 $temp_zip_file_local = trailingslashit( WP_CONTENT_DIR ) . "bguard.zip"; 71 $temp_zip_file = $wp_filesystem->wp_content_dir() . "bguard.zip"; 72 71 73 /* Create temp directory for update */ 72 if ( ( $wp_filesystem->is_dir( $temp_upgrade_dir ) == FALSE ) && ( $wp_filesystem->mkdir( $temp_upgrade_dir ) == FALSE ) ) 74 if ( $wp_filesystem->exists( $temp_upgrade_dir ) ) 75 $wp_filesystem->delete ( $temp_upgrade_dir , TRUE ); 76 77 if ( ($wp_filesystem->is_dir( $temp_upgrade_dir ) == FALSE ) && ( $wp_filesystem->mkdir( $temp_upgrade_dir ) == FALSE ) ) 73 78 return "Failed creating temp directory for update at " . $temp_upgrade_dir; 74 79 75 /* Write the zip file */ 80 /* Write the zip file */ 81 if ( $wp_filesystem->exists( $temp_zip_file ) ) 82 $wp_filesystem->delete( $temp_zip_file ); 83 76 84 if ( $wp_filesystem->put_contents( $temp_zip_file , $zipped_program ) == FALSE ) 77 85 return "Failed writing file to " . $temp_zip_file; 78 86 79 /* unzip_file returns mixed on failure. It uses global $wp_filesystem */80 if ( unzip_file( $temp_zip_file , $temp_upgrade_dir ) !== TRUE )87 /* unzip_file returns mixed on failure. It uses global $wp_filesystem. */ 88 if ( unzip_file( $temp_zip_file_local , $temp_upgrade_dir ) !== TRUE ){ 81 89 return "unzip_file() from $temp_zip_file to $temp_upgrade_dir failed"; 90 } 82 91 83 92 /* Remove the no longer required zip file */ 84 93 $wp_filesystem->delete( $temp_zip_file ); 85 94 86 $plugin_main_directory = plugin_dir_path( __FILE__ ) . "../../"; 87 88 $temp_upgrade_dir_internal = sixscan_signatures_update_find_plugin_dir( $temp_upgrade_dir ); 89 if ( $temp_upgrade_dir_internal == "") 90 return "Couldn't find plugin dir in the unzipped folder $temp_upgrade_dir"; 91 95 $plugin_main_directory = plugin_dir_path( __FILE__ ) . "../../"; 96 $plugin_main_directory = $wp_filesystem->wp_plugins_dir() . SIXSCAN_PLUGIN_DIRNAME; 97 98 $temp_upgrade_dir_internal = sixscan_signatures_update_find_plugin_dir( $temp_upgrade_dir_local ); 99 100 if ( $temp_upgrade_dir_internal == "" ) 101 return "Couldn't find plugin dir in the unzipped folder $temp_upgrade_dir_local"; 102 103 $temp_upgrade_dir_internal = untrailingslashit( $wp_filesystem->find_folder( $temp_upgrade_dir_internal ) ); 104 92 105 /* Now bulk copy the rest of files to their places: */ 93 106 sixscan_signatures_update_move_dir_recursive( $temp_upgrade_dir_internal , $plugin_main_directory ); 94 107 95 /* Remove the tmp directory */ 96 $wp_filesystem->delete ( $temp_upgrade_dir_internal ); 97 $wp_filesystem->delete ( $temp_upgrade_dir ); 108 /* Remove the tmp directory */ 109 $wp_filesystem->delete ( $temp_upgrade_dir , TRUE ); 98 110 99 111 return TRUE; … … 141 153 142 154 function sixscan_signatures_update_parse( $raw_data ) { 143 144 $signature_filename = ABSPATH . "/" . SIXSCAN_COMM_SIGNATURE_FILENAME; 155 global $wp_filesystem; 156 157 $signature_filename = $wp_filesystem->find_folder( ABSPATH ) . SIXSCAN_COMM_SIGNATURE_FILENAME; 145 158 $signature_filename_tmp = $signature_filename . ".tmp"; 146 159 $signature_offset = strpos( $raw_data , SIXSCAN_SIGNATURE_MULTIPART_DELIMITER ); 147 global $wp_filesystem;160 148 161 149 162 if ($signature_offset === FALSE) … … 189 202 global $wp_filesystem; 190 203 191 if ( file_exists( SIXSCAN_HTACCESS_FILE ) ) { 192 $htaccess_content = $wp_filesystem->get_contents( SIXSCAN_HTACCESS_FILE ); 204 $htaccess_fpath = sixscan_common_get_htaccess_file_path( $wp_filesystem->method == 'direct' ); 205 206 if ( $wp_filesystem->exists( $htaccess_fpath ) ) { 207 $htaccess_content = $wp_filesystem->get_contents( $htaccess_fpath ); 193 208 /* Remove old 6Scan signature contents */ 194 209 $new_content = trim( preg_replace( '@# Created by 6Scan plugin(.*?)# End of 6Scan plugin@s', '', $htaccess_content) ); … … 287 302 $htaccess_links .= $vuln_urls; 288 303 289 $tmp_htaccess_file = SIXSCAN_HTACCESS_FILE. ".tmp";304 $tmp_htaccess_file = $htaccess_fpath . ".tmp"; 290 305 291 306 $new_content = "# Created by 6Scan plugin … … 315 330 $wp_filesystem->put_contents( $tmp_htaccess_file , $new_content ); 316 331 317 if ( sixscan_signatures_update_copy_file( $tmp_htaccess_file , SIXSCAN_HTACCESS_FILE) == FALSE )318 return "Failed moving htaccess from $tmp_htaccess_file to " . SIXSCAN_HTACCESS_FILE;332 if ( sixscan_signatures_update_copy_file( $tmp_htaccess_file , $htaccess_fpath ) == FALSE ) 333 return "Failed moving htaccess from $tmp_htaccess_file to " . $htaccess_fpath; 319 334 320 335 return TRUE; … … 349 364 $wp_filesystem->mkdir( $dest ); 350 365 351 $file_list = scandir( $source ); 352 353 foreach( $file_list as $current_file ) { 366 //$file_list = scandir( $source ); 367 $file_list = $wp_filesystem->dirlist( $source ); 368 369 foreach( $file_list as $farray => $current_fname ) { 370 $current_file = $current_fname['name']; 371 354 372 if( $current_file == "." || $current_file == ".." ) { 355 373 /* skip "current" and "previous" directory */ … … 357 375 } 358 376 359 if( is_dir( $source . "/" . $current_file ) ) {377 if( $wp_filesystem->is_dir( $source . "/" . $current_file ) ) { 360 378 /* If it is directory , we have to call the recursion.*/ 361 379 sixscan_signatures_update_move_dir_recursive( $source . "/" . $current_file, $dest. "/" . $current_file ); … … 416 434 global $wp_filesystem; 417 435 436 $wp_filesystem->delete( $dst_file ); 418 437 return $wp_filesystem->move( $src_file , $dst_file , TRUE ); 419 438 } … … 449 468 return WP_Filesystem(); 450 469 } 451 470 452 471 $cfg_arr = unserialize( sixscan_common_decrypt_string( base64_decode ( $wp_fs_param ) , $config_key ) ); 453 472 454 $wp_fs = WP_Filesystem( $cfg_arr ); 455 if ( $wp_fs ){ 456 $wp_filesystem->connect(); 457 return $wp_fs; 458 } 473 $wp_fs = WP_Filesystem( $cfg_arr ); 459 474 460 475 return $wp_fs; -
6scan-backup/trunk/readme.txt
r579277 r587313 1 1 === 6Scan Backup === 2 2 Contributors: 6Scan 3 Version: 2.2. 73 Version: 2.2.8 4 4 Tags: backup, automatic backup, cloud, online, secured, restore, recovery 5 5 Requires at least: 3.0.0 … … 165 165 * Several minor bugfixes. 166 166 167 = 2.2.8 = 168 * Changed path references from 'direct' access constants (like 'ABSPATH') to their wp_filesystem counterparts (like $wp_filesystem->abspath). This is used to create backups in filesystems, where FTP credentials are required to access the files (Read/write permissions issues) 169 167 170 168 171 == Upgrade Notice ==
Note: See TracChangeset
for help on using the changeset viewer.