Commit 2078d4df authored by soxofaan's avatar soxofaan

refactored CAPTCHA point administration (changing challenge type, disabling, deleting):

* added confirmation dialog for deleting/disabling a CAPTCHA point (previously just a GET request was needed for disabling a CAPTCHA, which is not so secure)
* #214557: added form for adding a CAPTCHA point by hand
parent 60e22b6a
This diff is collapsed.
......@@ -53,8 +53,8 @@ function captcha_menu() {
'title' => 'CAPTCHA',
'description' => 'Administer how and where CAPTCHAs are used.',
'file' => 'captcha.admin.inc',
'page callback' => 'captcha_admin',
'page arguments' => array(3, 4),
'page callback' => 'drupal_get_form',
'page arguments' => array('captcha_admin_settings'),
'access arguments' => array('administer CAPTCHA settings'),
'type' => MENU_NORMAL_ITEM,
);
......@@ -79,6 +79,13 @@ function captcha_menu() {
'type' => MENU_LOCAL_TASK,
'weight' => 5,
);
$items['admin/user/captcha/captcha/captcha_point'] = array(
'title' => 'CAPTCHA point adminstration',
'file' => 'captcha.admin.inc',
'page callback' => 'captcha_point_admin',
'page arguments' => array(5, 6),
'type' => MENU_CALLBACK,
);
return $items;
}
......@@ -283,14 +290,14 @@ function captcha_form_alter(&$form, $form_state, $form_id) {
'#value' => t('"@type" by module "@module" (!change, !disable)', array(
'@type' => $captcha_point->type,
'@module' => $captcha_point->module,
'!change' => l(t('change'), "admin/user/captcha/$form_id", array('query' => drupal_get_destination())),
'!disable' => l(t('disable'), "admin/user/captcha/$form_id/disable", array('query' => drupal_get_destination())),
'!change' => l(t('change'), "admin/user/captcha/captcha/captcha_point/$form_id", array('query' => drupal_get_destination())),
'!disable' => l(t('disable'), "admin/user/captcha/captcha/captcha_point/$form_id/disable", array('query' => drupal_get_destination())),
)),
);
}
else {
$form['captcha']['add_captcha'] = array(
'#value' => l(t('Place a CAPTCHA here for untrusted users.'), "admin/user/captcha/$form_id/enable", array('query' => drupal_get_destination()))
'#value' => l(t('Place a CAPTCHA here for untrusted users.'), "admin/user/captcha/captcha/captcha_point/$form_id", array('query' => drupal_get_destination()))
);
}
// Add pre_render function for placement of CAPTCHA formt element (above submit buttons).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment