|
146 | 146 | } |
147 | 147 | if (array_key_exists('resubmit', $_POST)) { |
148 | 148 | $test = GetTestInfo(trim($_POST['resubmit'])); |
149 | | - if (array_key_exists('key', $test)){ |
| 149 | + if (array_key_exists('key', $test)) { |
150 | 150 | $test['key'] = null; |
151 | 151 | } |
152 | 152 | if ($test) { |
|
221 | 221 | $is_private = 0; |
222 | 222 |
|
223 | 223 | $is_private_api_call = !empty($user_api_key) && !empty($req_private) && |
224 | | - ((int)$req_private == 1 || $req_private == 'true'); |
| 224 | + ((int)$req_private == 1 || $req_private == 'true'); |
225 | 225 | $is_private_web_call = $isPaid && ($_POST['private'] == 'on'); |
226 | 226 |
|
227 | 227 | if ($is_private_api_call || $is_private_web_call) { |
@@ -900,6 +900,14 @@ function buildSelfHost($hosts) |
900 | 900 | return $selfHostScript; |
901 | 901 | } |
902 | 902 |
|
| 903 | +$isFree = !is_null($request_context->getUser()) && $request_context->getUser()->isFree(); |
| 904 | + |
| 905 | +// Allow free user to run test only if email is verified |
| 906 | +if ($isFree && !$request_context->getUser()->isVerified()) { |
| 907 | + $errorTitle = 'Email address is not verified'; |
| 908 | + $error = 'Please verify your email address to use WebPageTest.'; |
| 909 | +} |
| 910 | + |
903 | 911 |
|
904 | 912 | if (!strlen($error) && CheckIp($test) && CheckUrl($test['url']) && CheckRateLimit($test, $error, $errorTitle)) { |
905 | 913 | $total_runs = Util::getRunCount($test['runs'], $test['fvonly'], $test['lighthouse'], $test['type']); |
@@ -1827,9 +1835,24 @@ function ValidateParameters(&$test, $locations, &$error, $destination_url = null |
1827 | 1835 |
|
1828 | 1836 | // make sure on/off options are explicitly 1 or 0 |
1829 | 1837 | $values = array( |
1830 | | - 'private', 'web10', 'ignoreSSL', 'tcpdump', 'standards', 'lighthouse', |
1831 | | - 'timeline', 'swrender', 'netlog', 'spdy3', 'noscript', 'fullsizevideo', |
1832 | | - 'blockads', 'sensitive', 'pngss', 'bodies', 'htmlbody', 'pss_advanced', |
| 1838 | + 'private', |
| 1839 | + 'web10', |
| 1840 | + 'ignoreSSL', |
| 1841 | + 'tcpdump', |
| 1842 | + 'standards', |
| 1843 | + 'lighthouse', |
| 1844 | + 'timeline', |
| 1845 | + 'swrender', |
| 1846 | + 'netlog', |
| 1847 | + 'spdy3', |
| 1848 | + 'noscript', |
| 1849 | + 'fullsizevideo', |
| 1850 | + 'blockads', |
| 1851 | + 'sensitive', |
| 1852 | + 'pngss', |
| 1853 | + 'bodies', |
| 1854 | + 'htmlbody', |
| 1855 | + 'pss_advanced', |
1833 | 1856 | 'noheaders' |
1834 | 1857 | ); |
1835 | 1858 | foreach ($values as $value) { |
@@ -3555,7 +3578,7 @@ function CheckRateLimit($test, &$error, &$errorTitle) |
3555 | 3578 |
|
3556 | 3579 | $errorTemplate = "<p>Don't worry! You can keep testing for free once you log in, which will give you access to other excellent features like:</p>"; |
3557 | 3580 | $errorTitleTemplate = "You've reached the limit for"; |
3558 | | - |
| 3581 | + |
3559 | 3582 | if (!$passesMonthly) { |
3560 | 3583 | $errorTitle = "{$errorTitleTemplate} this month"; |
3561 | 3584 | $error = $errorTemplate; |
|
0 commit comments