-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrecap_test.php
53 lines (46 loc) · 2.6 KB
/
recap_test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/************************************************************************/
/* PHP-NUKE: Advanced Content Management System */
/* ============================================ */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
include('mainfile.php');
if (is_admin()) {
include_once(NUKE_BASE_DIR.'header.php');
if (!$_POST['test']){
OpenTable();
echo '<form action="./recap_test.php" method="POST">'. "\n";
echo '<span style="font-size:18px;"> This is just a Recaptcha test to verify its working.<br />Click the recaptcha image then submit.</span>'. "\n";
echo '<input type="hidden" name="test" value="lookup"/><br /><br />'. "\n";
$gfxchk = array(0,1,2,3,4,5,6,7);
echo security_code($gfxchk, 'normal'); //Size - compact || normal //Scale Adjustment - 0.90 = 90% scaledown.
echo '<br />'."\n";
echo '<input type="submit" value="Click to complete the check">'. "\n";
echo '</form><br /><br />'. "\n";
echo 'If the Recaptcha checkbox is missing, then go to <strong>ACP->Preferences->Security Options</strong><br />and verify the recaptchas site & private key are filled in correctly.';
CloseTable();
}
global $module_name;
if ($_POST['test']){
$gfxchk = array(0,1,2,3,4,5,6,7);
if (!security_code_check($_POST['g-recaptcha-response'], $gfxchk)) {
$result = '<div style="text-align:center; width:100%; color:#990000; font-size:24px;">Recaptcha Failed</div>';
$result .= '<div style="text-align:center;">This is still good. If your settings wasn\'t right, would wouldn\'t have gotten this message.<br />';
$result .= 'You failed because you just failed the recaptcha.<br />You may delete this file since everything is good.</div>';
} else {
$result = '<div style="text-align:center; width:100%; color:#009900; font-size:24px;">Recaptcha Passed</div>';
$result .= '<div style="text-align:center;">You may delete this file since everything is good.</div>';
}
OpenTable();
echo "<pre>\n" . $result . "\n</pre>\n";
CloseTable();
}
include_once(NUKE_BASE_DIR.'footer.php');
}
?>