Captcha util.
More...
◆ __callStatic()
static ilCaptchaUtil::__callStatic |
( |
|
$name, |
|
|
array |
$arguments = array() |
|
) |
| |
|
static |
- Parameters
-
string | $name | |
array | $arguments | |
- Returns
- bool
- Exceptions
-
Definition at line 44 of file class.ilCaptchaUtil.php.
References $lng.
47 strpos($name,
'isActiveFor') === 0 ||
48 strpos($name,
'setActiveFor') === 0
52 $supported_contexts = self::getSupportedContexts();
53 $method_parts = explode(
'_', strtolower(preg_replace(
'/([a-z])([A-Z])/',
'$1_$2', $name)));
54 $requested_context = strtolower($method_parts[count($method_parts) - 1]);
55 if(!isset($requested_context, self::$context_map))
60 if(
'set' == $method_parts[0])
62 $settings->set(
'activate_captcha_anonym_' . $supported_contexts[$requested_context], (
int)$arguments[0]);
67 return self::checkFreetype() && (bool)$settings->get(
'activate_captcha_anonym_' . $supported_contexts[$requested_context],
false);
72 throw new BadMethodCallException(
'Call to an undefined static method ' . $name .
' in class ' . __CLASS__ .
'.');
◆ checkFreetype()
static ilCaptchaUtil::checkFreetype |
( |
| ) |
|
|
static |
◆ getSupportedContexts()
static ilCaptchaUtil::getSupportedContexts |
( |
| ) |
|
|
staticprivate |
- Returns
- array
Definition at line 93 of file class.ilCaptchaUtil.php.
References $r, and array.
95 if(null !== self::$context_map)
97 return self::$context_map;
100 self::$context_map =
array();
102 $r =
new ReflectionClass(
new self());
103 $constants =
$r->getConstants();
104 foreach($constants as $name => $value)
106 if(strpos($name,
'CONTEXT_') === 0)
108 self::$context_map[strtolower(substr($name, strlen(
'CONTEXT_')))] = $value;
112 return self::$context_map;
Create styles array
The data for the language used.
◆ $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: