You are here

function legal_get_accept in Legal 6.8

Same name and namespace in other branches
  1. 8 legal.module \legal_get_accept()
  2. 5 legal.module \legal_get_accept()
  3. 6.7 legal.module \legal_get_accept()
  4. 7.2 legal.module \legal_get_accept()
  5. 7 legal.module \legal_get_accept()
  6. 2.0.x legal.module \legal_get_accept()
4 calls to legal_get_accept()
legal_display_changes in ./legal.module
Get all changes since user last accepted.
legal_login in ./legal.module
Require registered users to accept new T&C.
legal_user in ./legal.module
Implementation of hook_user().
legal_version_check in ./legal.module
Check if user has accepted latest version of T&C.

File

./legal.module, line 596
Displays Terms & Conditions, and makes sure they are accepted before registration is accepted.

Code

function legal_get_accept($uid) {
  $keys = array(
    'legal_id',
    'version',
    'revision',
    'language',
    'uid',
    'accepted',
  );
  $result = db_fetch_array(db_query_range("SELECT * FROM {legal_accepted} WHERE uid = %d ORDER BY version DESC, revision DESC", $uid, 0, 1));
  foreach ($keys as $key) {
    $accept[$key] = $result[$key];
  }
  return $accept;
}