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