Captcha util.
More...
◆ __callStatic()
static ilCaptchaUtil::__callStatic |
( |
|
$name, |
|
|
array |
$arguments = array() |
|
) |
| |
|
static |
- Parameters
-
string | $name | |
array | $arguments | |
- Returns
- bool
- Exceptions
-
Definition at line 43 of file class.ilCaptchaUtil.php.
44 {
45 if (
46 strpos(
$name,
'isActiveFor') === 0 ||
47 strpos(
$name,
'setActiveFor') === 0
48 ) {
51 $method_parts = explode(
'_', strtolower(preg_replace(
'/([a-z])([A-Z])/',
'$1_$2',
$name)));
52 $requested_context = strtolower($method_parts[count($method_parts) - 1]);
53 if (!isset($requested_context, self::$context_map)) {
55 }
56
57 if ('set' == $method_parts[0]) {
58 $settings->set('activate_captcha_anonym_' . $supported_contexts[$requested_context], (int) $arguments[0]);
59 return;
60 } else {
61 return self::checkFreetype() && (bool) $settings->get(
'activate_captcha_anonym_' . $supported_contexts[$requested_context],
false);
62 }
63 } else {
65 }
66 }
static getSupportedContexts()
static checkFreetype()
Check whether captcha support is active.
References $name, checkFreetype(), and getSupportedContexts().
◆ checkFreetype()
static ilCaptchaUtil::checkFreetype |
( |
| ) |
|
|
static |
◆ getSupportedContexts()
static ilCaptchaUtil::getSupportedContexts |
( |
| ) |
|
|
staticprivate |
- Returns
- array
Definition at line 87 of file class.ilCaptchaUtil.php.
88 {
89 if (null !== self::$context_map) {
91 }
92
93 self::$context_map = array();
94
95 $r = new ReflectionClass(new self());
96 $constants = $r->getConstants();
97 foreach ($constants as
$name => $value) {
98 if (strpos(
$name,
'CONTEXT_') === 0) {
99 self::$context_map[strtolower(substr(
$name, strlen(
'CONTEXT_')))] = $value;
100 }
101 }
102
104 }
References $context_map, and $name.
Referenced by __callStatic().
◆ $context_map
ilCaptchaUtil::$context_map |
|
staticprotected |
◆ CONTEXT_FORUM
const ilCaptchaUtil::CONTEXT_FORUM = 'frm' |
◆ CONTEXT_LOGIN
const ilCaptchaUtil::CONTEXT_LOGIN = 'auth' |
◆ CONTEXT_REGISTRATION
const ilCaptchaUtil::CONTEXT_REGISTRATION = 'reg' |
◆ CONTEXT_WIKI
const ilCaptchaUtil::CONTEXT_WIKI = 'wiki' |
The documentation for this class was generated from the following file: