You are here

function flickrapi_admin_settings_submit in Flickr API 7

Same name and namespace in other branches
  1. 5 flickrapi.module \flickrapi_admin_settings_submit()
  2. 7.2 flickrapi.admin.inc \flickrapi_admin_settings_submit()

Submit handler for the admin settings form.

1 string reference to 'flickrapi_admin_settings_submit'
flickrapi_admin_settings in ./flickrapi.admin.inc
Admin settings form

File

./flickrapi.admin.inc, line 157
Admin settings form and OAuth authentication integration

Code

function flickrapi_admin_settings_submit($form, &$form_state) {

  // If the Access Permissions have changed, we need to re-authenticate.
  if ($perm_element = $form_state['complete form']['advanced']['flickrapi_access_permissions']) {
    if ($perm_element['#value'] != $perm_element['#default_value']) {
      _flickrapi_oauth_clear();
    }
  }

  // Validate the credentials on Flickr.
  if (!_flickrapi_is_authenticated()) {
    $form_state['redirect'] = 'admin/config/media/flickrapi/authenticate';
  }
}