Gossamer Forum
Home : Products : DBMan : Customization :

MOD: Disclaimer Agreement Page Before Signup

Quote Reply
MOD: Disclaimer Agreement Page Before Signup
Here is one of the MODs JPDeni said people asked for that she was going to write. If you allow signups, it will first go to a Disclaimer page where they have to click Accept to get to the signup page. This is based on the original html.pl file, not the user friendly one. Just change the HTML code to suit your look. My subroutines in my html.pl look nothing like the ones below because I have hacked the hell out of mine to get the look I wanted. You can see it in action at http://www.thefew.com/...bin/guestbook/db.cgi. If you click on "Create Account" you will get the disclaimer page. If you click accept, it brings you to the signup form. Cancel brings you back to the main menu. This MOD is pretty simple and straight forward. Any questions or problems please post them here. I had to use the QUOTE markup tag because the CODE tag didn't work. JPD - please e-mail the markup tag to show code properly.

In Reply To:
In db.cfg
ADD these variables somewhere:

# Suspend Registrations (true) or (false)
$SuspendRegister = qq(false);

# Registration Agreement
$DBRules = qq(Agreement here. Use \ for special characters like \@ \( and others. You can use <P> and <BR> for spacing.);

-------End db.cfg changes--------

In db.cgi
In sub main
AFTER:
elsif ((keys(%in) == 2) || ($in{'login'})) { &html_home; }
ADD:
elsif ($auth_signup and $in{'signup_noagree'}) { &html_home; }

AFTER:
elsif ($auth_signup and $in{'signup_form'}) { &html_signup_form; }
Add:
elsif ($auth_signup and $in{'signup_agree'}) { &html_signup_form2; }

-------End db.cgi changes--------

In html.pl:

----RENAME 'sub html_signup_form' TO 'sub html_signup_form2'

In 'sub html_signup_form2'
----Just BEFORE:
my $error = shift;

----ADD:
if ($SuspendRegister eq "true") {
&html_unauth("We are not accepting new registrations at this time.");
exit;
}

----SEARCH for all &html_signup_form subroutine calls in db.cgi and change them to &html_signup_form2 (there should be 2 calls in 'sub signup')


----ADD new subroutine BEFORE 'sub html_signup_form2':

sub html_signup_form {
# This is the disclaimer form that is displayed before new users create an account.
#
if ($SuspendRegister eq "true") {
&html_unauth("We are not accepting new registrations at this time.");
exit;
}

my $error = shift;

&html_print_headers;
print qq|
<html>
<head>
<title>$html_title: Disclaimer Agreement.</title>
</head>
<body bgcolor="#DDDDDD" text="#000000">
<center>
<table border=1 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width=500 align=center valign=top>
<tr><td colspan=2 bgcolor="navy">
<FONT FACE="MS Sans Serif, arial,helvetica" size=1 COLOR="#FFFFFF">
<b>$html_title: Disclaimer Agreement</b>
</td></tr>
<tr><td>
<p><center><$font_title>
<b>Disclaimer Agreement</b></font></center>

<$font>$DBRules<P>
<form action="$db_script_url" method="POST">
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$session_id">
<input type="submit" name="signup_agree" value="Agree"></form>
<form action="$db_script_url" method="POST">
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$session_id">
<input type="submit" name="signup_noagree" value="Cancel"></form></center>
</td></tr>
</table>
</center>
</form>
</body>
</html>
|;
}

REPLACE 'sub html_unauth' with this subroutine:

sub html_unauth {
# --------------
# A user tried to do something he was not authorized for.

my $error = shift;

if (!$error) {
$error = qq|The database program received a command that you are not authorized for!
<P>Please <a href="$admin_email">e-mail</a> us if this is a persistent problem.|;
}

&html_print_headers;
print qq|
<html>
<head>
<title>$html_title: Error! Unauthorized Action.</title>
</head>

<body bgcolor="#DDDDDD">
<center>
<table border=1 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width=500 align=center valign=top>
<tr><td colspan=2 bgcolor="navy">
<FONT FACE="MS Sans Serif, arial,helvetica" size=1 COLOR="#FFFFFF">
<b>$html_title: Error! Unauthorized Action.</b>
</td></tr>
<tr><td>
<p><center><$font_title><b>
Error: <font color=red>Unauthorized Action</font>
</b></font></center>

<$font>
$error
</font>
</p>
|; &html_footer; print qq|
</td></tr>
</table>
</center>
</body>
</html>
|;
}
Enjoy!

AJ
Webmaster, TheFew.com
http://www.thefew.com
Semper Fi, Do or Die!
Quote Reply
Re: MOD: Disclaimer Agreement Page Before Signup In reply to
The markup tag for using codes is
Code:
....
(without spaces, of course.)

Thanks much for this, although I'm not sure about something. Where is sub html_signup_form2?

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: MOD: Disclaimer Agreement Page Before Signup In reply to
You have to rename sub html_signup_form to sub html_signup_form2. Then you add the new sub html_signup_form shown above. The new sub html_signup_form is the one that has the agreement and if you hit Agree it goes to the sub html_signup_form2


AJ
Webmaster, TheFew.com
http://www.thefew.com
Semper Fi, Do or Die!
Quote Reply
Re: MOD: Disclaimer Agreement Page Before Signup In reply to
Actually, I figured that out, but I know that some folks would be confused, so I wanted to get it out there from the start. Smile

Very nice work!!!!!!

JPD
http://www.jpdeni.com/dbman/