29 if (function_exists(
'imageftbbox')) {
46 strpos(
$name,
'isActiveFor') === 0 ||
47 strpos(
$name,
'setActiveFor') === 0
50 $supported_contexts = self::getSupportedContexts();
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)) {
57 if (
'set' == $method_parts[0]) {
58 $settings->set(
'activate_captcha_anonym_' . $supported_contexts[$requested_context], (
int) $arguments[0]);
61 return self::checkFreetype() && (bool) $settings->get(
'activate_captcha_anonym_' . $supported_contexts[$requested_context],
false);
71 public static function getPreconditionsMessage()
78 $lng = $DIC->language();
80 $lng->loadLanguageModule(
'cptch');
81 return "<a target='_blank' href='http://php.net/manual/en/image.installation.php'>" .
$lng->txt(
'cptch_freetype_support_needed') .
"</a>";
89 if (null !== self::$context_map) {
90 return self::$context_map;
93 self::$context_map = array();
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;
103 return self::$context_map;
const CONTEXT_REGISTRATION
static checkFreetype()
Check whether captcha support is active.
static __callStatic($name, array $arguments=array())
static getSupportedContexts()
static getLogger($a_component_id)
Get component logger.