/** * Add macros to the form service * * @return void */ protected function registerMacros() { $this->app['form']->macro('recaptcha', function () { return recaptcha(); }); $this->app['form']->macro('recaptcha_noscript', function () { return recaptcha_noscript(); }); $this->app['form']->macro('recaptcha_script', function () { return recaptcha_script(); }); $this->app['form']->macro('recaptcha_widget', function (array $options = []) { return recaptcha_widget($options); }); }
header('Location: upanel.php?id=error&why=rpass&url=upanel.php?id=edit'); exit; } if (!$api->update_user_password($_SESSION[ID], $pass)) { header('Location: upanel.php?id=error&why=pass&url=upanel.php?id=edit'); exit; } $ms = $TEXT['Your password has been updated to'] . ": " . $pass; $api->mailto($_SESSION[EMAIL], $TEXT['Password Update'], $ms); $_SESSION[PASS] = $pass; header('Location: upanel.php?id=success&url=upanel.php?id=edit'); break; case 'new': $result = true; if (!$DATA['login'] && $DATA['recaptcha'] != "") { $result = recaptcha(); } if (!$result) { header('Location: index.php?mode=error&why=captcha&url=index.php?id=create_ticket'); exit; } $properties_array = array(); $query = $api->get_properties("tickets"); while ($reg = mysqli_fetch_array($query)) { $properties_array["{$reg['name']}"] = $_POST["provalue-{$reg['name']}"]; } if ($DATA['login']) { $result = $api->new_ticket($_POST['n-department'], $_POST['n-lang'], $_POST['n-title'], $_POST['n-message'], $_SESSION[EMAIL], $_SESSION[NAME], $_SESSION[ID], $properties_array); } else { $result = $api->new_ticket($_POST['n-department'], $_POST['n-lang'], $_POST['n-title'], $_POST['n-message'], $_POST['n-email'], $_POST['n-name'], $_POST['n-name'], $properties_array); }
//open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, count($fields)); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_RETURNTRANSFER, True); //execute the post $result = curl_exec($ch); //close the connection curl_close($ch); return json_decode($result); } $form = True; if (isset($_POST['submit'])) { $recaptcha = recaptcha(); if (!isset($_POST['quote']) or !$_POST['quote']) { print ' <div class="failure"> <p>Please try that again</p> <p>To say nothing is wisdom</p> <p>But not quotable</p> </div> '; } elseif (!$recaptcha->success) { print ' <div class="failure"> <p>You have failed my test</p> <p>That judges humanity</p> <p>Try again, toaster</p> </div>
function recaptcha_valid($response) { return recaptcha()->valid($response); }