You are here

function ldapauth_admin_list in LDAP integration 6

Same name and namespace in other branches
  1. 5.2 ldapauth.module \ldapauth_admin_list()
  2. 5 ldapauth.module \ldapauth_admin_list()

Implements the LDAP servers list.

Return value

The HTML table with the servers list.

1 string reference to 'ldapauth_admin_list'
ldapauth_menu in ./ldapauth.module
Implements hook_menu().

File

./ldapauth.admin.inc, line 177
Module admin page callbacks.

Code

function ldapauth_admin_list() {
  $form['list'] = array();
  $result = db_query("SELECT sid, name, status, weight FROM {ldapauth} ORDER BY weight");
  while ($row = db_fetch_object($result)) {
    $form['list'][$row->sid] = array(
      'name' => array(
        '#value' => $row->name,
      ),
      'status' => array(
        '#value' => $row->status,
      ),
      'weight' => array(
        '#type' => 'weight',
        '#name' => 'sid_' . $row->sid . '_weight',
        '#delta' => 10,
        '#default_value' => $row->weight,
      ),
    );
  }
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  return $form;
}