You are here

function _support_enabled in Support Ticketing System 6

Same name and namespace in other branches
  1. 7 support.module \_support_enabled()
1 call to _support_enabled()
support_subscribe_form in ./support.module
Provide option to subscribe/unsubscribe from ticket notification emails.

File

./support.module, line 3659
support.module

Code

function _support_enabled($clid, $uid) {
  static $enabled = array();
  if (!isset($enabled[$clid])) {
    $autosubscribe = db_result(db_query('SELECT autosubscribe FROM {support_client} WHERE clid = %d', $clid));
    $names = explode(',', $autosubscribe);
    foreach ($names as $name) {
      $account = user_load(array(
        'name' => trim($name),
      ));
      $enabled[$clid][$account->uid] = TRUE;
    }
  }
  return isset($enabled[$clid][$uid]);
}