From 9f2e5f4c20e7da764c193e62e3adb0c4e788b23d Mon Sep 17 00:00:00 2001 From: "Paul W. Frields" Date: Fri, 16 Jul 2010 00:01:39 -0400 Subject: Add callback and template for db queries --- authfas.module | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'authfas.module') diff --git a/authfas.module b/authfas.module index 80501e2..5bebb97 100644 --- a/authfas.module +++ b/authfas.module @@ -156,6 +156,14 @@ function authfas_admin_validate($form, &$form_state) { return TRUE; } +/** + * To connect an arbitrary number of roles in Drupal with FAS groups, + * we first alter the role editing form to add a field, using the + * hook_form_FORM_ID_alter() function. We then push a custom function + * onto the callback array to allow us to run database queries on + * submit. + */ +// First, alter the user role editing form. function authfas_form_user_admin_role_alter(&$form, $form_state) { $newform = array(); // I'm obviously not very good at PHP because I couldn't figure @@ -174,9 +182,16 @@ function authfas_form_user_admin_role_alter(&$form, $form_state) { } $newform[$key] = $val; } + // Add a callback to the stack + $newform['#submit'][] = 'authfas_user_admin_role_submit'; $form = $newform; } +// Next, add functions to update the database. +function authfas_user_admin_role_submit($form, &$form_state) { + // FIXME: Add database queries here +} + // Local variables: // mode:php // tab-width:2 -- cgit