Can I program a check on a save on an admin page? Take for example the CKEditor admin page, where at file browser settings you can choose IMCE at file browser type. Then  you click Save.

Can you program this? I mean in PHP; because I could also find out which SQL query is done, and use drush sql-query, but that is not what I mean. I want to program it because I have a multisite with about 70 sites.

Thanks, 

Eric J.
Yes, use hook_form_FORM_ID_alter()

function MYMODULE_form_FORM_ID_alter(&amp;$form, &amp;$form_state, $form_id) {
  $form['#validate'][] = 'MYMODULE_some_validate_function';
  $form['#submit'][] = 'MYMODULE_some_submit_function';
}

function MYMODULE_some_validate_function($form, &amp;$form_state) {
  if ($form_state['values']['foo'] !== 'bar']) {
    form_set_error('foo', t('Foo must be bar'));
  }
}

function MYMODULE_some_submit_function($form, &amp;$form_state) {
  // Do something.
}


It's not possible to be any more specific than that as 'admin' pages vary in their structure. Most are created using a system_settings_form(), though, so there's a reasonable amount of consistency.

It's also worth noting that a form created with system_settings_form() saves its data in the variables table, so you can accomplish the same thing in a lot of cases with variable_set():

variable_set('site_name', 'New name');