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!