You are here

function acl_save_form in ACL 6

Same name and namespace in other branches
  1. 8 acl.admin.inc \acl_save_form()
  2. 5 acl.module \acl_save_form()
  3. 7 acl.admin.inc \acl_save_form()

Write the results of a form.

The module that embedded our form must call this function!

File

./acl.admin.inc, line 117
Implementations of administration functions for the acl module.

Code

function acl_save_form($form, $priority = NULL) {
  $users = unserialize($form['user_list']);
  db_query('DELETE FROM {acl_user} WHERE acl_id = %d', $form['acl_id']);
  foreach ($users as $uid => $name) {
    db_query('INSERT INTO {acl_user} (acl_id, uid) VALUES (%d, %d)', $form['acl_id'], $uid);
  }
  if (isset($priority)) {
    db_query('UPDATE {acl_node} SET priority = %d where acl_id = %d', $priority, $form['acl_id']);
  }
}