diff options
author | Paul W. Frields <stickster@gmail.com> | 2010-07-16 00:01:39 -0400 |
---|---|---|
committer | Paul W. Frields <stickster@gmail.com> | 2010-07-16 00:01:39 -0400 |
commit | 9f2e5f4c20e7da764c193e62e3adb0c4e788b23d (patch) | |
tree | 2d3ab04475501b1421a5dc651c7abe18a21aff46 /authfas.module | |
parent | 2d6500488fdbdeb91e6f008389de67707f7588ce (diff) | |
download | drupal-authfas-6x-9f2e5f4c20e7da764c193e62e3adb0c4e788b23d.tar.gz drupal-authfas-6x-9f2e5f4c20e7da764c193e62e3adb0c4e788b23d.tar.xz drupal-authfas-6x-9f2e5f4c20e7da764c193e62e3adb0c4e788b23d.zip |
Add callback and template for db queries
Diffstat (limited to 'authfas.module')
-rw-r--r-- | authfas.module | 15 |
1 files changed, 15 insertions, 0 deletions
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 |