News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Updated Registration Agreement

Started by Daniel15, March 11, 2007, 11:26:05 PM

Previous topic - Next topic

Daniel15

Link to Mod

Whenever the registration agreement (agreement.txt) is updated, this mod will force users to accept the terms of the new agreement. The user won't be allowed to access the forum until they've agreed to it.

Based on a request by digit at http://www.simplemachines.org/community/index.php?topic=156942
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

RoarinRow

Cool mod.  Just one error failed test on install.  Probably cause I have too many mods?   ???

./index.php

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

Daniel15

RoarinRow, could you please send me your index.php file? If you can attach it here in a reply, do so (I can't remember whether regular members are allowed to attach things here... If not,  create a copy with a .txt extension and link to it).
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

RoarinRow

Quote from: Daniel15 on March 12, 2007, 01:15:30 AM
RoarinRow, could you please send me your index.php file? If you can attach it here in a reply, do so (I can't remember whether regular members are allowed to attach things here... If not,  create a copy with a .txt extension and link to it).

Sure, no problem.  See attached.  Thanks!

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

Daniel15

OK, I found out what was causing the problem, and have reuploaded the mod. Please try the new package, and see if that works for you :)
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

RoarinRow

Quote from: Daniel15 on March 12, 2007, 01:50:09 AM
OK, I found out what was causing the problem, and have reuploaded the mod. Please try the new package, and see if that works for you :)

It definitely worked.  As soon as I installed it, it went to the Registration Agreement page.   8)   So anytime I make a change to it from here on out, it will be displayed to all members.

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

RoarinRow

I just got this one error after I updated the Registration Agreement on my live site:

http://www.avalanchestyle.com/forum/index.php 
8: Undefined index: action
File: /forum/index.php
Line: 283

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

Daniel15

Quote from: RoarinRow on March 12, 2007, 02:35:58 AM
Quote from: Daniel15 on March 12, 2007, 01:50:09 AM
OK, I found out what was causing the problem, and have reuploaded the mod. Please try the new package, and see if that works for you :)

It definitely worked.  As soon as I installed it, it went to the Registration Agreement page.   8) 
Oops... I should make it so that when you install it, it sets everyone's last agreement date to the date of the current agreement.
Actually, now that I think about it, I found a bug... I'll fix it as soon as possible ;).

QuoteSo anytime I make a change to it from here on out, it will be displayed to all members.
Yeah, that's how it works.

QuoteI just got this one error after I updated the Registration Agreement on my live site:
Grrr... That's my fault for insufficient testing. I'll fix the package when I do the other bug fix.

I'm hoping that this will fix it:
In index.php, find:

// --- Begin modification - Updated registration agreement ---
// Perhaps we've changed the agreement? Only redirect if:
//  1. The registration agreement is enabled.
//  2. They're not a guest.
//  3. The date they last accepted the agreement is less than the current agreement's date.
//  4. They're not on the agreement pages themselves
elseif (!empty($modSettings['requireAgreement']) && !$user_info['is_guest'] && ($user_info['last_reg_accept'] < filemtime($boarddir . '/agreement.txt')) && !in_array($_REQUEST['action'], array('accept_agreement', 'accept_agreement2', 'logout')))


Replace with:

// --- Begin modification - Updated registration agreement ---
// Perhaps we've changed the agreement? Only redirect if:
//  1. The registration agreement is enabled.
//  2. They're not a guest.
//  3. The date they last accepted the agreement is less than the current agreement's date.
//  4. The action is not set
//  5. If the action is set, and they're not on the agreement pages themselves
elseif (!empty($modSettings['requireAgreement']) && !$user_info['is_guest'] && ($user_info['last_reg_accept'] < filemtime($boarddir . '/agreement.txt')) && (!isset($_REQUEST['action']) || !in_array($_REQUEST['action'], array('accept_agreement', 'accept_agreement2', 'logout'))))

Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

RoarinRow

Cool, the fix worked for the index.php error   8)   Thank you.

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

qtime

Great function, must be a standard option!

Daniel15

Quote from: RoarinRow on March 12, 2007, 10:18:49 AM
Cool, the fix worked for the index.php error   8)   Thank you.
Thanks, I'll fix it in the package as soon as possible :)

A user pointed out some problems, and has suggested some improvements to me. I'll release a new version of the mod soon :D
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

diegolyanky

Hey man ! .... That's very usefull !!

Many thanks !! ;)
SMF ... SimpleMachines ... Simple, but complete if you want it ;)

Daniel15

#12
OK, I've uploaded a new release. Special thanks to Rudolf for suggesting some changes to me :D

Changes:
- On installation, mark all members as having read the agreement
- When a new user registers, do not prompt them to agree (as they already did during registration)
- Fixed minor error reported by RoarinRow
- Instead of checking last modified date of changelog.txt, a setting has been added to the admin panel to mark the agreement as changed

- Moved code from index.php to loadUserSettings function in Load.php
- The install script checks to see if the column already exists


You'll need to uninstall version 0.1 before installing 1.0 (the latest one)

Edit: Clarified changelog
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

RoarinRow

Cool thanks for the update.  I uninstall test failed for my index.php, but I manually removed the mod from it, then installed update.

In the Registration Agreement section in the Admin CP, I do see a new check box that says 'Reset the agreement status for everyone
This will force all users to re-read the registration agreement, and agree to it in order to continue using the forum.'

I left that unchecked.  Are there any other configurations somewhere else.  Wasn't sure what you meant by 'On installation, check if column already exists'



SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

Daniel15

QuoteI uninstall test failed for my index.php, but I manually removed the mod from it, then installed update.
Yeah, that's because you changed the code in it, to fix the bug ;)

QuoteIn the Registration Agreement section in the Admin CP, I do see a new check box that says 'Reset the agreement status for everyone
This will force all users to re-read the registration agreement, and agree to it in order to continue using the forum.'

I left that unchecked.  Are there any other configurations somewhere else.
Yeah, that's the only configuration option :)

QuoteWasn't sure what you meant by 'On installation, check if column already exists'
Sorry, I didn't word it properly. What I meant was: "When you install the mod, the install script will check if the column already exists". I'll edit the changelog so it's more apparent.
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

RoarinRow

Quote from: Daniel15 on March 14, 2007, 03:54:30 AM
QuoteI uninstall test failed for my index.php, but I manually removed the mod from it, then installed update.
Yeah, that's because you changed the code in it, to fix the bug ;)

QuoteIn the Registration Agreement section in the Admin CP, I do see a new check box that says 'Reset the agreement status for everyone
This will force all users to re-read the registration agreement, and agree to it in order to continue using the forum.'

I left that unchecked.  Are there any other configurations somewhere else.
Yeah, that's the only configuration option :)

QuoteWasn't sure what you meant by 'On installation, check if column already exists'
Sorry, I didn't word it properly. What I meant was: "When you install the mod, the install script will check if the column already exists". I'll edit the changelog so it's more apparent.

o.k. great, just wanted to be sure I didn't miss anything   8)

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

Ben_S

Nice idea, although from the description, it sounds like any change will require reagreeing (is that a word), what if the only change is a typo?

Would be better to provide a checkbox or something to force reagreeing, ignore me if thats the way it already works.
Liverpool FC Forum with 14 million+ posts.

Daniel15

Quote from: Ben_S on March 18, 2007, 08:21:36 PM
Would be better to provide a checkbox or something to force reagreeing, ignore me if thats the way it already works.

That's the way it works now :)
It previously checked the last modified time of the changelog.txt file, but no longer does so. It looks like I updated the description on the mods site, but not on this topic...
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

brianjw

I need help really bad!!! I have this mod and even though i agree it wont accept. I cant access my admin or anything.

Username: test
Password: test
it only works when u are logged in!! HELP!!!!

TrueSatan


Advertisement: