You are here

function botcha_update_7201 in BOTCHA Spam Prevention 7.3

Same name and namespace in other branches
  1. 7.2 botcha.install \botcha_update_7201()

Create an interface to manage the list of forms that are forbidden to protect.

1 call to botcha_update_7201()
botcha_install in ./botcha.install
Implements of hook_install().

File

./botcha.install, line 400

Code

function botcha_update_7201() {
  foreach (_botcha_default_form_ids() as $form_id) {
    $enabled = !in_array($form_id, array(
      'update_script_selection_form',
      'user_login',
      'user_login_block',
    ));

    // @todo Find a way to use usual application interface to perform even update changes.

    //Botcha::getForm($form_id, TRUE)->setEnabled($enabled)->save();

    // Cast to boolean first.
    $enabled = (bool) $enabled;

    // Cast to integer.
    $enabled = (int) $enabled;
    variable_set("botcha_enabled_{$form_id}", $enabled);
  }
}