{'general'}->{'disallow'}; $allow = $config->{'general'}->{'allow'}; if ( $allow && (! preg_match("/$allow/",$remote_addr)) ) { include("unallowed.html"); exit; } elseif ( $disallow && preg_match("/$disallow/", $remote_addr) ) { include("unallowed.html"); exit; } ## Figure out how many bytes to download/upload depending on if we are using ## auto_size or not. If using auto_size, then determine sizes based ## on initial results $config_auto_size = $config->{'general'}->{'auto_size'}; if ($config_auto_size) { ## We're using the auto_size functionality if ( isset($_GET['auto_size']) && $_GET['auto_size']) { ## Intial test is done. Set down/upload sizes to the same as ## our initial measured speeds. That way the test should take ## about 8 seconds for each test (up/down) making it about a ## 16 second test $down_kbytes = $_GET['downspeed']; $up_kbytes = $_GET['upspeed']; } else { ## Initial test using auto_size $down_kbytes = $config->{'download'}->{'initial_kbytes'}; $up_kbytes = $config->{'upload'}->{'initial_kbytes'}; } } else { ## auto_size is off. Just to the default sizes $down_kbytes = $config->{'download'}->{'default_kbytes'}; $up_kbytes = $config->{'upload'}->{'default_kbytes'}; } ## Make sure sizes are below our configured limits if ($down_kbytes > $config->{'download'}->{'max_kbytes'}) { $down_kbytes = $config->{'download'}->{'max_kbytes'}; } if ($up_kbytes > $config->{'upload'}->{'max_kbytes'}) { $up_kbytes = $config->{'upload'}->{'max_kbytes'}; } if ($config->{'upload'}->{'skip_upload'}) { $up_kbytes = 0; } ## Calculate number of loops for up/down, etc $each_chunk = 50; $progress_bar_width="400"; $reloads = $down_kbytes / $each_chunk; $increment = $progress_bar_width / $reloads; $download_progress_bar_increment = $increment; $reloads = $up_kbytes / $each_chunk; $increment = $progress_bar_width / $reloads; $upload_progress_bar_increment = $increment / 5; $pretty_version = $config->{'general'}->{'pretty_version'}; ?>