Firefox PHP

Terms of Service Module

Posted by Brian Moon 
Re: Terms of Service Module
August 31, 2006 01:12PM
Did you rename the module's directory?


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Terms of Service Module
August 31, 2006 02:21PM
Hi Netwalker,

Quote
Netwalker
when I click save in the tos settings the page afterwards says "There are no settings for this module."

Okay, I found the problem. One of my zip files include a path name with version number. Sorry. The actual zip file is correct. Please rename the modules directory to terms_of_service

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Terms of Service Module
September 01, 2006 01:53AM
done that. worked great. thank you sooo much :)

btw nowhere in the readme it says: save your settings once. it only says it saves the custom field when accessing the forum ;) maybe that would be a help to know

thanks again,

Netwalker.
Re: Terms of Service Module
September 01, 2006 03:43AM
Hi Netwalker,

Quote
Netwalker
done that. worked great. thank you sooo much :)

Gern geschehen!

Based on our experiences I started to implement some sanity checks via the sanity check hook. But it seems, that's the first time someone tries this ;-) Sure I need some more days to finish next version which will include sanity checks.

But if an admin changes the directory name (or the programmer made a mistake like me) none of the sanity checks in the module will work either. So I opened a new ticket to ask for a new system sanity check. If the phorum developer don't find time to program this function I'll do it later.

Quote
Netwalker
btw nowhere in the readme it says: save your settings once.

Yes that's a point I'm thinking already about since I started to write modules. I think a lot of admins go always to the settings page after installing a new module just curious about the options. So in most cases it's not a problem.

But I think it should be handled in the module to store automaticlly default values even if the admin doesn't go to the settings page. I'll try to integrate that in the existing install function.

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Terms of Service Module
September 01, 2006 07:19AM
I noticed a strange behavior today... whenever someone posts a message their TOS accept date gets updated to the current date.

While this is possibly not a problem, it's certainly in bad form.

the fix is to change line 92 from:
if ($PHORUM['DATA']['LOGGEDIN']) {
TO:
if ($PHORUM['DATA']['LOGGEDIN'] && $_POST['tos_accept']) {

This exercise also made me think...there's a situation where people will be thought to be current with the terms when they're really behind.

If someone agrees to the terms on July 18, 2006 @ 10AM, the terms are updated July 18, 2006 @ 1PM, they'll be current with the new terms even though they aren't current with the new terms.

it may be necessary to use a timestamp instead of a date? or a date code which includes time...for my purposes this is a backburner issue for me, so if no one gets around to it down the road, then I may in time, but it should definitely go on the TODO list.

As I can see, there are several problems with making the change (I'm hoping mmakaay can shed some light on the posibilities here):
1) I don't know if there's a mechanism for modifying the size of a custom user field.
2) there would have to be a check to see if the custom user field is using the old format or a new one (or somehow, upon upgrading, modify everyones custom user field to add a timestamp of 12:01AM (or better, 00:00 for military time to avoid am/pm processing) to ALL of the existing entries in the custom user field at once.
3) one could disgard the custom user field and just create a new one, but this means that all users whove accepted the terms have to re-accept the terms which would be terribly inconvenient.


I have a request also... I think many people might find it useful if this module enabled (optionally) enforcing compliance upon login--in other words. don't accept a login from a user unless their agreement with the terms is current.

I havn't looked into the hooks required but I'm presuming it's simply writing a mod_tos_check_login?? function or something like that.
Re: Terms of Service Module
September 01, 2006 08:10AM
Quote

1) I don't know if there's a mechanism for modifying the size of a custom user field.

Custom user fields are always the full size in the database (65000+ bytes). The size that is put in the config is only used to truncate the length of the field if longer data is sent. So by changing the length of the custom user field in the settings, things will automatically be okay. This does not involve complicated database updates or anything.

Quote

2) there would have to be a check to see if the custom user field is using the old format or a new one (or somehow, upon upgrading, modify everyones custom user field to add a timestamp of 12:01AM (or better, 00:00 for military time to avoid am/pm processing) to ALL of the existing entries in the custom user field at once.

The easiest time format for comparison is Epoch IMO (seconds since 1970). Using file_getmtime() (by head, might be named slightly different), you can get the time for the TOC file (maybe that's already the way it's done, I don't know the specifics of this mod). This time is in Epoch. If the user accepts the TOC, then the user field can be updated to set this Epoch time as the accept time.

If the file time is different form the stored accept time, then the user has to re-sign the TOC. Mind that checking this is best done using "$usertime != $filemtime" and not "$usertime < $filemtime", because some timezone problems in uploading might cause uploaded files to be dated in the past.

Detecting this way of storing the accept date/time is easy. Epoch is formatted using only numbers, so is_numeric($usertime) can tell you if an Epoch time is stored or not.

I hope these thoughts help.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Terms of Service Module
September 01, 2006 11:52AM
Hi Freedman,

Quote
freedman
I noticed a strange behavior today... whenever someone posts a message their TOS accept date gets updated to the current date.

Thanks for reporting this bug. It will be corrected in my next version.

Quote
freedman
If someone agrees to the terms on July 18, 2006 @ 10AM, the terms are updated July 18, 2006 @ 1PM, they'll be current with the new terms even though they aren't current with the new terms.

What about using always the date of tomorrow? I think admins are changing the TOS very rarely so I think it's better do treat this by "organization" and not by "programming". A hint on the settings page to use always a date in the future should be enough. Do you agree?

Quote
freedman
I think many people might find it useful if this module enabled (optionally) enforcing compliance upon login--in other words. don't accept a login from a user unless their agreement with the terms is current.

You don't have the possibility to treat this ON the login page since you don't know which user will login. How to check the TOS accept date? The only way is to check after the login and to forward to a page where the user have to accept the new TOS.

But I think it's complicated to program. What about if the user doesn't accept the TOS on this page because he goes to another page in the forum?

There are also a lot of users in a (my) forum which do not post. They only READ new messages. Why to force this people to renew the TOS? I think a TOS is necesary for WRITERS but not for READERS. So forcing a renew when posting is sufficient.

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Terms of Service Module
September 01, 2006 01:35PM
Just some thoughts:
In the use of this module, there are probably site owners who want the readers to sign the TOC as well. There could be some disclaimer about not being responsible for any damage resulting from following instructions found in forum messages for example. For those cases, maybe even anonymous users would have to sign the TOC before being able to read postings (though that could be handled too by not allowing anonymous reading and implementing a TOC for registered users).


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Terms of Service Module
September 01, 2006 01:47PM
Quote
Oliver Riesen
Hi Freedman,
Quote
freedman
If someone agrees to the terms on July 18, 2006 @ 10AM, the terms are updated July 18, 2006 @ 1PM, they'll be current with the new terms even though they aren't current with the new terms.

What about using always the date of tomorrow? I think admins are changing the TOS very rarely so I think it's better do treat this by "organization" and not by "programming". A hint on the settings page to use always a date in the future should be enough. Do you agree?

well. I agree that making the site manager do a tiny bit of work infrequently might make more sense than adding code that got executed thousands of times an hour...although your logic is possibly problematic.

if I set the TOC date to tomorrow, then evreyone today will be asked to renew the terms everytime they post anything all day long.

so that's not a good thing at all, especially if it's a phorum with high levels of daily activity from users.

I have some deadlines in the next week .. after that I may take a crack at an update of this mod to include epoch time (comparing to file update would be problematic because of the different language files, I'm thinking, but actually that might be even better.. if just the german toc were updated, no sense making french people agree to them again).. the issue with filemtime is that it can change depending on how backups rae restored, etc.. and you might end up with everyone asked to renew terms when you have some filesystem or server issue.
Re: Terms of Service Module
September 01, 2006 05:46PM
I discovered another bug today:

in the template, the new code doesn't work right:

THIS:
  {IF USER->mod_tos_current}
doesn't work.. it seems that USER and $PHORUM['user'] aren't the same thing??

temporarily I changed the {IF to
<? if ($PHORUM['user']['mod_tos_current']) { ?>

Keith
Sorry, only registered users may post in this forum.

Click here to login