You are here

function ldapdata_avatarcrop_submit in LDAP integration 6

Handle updating ldap when avatarcrop updates picture.

_state

Parameters

Array $form:

1 string reference to 'ldapdata_avatarcrop_submit'
ldapdata_form_alter in ./ldapdata.module
Implementation of hook_form_alter().

File

./ldapdata.module, line 1027
ldapdata provides data maping against ldap server.

Code

function ldapdata_avatarcrop_submit($form, &$form_state) {
  $uid = $form_state['values']['change_pic_uid'];
  $result = db_fetch_object(db_query("SELECT picture FROM {users} WHERE uid=%d", $uid));
  if (!empty($result->picture)) {
    $account = user_load($uid);
    $update = array(
      'picture' => $result->picture,
    );
    _ldapdata_user_submit($update, $account, 'account');
  }
}