diff --git a/Source/Source.php b/Source/Source.php index 78b7468..87bb276 100644 --- a/Source/Source.php +++ b/Source/Source.php @@ -43,6 +43,9 @@ 'remote_checkin' => OFF, 'checkin_urls' => serialize( array( 'localhost' ) ), + + 'remote_imports' => OFF, + 'import_urls' => serialize( array( 'localhost' ) ), ); } diff --git a/Source/lang/strings_english.txt b/Source/lang/strings_english.txt index fc04857..d83bf7c 100644 --- a/Source/lang/strings_english.txt +++ b/Source/lang/strings_english.txt @@ -51,6 +51,8 @@ $s_plugin_Source_configuration = 'Configuration'; $s_plugin_Source_allow_remote_checkin = 'Allow Remote Check-In'; $s_plugin_Source_remote_checkin_urls = 'Allowed Addresses'; +$s_plugin_Source_allow_remote_import = 'Allow Remote Imports'; +$s_plugin_Source_remote_import_urls = 'Allowed Addresses'; $s_plugin_Source_view_threshold = 'View Threshold'; $s_plugin_Source_manage_threshold = 'Manage Threshold'; $s_plugin_Source_buglink_regex_1 = 'Bug Link PCRE Pass 1'; diff --git a/Source/pages/manage_config.php b/Source/pages/manage_config.php index 029ea64..bd18228 100644 --- a/Source/pages/manage_config.php +++ b/Source/pages/manage_config.php @@ -22,20 +22,30 @@ $f_buglink_regex_2 = gpc_get_string( 'buglink_regex_2' ); $f_buglink_reset_2 = gpc_get_string( 'buglink_reset_2', OFF ); +function check_urls( $t_urls_in ) { + $t_urls_in = explode( "\n", $t_urls_in ); + $t_urls_out = array(); + + foreach( $t_urls_in as $t_url ) { + $t_url = trim( $t_url ); + if ( is_blank( $t_url ) || in_array( $t_url, $t_urls_out ) ) { + continue; + } + + $t_urls_out[] = $t_url; + } + + return $t_urls_out; +} + $f_remote_checkin = gpc_get_bool( 'remote_checkin', OFF ); $f_checkin_urls = gpc_get_string( 'checkin_urls' ); -$t_checkin_urls_gpc = explode( "\n", $f_checkin_urls ); -$t_checkin_urls = array(); +$f_remote_import = gpc_get_bool( 'remote_import', OFF ); +$f_import_urls = gpc_get_string( 'import_urls' ); -foreach( $t_checkin_urls_gpc as $t_checkin_url ) { - $t_checkin_url = trim( $t_checkin_url ); - if ( is_blank( $t_checkin_url ) || in_array( $t_checkin_url, $t_checkin_urls ) ) { - continue; - } - - $t_checkin_urls[] = $t_checkin_url; -} +$t_checkin_urls = check_urls( $f_checkin_urls ); +$t_import_urls = check_urls( $f_import_urls ); if ( $f_view_threshold != plugin_config_get( 'view_threshold' ) ) { plugin_config_set( 'view_threshold', $f_view_threshold ); @@ -70,6 +80,7 @@ } plugin_config_set( 'checkin_urls', serialize( $t_checkin_urls ) ); +plugin_config_set( 'import_urls', serialize( $t_import_urls ) ); print_successful_redirect( plugin_page( 'manage_config_page', true ) ); diff --git a/Source/pages/manage_config_page.php b/Source/pages/manage_config_page.php index 64dc530..6fa486d 100644 --- a/Source/pages/manage_config_page.php +++ b/Source/pages/manage_config_page.php @@ -19,13 +19,17 @@ print_manage_menu(); -$t_checkin_urls = unserialize( plugin_config_get( 'checkin_urls' ) ); $t_remote_checkin = plugin_config_get( 'remote_checkin' ); +$t_checkin_urls = unserialize( plugin_config_get( 'checkin_urls' ) ); + +$t_remote_import = plugin_config_get( 'remote_imports' ); +$t_import_urls = unserialize( plugin_config_get( 'import_urls' ) ); + ?>
- +
@@ -75,6 +79,22 @@ ?> + + +> + + + + +> + + + +
>