summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--authfas.module15
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