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