You are here

function uc_order_condition_user_name in Ubercart 6.2

Check a user name.

See also

uc_order_condition_user_name()

1 string reference to 'uc_order_condition_user_name'
uc_order_ca_condition in uc_order/uc_order.ca.inc
Implements hook_ca_condition().

File

uc_order/uc_order.ca.inc, line 879
This file contains the Conditional Actions hooks and functions necessary to make the order related entity, conditions, events, and actions work.

Code

function uc_order_condition_user_name($order, $settings) {
  if (empty($order->uid)) {

    // Anonymous users have no names.
    return empty($settings['name']);
  }
  else {

    // Load from the order.
    if ($account = uc_order_user_load($order)) {
      return $account->name == $settings['name'];
    }
    else {
      return FALSE;
    }
  }
}