Changeset 637584
- Timestamp:
- 12/12/2012 09:02:51 AM (13 years ago)
- Location:
- 6scan-backup/trunk
- Files:
-
- 3 added
- 3 edited
-
6scan.php (modified) (1 diff)
-
admin/includes/common.php (modified) (3 diffs)
-
admin/includes/installation.php (modified) (7 diffs)
-
data/img/reg_logo.png (added)
-
data/regpage (added)
-
data/regpage/reg.html (added)
Legend:
- Unmodified
- Added
- Removed
-
6scan-backup/trunk/6scan.php
r597897 r637584 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.97 Version: 2.3.0 8 8 Author URI: http://www.6scan.com 9 9 */ -
6scan-backup/trunk/admin/includes/common.php
r597897 r637584 4 4 die( 'No direct access allowed' ); 5 5 6 define ( 'SIXSCAN_VERSION' , '2. 2.9.0' );6 define ( 'SIXSCAN_VERSION' , '2.3.0.0' ); 7 7 define ( 'SIXSCAN_HTACCESS_VERSION' , '1' ); 8 8 … … 119 119 define( 'SIXSCAN_ANALYZER_MAX_LOG_FILESIZE', 512000 ); 120 120 define( 'SIXSCAN_SECURITY_LOG_FILENAME', '/data/security_log/logger.txt' ); 121 define( 'SIXSCAN_SECURITY_LOCK_NOTIFY_FILENAME', '/data/lockout_email.html'); 121 define( 'SIXSCAN_SECURITY_LOCK_NOTIFY_FILENAME', '/data/lockout_email.html' ); 122 define( 'SIXCAN_REGISTRATION_PAGE_FILENAME' , '/data/regpage/reg.html' ); 122 123 define( 'SIXSCAN_SECURITY_LOG_SEPARATOR', "\n" ); 123 124 … … 455 456 global $wp_filesystem; 456 457 457 $tmp_fname = untrailingslashit( $dir_name ) . 'sixscantmp_';458 $tmp_fname = trailingslashit( $dir_name ) . 'sixscantmp_'; 458 459 459 460 $ftmp_result = $wp_filesystem->put_contents( $tmp_fname , 'write_test' ); -
6scan-backup/trunk/admin/includes/installation.php
r597897 r637584 3 3 if ( ! defined( 'ABSPATH' ) ) 4 4 die( 'No direct access allowed' ); 5 5 6 6 7 function sixscan_installation_manager() … … 10 11 if ( ( sixscan_common_is_partner_version() ) && ( sixscan_installation_partner_is_to_install() === FALSE ) ) 11 12 return; 13 14 /* Before install of any kind progresses, user is shown a registration page. 15 On the first load it shows a registration screen and returns False. 16 If user clicks 'Agree' - the page reloads with &agree=yes parameter, sixscan_registration_at_install() returns True and registration continues. 17 No data is transferred to the server until user clicks "Agree" */ 18 if ( sixscan_registration_at_install() === FALSE ) 19 return; 12 20 13 21 /* If we are waiting for user to input wpfs data */ … … 24 32 print $install_result; 25 33 34 /* Makes 6Scan not-active */ 26 35 $sixscan_plugin_name = plugin_basename( realpath( dirname( __FILE__ ) . "/../../6scan.php" ) ); 27 36 28 37 /* This dirty patch is required because some hostings (free?) have a short sql timeout. When it timeouts, 6Scan can't 29 38 disable itelf, and user gets stuck in infinite deactivate loop. … … 37 46 38 47 /* deactivate myself */ 39 deactivate_plugins( $sixscan_plugin_name ); 48 deactivate_plugins( $sixscan_plugin_name ); 40 49 } 41 50 else if ( sixscan_installation_partner_run_first_time() === FALSE ){ … … 48 57 /* No redirects in partner version */ 49 58 if ( sixscan_common_is_partner_version() === FALSE ){ 50 51 /* If the install has succeeded - forward user to the registration page */52 $reg_page_address = get_bloginfo( "wpurl" ) . "/wp-admin/admin.php?page=" . SIXSCAN_COMMON_DASHBOARD_URL . "&sixscan_activated=1";53 59 54 /* If user's JavaScript is disabled, he will see this notice to upgrade */ 55 sixscan_installation_account_setup_required_notice(); 56 /* Forward user to the registration screen */ 57 print <<<EOT 58 <script type="text/javascript"> 59 document.getElementById('6scan_dashboard_redirect_caption').style.display = 'none'; 60 window.location = "$reg_page_address"; 61 </script> 62 EOT; 60 sixscan_registration_forward_to_dashboard( "&sixscan_activated=1" ); 63 61 } 64 62 } … … 67 65 if ( sixscan_common_is_partner_version() ) 68 66 sixscan_installation_partner_mark_install_tried(); 67 } 68 69 function sixscan_registration_forward_to_dashboard( $additional_flags = "" ){ 70 $reg_page_address = get_bloginfo( "wpurl" ) . "/wp-admin/admin.php?page=" . SIXSCAN_COMMON_DASHBOARD_URL . $additional_flags; 71 /* If the install has succeeded - forward user to the registration page */ 72 73 /* If user's JavaScript is disabled, he will see this notice to upgrade */ 74 sixscan_installation_account_setup_required_notice(); 75 /* Forward user to the registration screen */ 76 print <<<EOT 77 <script type="text/javascript"> 78 document.getElementById('6scan_dashboard_redirect_caption').style.display = 'none'; 79 window.location = "$reg_page_address"; 80 </script> 81 EOT; 82 } 83 84 function sixscan_registration_at_install(){ 85 /* The logic is as following: 86 When the plugin just got activated - forward user to the dashboard. 87 When the current page is 6Scan Dashboard - show him the registration page 88 */ 89 $just_activated = isset( $_GET[ 'activate' ] ) ? strtolower( $_GET[ 'activate' ] ) : ''; 90 $current_page = isset( $_GET[ 'page' ] ) ? strtolower( $_GET[ 'page' ] ) : ''; 91 $agree_val = isset( $_GET[ 'agree' ] ) ? strtolower( $_GET[ 'agree' ] ) : ''; 92 93 if ( $just_activated == 'true' ){ 94 sixscan_registration_forward_to_dashboard(); 95 return FALSE; 96 } 97 98 if ( $current_page != SIXSCAN_COMMON_DASHBOARD_URL ) 99 return FALSE; 100 101 /* First entry to registration page */ 102 if ( $agree_val == '' ){ 103 /* Registration page content */ 104 $registration_page = file_get_contents( SIXSCAN_PLUGIN_DIR . SIXCAN_REGISTRATION_PAGE_FILENAME ); 105 106 /* Add nonce token and email address to the Registration form (Nothing is sent to the server) */ 107 $replaced_values = array( '_nonce_value_sixscan' , '_email_value_sixscan' , '_page_value_sixscan' , '_reg_logo_link_sixscan'); 108 $new_values = array( wp_create_nonce( 'sixscan_registration_html' ) , get_option( 'admin_email' ) , SIXSCAN_COMMON_DASHBOARD_URL , SIXSCAN_PLUGIN_URL . 'data/img/reg_logo.png' ); 109 $registration_page = str_replace ( $replaced_values , $new_values , $registration_page ); 110 111 112 113 print $registration_page; 114 return FALSE; 115 } 116 117 /* Origin verification */ 118 if (! wp_verify_nonce( $_GET[ '_sixscannonce' ], 'sixscan_registration_html') ) die( 'Security failure' ); 119 120 /* User clicked 'yes'. Continue to registration */ 121 if ($agree_val == 'yes' ){ 122 return TRUE; 123 } 124 125 return FALSE; 69 126 } 70 127 … … 271 328 272 329 function sixscan_installation_register_with_server( $tmpkey ){ 273 330 331 $admin_email = isset( $_GET['email'] ) ? $_GET['email'] : ""; 332 274 333 /* If there is partner file, partner_id and partner_key are filled */ 275 334 sixscan_installation_partner_info_get( $partner_id , $partner_key ); 276 335 277 336 $sixscan_register_result = sixscan_communication_oracle_reg_register( get_option( 'siteurl' ) , 278 get_option( 'admin_email' ), SIXSCAN_PLUGIN_URL . "modules/signatures/notice.php" ,337 $admin_email , SIXSCAN_PLUGIN_URL . "modules/signatures/notice.php" , 279 338 $sixscan_oracle_auth_struct , $partner_id , $partner_key , $tmpkey ); 280 339
Note: See TracChangeset
for help on using the changeset viewer.