You are here

public function BotchaRecipebookAbstract::isApplicable in BOTCHA Spam Prevention 7.2

Same name and namespace in other branches
  1. 6.2 controller/botcha_recipebook.controller.inc \BotchaRecipebookAbstract::isApplicable()

File

controller/botcha_recipebook.controller.inc, line 61
Controller layer of the BotchaRecipebook objects.

Class

BotchaRecipebookAbstract
@file Controller layer of the BotchaRecipebook objects.

Code

public function isApplicable($form, $form_state) {
  $form_id = $form['form_id']['#value'];
  $isApplicable = FALSE;
  if (!user_access('skip BOTCHA')) {
    $isApplicable = TRUE;
  }
  switch ($form_id) {
    case 'user_register':

      // Only change the registration form. There is also 'user_register' form
      // at /admin/config/people/user/create path, but we leave it alone.
      if (FALSE === strpos($form['#action'], 'user/register')) {
        if (!variable_get('botcha_allow_on_admin_pages', FALSE)) {
          $isApplicable = FALSE;
        }
      }
      break;
  }
  return $isApplicable;
}