Previous Thread
Next Thread
Print Thread
Hop To
Anonymous
Unregistered
Anonymous
Unregistered
Below is the HTML form code in UBB 6.0 which sends login data to the ultimatebb.cgi. I am testing it to figure out why it goes to the main ultimatebb.cgi page, even if I change the URL in the hidden input field named "refer". Can anyone tell me what this field is for? Shouldn't it be for the page to go to, after a user logs on?

Code
<FORM ACTION="ultimatebb.cgi" METHOD="POST">
<INPUT TYPE="HIDDEN" NAME="ubb" VALUE="do_login">
<INPUT TYPE="HIDDEN" NAME="refer" VALUE="ultimatebb.cgi?ubb=my_profile">

Login Name:
<INPUT TYPE="TEXT" NAME="username" SIZE="30" MAXLENGTH="40">

Password:
<INPUT TYPE="PASSWORD" NAME="password" SIZE="25" MAXLENGTH="30">
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="Login">
</FORM>
Thanks for your help.

David Longhurst
[]http://www.bowlingfans.com/ubb/icons/icon911.gif[/] www.goodworks.net

Anonymous
Unregistered
Anonymous
Unregistered
I think that's the page the user tried to access before being presented with the login screen.

Anonymous
Unregistered
Anonymous
Unregistered
The reference is checked inside - if they came from outside, they're redirected to the UBB frontpage. Designed behavior.

--
Charles Capps
Programmer, Infopop Corporation
Please do not contact me privately for support - post on the board or open a support ticket instead!

Anonymous
Unregistered
Anonymous
Unregistered
I suppose this topic can be moved to wherever the hacks should go, but I don't see it listed.

I hope you can help me, as PERL is still mysterious to me.

If I use this HTML login code to allow users to logging from anywhere on the web site and be returned to the page they logged on from, outside of UBB, I could hard-code the page's URL into the "refer" value, so what would I need to do to the PERL code?

Below is the code from the "ultimatebb.cgi" script, if it is helpful to view:


Code
 # perform user login?
if ($ubb eq 'do_login') {
	GetOrPost("POST")
	my $ip_number = $ENV{'REMOTE_ADDR'};
	check_ip_bans($ip_number)

	$skip_cookie_check = 'true';

	RequireCode("$vars_config{CGIPath}/ubb_lib_2.cgi")

	my @user_info = verify_id("$in{username}", "$in{password}")
	my $pubname   = $user_info[0];
	my $dp        = $user_info[1];
	my $profile_number = $user_info[2];
	my $mod_q          = $user_info[3];
	chomp(my $writeadmin     = (OpenProfile($profile_number))[4])
	chomp(my $this_un     = (OpenProfile($profile_number))[0])
	chomp(my $this_pw     = (OpenProfile($profile_number))[1])

	chomp($mod_q);

	#6.1.0 - now forbidding login without queue approval
	if ($mod_q eq 'Q') {

		# user is registered but not approved!
		print header(
			-charset => "$masterCharset",
			-type    => "text/html",
		);
		StandardHTML("$vars_wordlets_err{awaiting_approval}")
		exit(0);
	}

	if ($writeadmin !~ /Write/) {

		#user has no write permissions -> can't login
		print header(
			-charset => "$masterCharset",
			-type    => "text/html",
		);
		StandardHTML("$vars_wordlets_err{user_not_approved}")
		exit(0);
	}

	if ($dp eq '') { $dp = "$vars_display{DaysPruneDefault}"; }

	my $cookie = cookie(
		-name    => "ubber$vars_config{Cookie_Number}",
		-value   => [$this_un, $this_pw, $pubname, $dp, $profile_number],
		-path    => '/',
		-expires => '+2y'
	);
	$username = $in{username};

	#print header(-cookie=>[$cookie]);
	print header(
		-cookie  => [$cookie],
		-charset => "$masterCharset"
	);

	# display refer page
	my $clean_cgi = quotemeta($vars_config{CGIURL});
	if (($in{refer} ne '') && ($in{refer} !~ /logoff$/) && ($in{refer} !~ /cookies$/) && ($in{refer} !~ /find_lost$/) && ($in{refer} !~ /password$/) && ($in{refer} =~ /^$clean_cgi/)) {

		# take viewer back to topic
		set_page_elements
		Transition("$in{refer}", "$vars_wordlets{thanks_for_login}", "$in{refer}")
		exit(0);
	} else {
		$ubb = '';
	}
}    # end do login
 
The idea of registering and/or logging in from any page would be a nice feature to allow integration with a web site.

David Longhurst
[]http://www.bowlingfans.com/ubb/icons/icon911.gif[/] www.goodworks.net

Anonymous
Unregistered
Anonymous
Unregistered
Actually, we direct all hacking to ubbdev.com. It was a little hypocritical of us to say we don't support hacked boards, yet have hacking forums ourselves.. <img src="https://www.ubbcentral.com/boards/images/graemlins/wink.gif" alt="" />

--
Charles Capps
Programmer, Infopop Corporation
Please do not contact me privately for support - post on the board or open a support ticket instead!

Anonymous
Unregistered
Anonymous
Unregistered
Thanks Charles, I posted the question on UBBDev's Support Board to continue the help. I see that you moderate that board too.

David Longhurst
[]http://www.bowlingfans.com/ubb/icons/icon911.gif[/] www.goodworks.net


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Selling a Forum?
by ECNet - 10/10/2026 10:54 AM
PHP 8 bug in membermanage.tmpl
by phoenix011235 - 09/08/2026 7:47 PM
Who's Online Now
0 members (), 298 guests, and 124 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Ride safe!
Ride safe!
by Morgan, December 7
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260527)