You are here

function uc_store_initials_submit in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_store/uc_store.admin.inc \uc_store_initials_submit()

File

uc_store/uc_store.module, line 1697
Contains global Ubercart functions and store administration functionality.

Code

function uc_store_initials_submit($form_id, $form_values) {
  $result = db_query("SELECT uid FROM {users} WHERE name = '%s'", $form_values['username']);
  if ($user = db_fetch_object($result)) {
    if ($form_values['initials'] == '') {
      variable_del('user_initials_' . $user->uid);
      drupal_set_message(t('Initials for !username deleted.', array(
        '!username' => $form_values['username'],
      )));
    }
    else {
      variable_set('user_initials_' . $user->uid, $form_values['initials']);
      drupal_set_message(t('Initials for !username set to !initials.', array(
        '!username' => $form_values['username'],
        '!initials' => $form_values['initials'],
      )));
    }
  }
}