function legal_version_check in Legal 8
Same name and namespace in other branches
- 5 legal.module \legal_version_check()
- 6.8 legal.module \legal_version_check()
- 6.7 legal.module \legal_version_check()
- 7.2 legal.module \legal_version_check()
- 7 legal.module \legal_version_check()
- 2.0.x legal.module \legal_version_check()
Check if user has accepted latest version of T&C.
5 calls to legal_version_check()
- LegalLogin::buildForm in src/
Form/ LegalLogin.php - Form constructor.
- LegalLogin::submitForm in src/
Form/ LegalLogin.php - Form submission handler.
- legal_form_user_form_alter in ./
legal.module - Implements hook_form_FORM_ID_alter().
- legal_user_login in ./
legal.module - Implements hook_user_login().
- legal_user_update in ./
legal.module - Implements hook_ENTITY_TYPE_update().
File
- ./
legal.module, line 781 - Module file for Legal.
Code
function legal_version_check($uid, $version, $revision, $legal_account = []) {
$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;
}