You are here

function advpoll_check_electoral_list in Advanced Poll 7.3

Same name and namespace in other branches
  1. 7 includes/advpoll_voteapi.inc \advpoll_check_electoral_list()
  2. 7.2 includes/advpoll_voteapi.inc \advpoll_check_electoral_list()

Checks user against electoral list.

Parameters

$uid: User's ID.

$nid: Node ID of the poll.

Return value

bool TRUE or FALSE

1 call to advpoll_check_electoral_list()
advpoll_user_eligibility in includes/advpoll_voteapi.inc
Checks for user's eligibility to vote on a given poll.

File

includes/advpoll_voteapi.inc, line 292
Advanced Poll Vote API Include.

Code

function advpoll_check_electoral_list($uid, $nid) {
  $result = db_query("\n    SELECT uid\n    FROM {advpoll_electoral_list}\n    WHERE uid = :uid AND nid = :nid\n  ", array(
    ':uid' => $uid,
    ':nid' => $nid,
  ))
    ->fetchField();
  if ($result) {
    return TRUE;
  }
  return FALSE;
}