You are here

function legal_version_check in Legal 7

Same name and namespace in other branches
  1. 8 legal.module \legal_version_check()
  2. 5 legal.module \legal_version_check()
  3. 6.8 legal.module \legal_version_check()
  4. 6.7 legal.module \legal_version_check()
  5. 7.2 legal.module \legal_version_check()
  6. 2.0.x legal.module \legal_version_check()

Check if user has accepted latest version of T&C.

4 calls to legal_version_check()
legal_form_user_profile_form_alter in ./legal.module
Implements hook_form_FORM_ID_alter().
legal_login in ./legal.module
Require registered users to accept new T&C.
legal_user_login in ./legal.module
Implements hook_user_login().
legal_user_update in ./legal.module
Implements hook_user_update().

File

./legal.module, line 999
Module file for Legal.

Code

function legal_version_check($uid, $version, $revision, $legal_account = array()) {
  $accepted = FALSE;
  if (empty($legal_account)) {
    $legal_account = legal_get_accept($uid);
  }
  if (array_key_exists('version', $legal_account) && array_key_exists('revision', $legal_account)) {
    if ($legal_account['version'] == $version && $legal_account['revision'] == $revision) {
      $accepted = TRUE;
    }
  }
  return $accepted;
}