You are here

function role_export_submit in Role Export 6

Save the role information to the {role} table.

1 string reference to 'role_export_submit'
role_export_form_alter in ./role_export.module
Implements hook_form_alter().

File

./role_export.module, line 86
Role Export's primary module file.

Code

function role_export_submit($form, &$form_state) {
  $op = $form_state['values']['op'];
  if ($op == 'Add role') {
    $role = (object) $form_state['values'];
    $query = db_fetch_object(db_query("SELECT rid FROM {role} WHERE name = '%s'", $role->name));
    $rid = role_export_generate_id($role->machine_name);
    db_query("UPDATE {role} SET rid = %d, machine_name = '%s' WHERE rid = %d", $rid, $role->machine_name, $query->rid);
    role_export_normalize();
  }
}