Hi Andreas,
Moodle 3.2.5+
user/policy.php
around Line 57
changed:
//$DB->set_field('user', 'policyagreed', 1, array('id'=>$USER->id));
$DB->set_field('user', 'policyagreed', time(), array('id'=>$USER->id));
lib/classes/user.php
apprx line 390:
$fields['policyagreed'] = array('type' => PARAM_INT); // Policy agreed changed to date by eric xxxxx for staff policy acceptance
I beleive there may be one more line in
lib/externallib.php around line 1840
I DID NOT CHANGE THIS LINE. I believe it is used with mobile device but since I was unsure, I did not change it. Note that my site policy for mobile does not work. The user must accept it from a browser, than all works.
$DB->set_field('user', 'policyagreed', 1, array('id' => $USER->id));
If I was to change it, it would be
$DB->set_field('user', 'policyagreed', time(), array('id'=>$USER->id));
Also not that every time an upgrade occurs I must ensure that the policyagreed field of mdl_user has not been changed back to small int.
Also as I mentionned I have an additional bit of custom coding to identify non student users.
Try searching for "policyagreed" and verify where the variable is set.
Hope this helps
Eric