You are here

function ldapgroups_admin_edit_submit in LDAP integration 5

Same name and namespace in other branches
  1. 5.2 ldapgroups.module \ldapgroups_admin_edit_submit()
  2. 6 ldapgroups.admin.inc \ldapgroups_admin_edit_submit()

File

./ldapgroups.module, line 201

Code

function ldapgroups_admin_edit_submit($form_id, $form_values) {
  $sid = $form_values['sid'];
  if ($form_values['confirm']) {

    // reset the ldapgroups config to default values - in effect, deactivate this config
    db_query("UPDATE {ldapauth} SET ldap_groups_in_dn = '%d', ldap_groups_in_dn_desc = '%d', ldap_group_dn_attribute = '%s', ldap_groups_in_attr = '%d', ldap_group_attr = '%s', ldap_groups_as_entries = '%d', ldap_group_entries = '%s', ldap_group_entries_attribute = '%s'  WHERE sid = %d", '0', '0', '', '0', '', '0', '', '', $sid);
    watchdog('ldap', t('ldapgroups: ldap config %config updated.', array(
      '%config' => $sid,
    )));
  }
  else {

    // update the ldapgroups configuration
    db_query("UPDATE {ldapauth} SET ldap_groups_in_dn = '%d', ldap_groups_in_dn_desc = '%d', ldap_group_dn_attribute = '%s', ldap_groups_in_attr = '%d', ldap_group_attr = '%s', ldap_groups_as_entries = '%d', ldap_group_entries = '%s', ldap_group_entries_attribute = '%s'  WHERE sid = %d", $form_values['ldap_groups_in_dn'], $form_values['ldap_groups_in_dn_desc'], $form_values['ldap_group_dn_attribute'], $form_values['ldap_groups_in_attr'], $form_values['ldap_group_attr'], $form_values['ldap_groups_as_entries'], $form_values['ldap_group_entries'], $form_values['ldap_group_entries_attribute'], $sid);
    watchdog('ldap', t('ldapgroups: ldap config %config updated.', array(
      '%config' => $sid,
    )));
  }
  return 'admin/settings/ldapgroups';
}