Advertisement:

Author Topic: Updated Registration Agreement  (Read 49545 times)

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,222
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Updated Registration Agreement
« on: March 11, 2007, 11:26:05 PM »
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!

Offline RoarinRow

  • Full Member
  • ***
  • Posts: 662
  • Gender: Male
  • Ride my AV!
    • Avalanche Style
Re: Updated Registration Agreement
« Reply #1 on: March 11, 2007, 11:52:18 PM »
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

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,222
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Updated Registration Agreement
« Reply #2 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).
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!

Offline RoarinRow

  • Full Member
  • ***
  • Posts: 662
  • Gender: Male
  • Ride my AV!
    • Avalanche Style
Re: Updated Registration Agreement
« Reply #3 on: March 12, 2007, 01:26:21 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

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,222
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Updated Registration Agreement
« Reply #4 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 :)
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!

Offline RoarinRow

  • Full Member
  • ***
  • Posts: 662
  • Gender: Male
  • Ride my AV!
    • Avalanche Style
Re: Updated Registration Agreement
« Reply #5 on: March 12, 2007, 02:35:58 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

Offline RoarinRow

  • Full Member
  • ***
  • Posts: 662
  • Gender: Male
  • Ride my AV!
    • Avalanche Style
Re: Updated Registration Agreement
« Reply #6 on: March 12, 2007, 03:05:29 AM »
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

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,222
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Updated Registration Agreement
« Reply #7 on: March 12, 2007, 07:40:31 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 ;).

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

Quote
I 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:
Code: [Select]
// --- 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:
Code: [Select]
// --- 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!

Offline RoarinRow

  • Full Member
  • ***
  • Posts: 662
  • Gender: Male
  • Ride my AV!
    • Avalanche Style
Re: Updated Registration Agreement
« Reply #8 on: March 12, 2007, 10:18:49 AM »
Cool, the fix worked for the index.php error   8)   Thank you.

SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

Offline qtime

  • Full Member
  • ***
  • Posts: 501
Re: Updated Registration Agreement
« Reply #9 on: March 12, 2007, 03:39:03 PM »
Great function, must be a standard option!

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,222
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Updated Registration Agreement
« Reply #10 on: March 13, 2007, 04:59:56 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!

Offline diegolyanky

  • Jr. Member
  • **
  • Posts: 329
  • Gender: Male
Re: Updated Registration Agreement
« Reply #11 on: March 13, 2007, 10:21:43 AM »
Hey man ! .... That's very usefull !!

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

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,222
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Updated Registration Agreement
« Reply #12 on: March 14, 2007, 01:07:34 AM »
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
« Last Edit: March 14, 2007, 03:56:26 AM by Daniel15 »
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!

Offline RoarinRow

  • Full Member
  • ***
  • Posts: 662
  • Gender: Male
  • Ride my AV!
    • Avalanche Style
Re: Updated Registration Agreement
« Reply #13 on: March 14, 2007, 01:52:16 AM »
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

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,222
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Updated Registration Agreement
« Reply #14 on: March 14, 2007, 03:54:30 AM »
Quote
I 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 ;)

Quote
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.
Yeah, that's the only configuration option :)

Quote
Wasn'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!

Offline RoarinRow

  • Full Member
  • ***
  • Posts: 662
  • Gender: Male
  • Ride my AV!
    • Avalanche Style
Re: Updated Registration Agreement
« Reply #15 on: March 14, 2007, 10:27:49 AM »
Quote
I 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 ;)

Quote
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.
Yeah, that's the only configuration option :)

Quote
Wasn'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

Offline Ben_S

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 11,724
  • xxx
Re: Updated Registration Agreement
« Reply #16 on: March 18, 2007, 08:21:36 PM »
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.

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,222
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Updated Registration Agreement
« Reply #17 on: March 19, 2007, 04:26:50 AM »
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!

Offline brianjw

  • SMF Hero
  • ******
  • Posts: 2,157
  • Gender: Male
Re: Updated Registration Agreement
« Reply #18 on: March 19, 2007, 02:01:29 PM »
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!!!!

Offline TrueSatan

  • SMF Hero
  • ******
  • Posts: 1,783
Re: Updated Registration Agreement
« Reply #19 on: March 19, 2007, 02:12:26 PM »
Do a manual uninstall...