-
Notifications
You must be signed in to change notification settings - Fork 1
/
contactform_captcha.admin.php
94 lines (87 loc) · 2.87 KB
/
contactform_captcha.admin.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
/**
* Contact form with CAPTCHA
*
* This file is part of a module for pluck (http://www.pluck-cms.org/).
* It generates the status page for the admin panel.
*
* @copyright 2012 Paul Voegler
* @author Paul Voegler (http://www.voegler.eu/)
* @version 1.2 (January 2015)
* @license GPL Version 3, 29 June 2007
* See docs/COPYING for the complete license.
*/
defined('IN_PLUCK') OR exit('Access denied!');
defined('CFC_DIR') OR exit('Invalid request!');
function contactform_captcha_pages_admin() {
global $lang;
return array(array(
'func' => 'status',
'title' => $lang['contactform_captcha']['module_name']
));
}
function contactform_captcha_page_admin_status() {
global $lang;
$aok = true;
?>
<p>
<strong><?php eu8x($lang['contactform_captcha']['module_intro']); ?></strong>
</p>
<?php
if (!extension_loaded('gd') || !function_exists('gd_info')) {
$aok = false;
show_error($lang['contactform_captcha']['error_nogd'], 1);
} else {
$gd = gd_info();
if (!$gd['FreeType Support']) {
$aok = false;
show_error($lang['contactform_captcha']['error_nofreetype'], 1);
}
if (!$gd['PNG Support']) {
$aok = false;
show_error($lang['contactform_captcha']['error_nopng'], 1);
}
}
if (!extension_loaded('mbstring')) {
$aok = false;
show_error($lang['contactform_captcha']['error_nombstring'], 1);
}
$captcha_charset = (string)module_get_setting('contactform_captcha', 'captcha_charset');
$captcha_sensitive = (bool)(module_get_setting('contactform_captcha', 'captcha_sensitive') === 'true');
$captcha_audio = (bool)(module_get_setting('contactform_captcha', 'captcha_audio') === 'true');
$captcha_audiotheme = (string)module_get_setting('contactform_captcha', 'captcha_audiotheme');
$missing = false;
for ($i = 0; $i < strlen($captcha_charset); $i++) {
if (!is_file(CFC_DIR . 'audio/' . $captcha_audiotheme . '/' . strtolower($captcha_charset[$i]) . '.wav')) {
$aok = false;
$missing = true;
break;
}
}
if ($missing) {
$aok = false;
show_error($lang['contactform_captcha']['error_nowavltr'], $captcha_audio ? 1 : 2);
}
if (!is_file(CFC_DIR . 'audio/' . $captcha_audiotheme . '/' . 'capital.wav')) {
$aok = false;
show_error($lang['contactform_captcha']['error_nowavcap'], $captcha_audio ? 1 : 2);
}
$backgrounds = read_dir_contents(CFC_DIR . 'audio/backgrounds/', 'files');
$missing = true;
foreach ($backgrounds as $file) {
if (substr($file, -4) === '.wav') {
$missing = false;
break;
}
}
if ($missing) {
$aok = false;
show_error($lang['contactform_captcha']['error_nowavbg'], 2);
}
if ($aok) show_error($lang['contactform_captcha']['error_aok'], 3);
?>
<p><?php eu8x($lang['contactform_captcha']['module_help']); ?></p>
<p><a href="?action=modules"><<< <?php eu8x($lang['general']['back']); ?></a>   <a href="?action=modulesettings">>>> <?php eu8x($lang['modules_settings']['title']); ?></a></p>
<?php
}
?>