Projet

Général

Profil

Paste
Télécharger (905 octets) Statistiques
| Branche: | Révision:

root / bin / captcha.sh @ d6b9e174

1
#!/bin/bash
2
#!/bin/sh
3
PATH=/usr/local/bin:/usr/bin:/bin
4
##############
5
# Sets hidden captcha configuration for all D7 websites. 
6
##############
7
cd /users/guest/assos/htmltest/sites
8
for x in $(ls -1 | grep -v 'all' | grep -v file-*); do
9
  if [ -d $x -a ! -L $x ]; then
10
    cd $x;
11
      echo "Configuration hidden captcha pour "$x
12
      # Enable hidden_captcha module.
13
      drush -y en hidden_captcha
14
      # Log wrong answers.
15
      drush -y vset captcha_log_wrong_responses 1
16
      # Use hidden captcha for all forms.
17
      drush -y sqlq --db-prefix "UPDATE {captcha_points} SET module = 'hidden_captcha', captcha_type = 'Hidden CAPTCHA' WHERE module is NULL;"
18
      # Flush captcha cache.
19
      drush -y vdel captcha_placement_map_cache
20
      # Randomely generate a math question as the label of the hidden captcha field.
21
      drush -y vset hidden_captcha_label "$RANDOM + $RANDOM"
22
    cd -;
23
  fi
24
done