diff --git a/manifests/init.pp b/manifests/init.pp index a4b695b..7ed8c86 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -14,7 +14,9 @@ class mediawiki( $wg_dbpassword = undef, $wg_secretkey = undef, $wg_upgradekey = undef, + # TODO(pabelanger): Remove this once 284418 lands. $wg_captchaquestions_answer = undef, + $wg_captchaquestions = {}, $wg_googleanalyticsaccount = undef, ) { diff --git a/templates/Settings.php.erb b/templates/Settings.php.erb index 9ddc1db..c6839b5 100644 --- a/templates/Settings.php.erb +++ b/templates/Settings.php.erb @@ -183,11 +183,18 @@ $wgExtraNamespaces[111] = 'Obsolete_talk'; $wgNamespacesWithSubpages[110] = true; ## Extensions - +# +require_once( "$IP/extensions/ConfirmEdit/ConfirmEdit.php" ); require_once( "$IP/extensions/ConfirmEdit/QuestyCaptcha.php" ); - $wgCaptchaClass = 'QuestyCaptcha'; -$wgCaptchaQuestions[] = array( 'question' => 'What\'s the secret word?', 'answer' => "<%= scope.lookupvar('::mediawiki::wg_captchaquestions_answer') %>" ); +$arr = array ( +<% @wg_captchaquestions.each do|key, val| -%> + "<%= key %>" => "<%= val %>", +<% end -%> +); +foreach ( $arr as $key => $value ) { + $wgCaptchaQuestions[] = array( 'question' => $key, 'answer' => $value ); +} $wgGroupPermissions['user' ]['skipcaptcha'] = true; require_once( "$IP/extensions/OpenID/OpenID.php" );