Is there a way to restrict the expiration date to "not more than a year"?
I explain: I am building a site to which Teachers will give an access code to students for a year beginning on the first day of class and expiring exactly one year after. All classes do not start at the same date. I want to make sure teachers will not abuse the privilege or forget to give end date.
Thanks for any advice.
Comments
Comment #1
glekli commentedHave you tried using hook_form_alter? That way, you can modify the form or its fields, and add any custom logic.
You will most likely need to add a validator function, and do checks in there. Something like this:
Comment #2
hyperlinkedI've incorporated this into my patch against issue #2265509:
https://drupal.org/node/2265509
That patch adds functionality to allow you to set a default expiration interval from a module configuration page. Once set, the expiration will default to an interval into the future that you define.
Comment #3
hyperlinkedComment #5
glekli commentedThis feature has been added in the latest release.
Comment #6
hyperlinkedVerified. Closed.