You are here

function access_update_7107 in Access Control Kit 7

Add the {access_scheme}.realm_field_name field.

File

./access.install, line 362
Install, update and uninstall functions for the access control kit module.

Code

function access_update_7107() {
  db_add_field('access_scheme', 'realm_field_name', array(
    'description' => 'The name of the field attached to grants in this scheme that determines the realm values.',
    'type' => 'varchar',
    'length' => 32,
    'not null' => TRUE,
    'default' => '',
  ));
  $result = db_query('SELECT sid, machine_name FROM {access_scheme}');
  foreach ($result as $row) {
    db_update('access_scheme')
      ->fields(array(
      'realm_field_name' => 'ack_' . $row->machine_name,
    ))
      ->condition('sid', $row->sid)
      ->execute();
  }
}