UBB.Dev
Posted By: Lionel A very hard one for me - 04/12/2001 5:46 AM
I am using a lot of Perl programs. I would like to be able to incorporate the UBB cookie into some of them so they can be accessed by members only. So when some one tries to access them, if they are not a member, they get redirected to UBB login screen for registration.
Is this feasible? Can someone give me a pointer, please?
I started by placing all the required files with their paths. I do not know if that will be sufficient just to include the UBB login routine (don't even know what it is) or if I should dig in a book and learn to write subroutines?
Posted By: CopyCat Re: A very hard one for me - 04/12/2001 5:57 AM
i could use a help with this too. how do i know if the user is logged? if its not, how do i say this and tell him to log or register?
Posted By: Mark Badolato Re: A very hard one for me - 04/12/2001 6:14 AM
You should have a look at the CGI.pm website to see about how to use cookies.

Once you have the general concepts, you can then look at how UBB is using it's cookies, and see how access works, whats being set etc.

--mark
Posted By: CopyCat Re: A very hard one for me - 04/12/2001 6:30 AM
why dont you tell us :***
Posted By: Lionel Re: A very hard one for me - 04/12/2001 6:57 AM
Thanks Mark.

According to what I read, and comparing with login.cgi it seems to me that I would need at least half a page from ultimatebb.cgi, starting from

#use strict
use Fcntl ':flock';
use CGI::Carp qw(fatalsToBrowser carpout);
use CGI qw(:cgi-lib :standard);

all the way to:

if ($ubb eq 'login') {
&set_page_elements;
do "http://mysite.com/cgi-bin/page_I_want_to_call.cgi";
exit;
}

making sure that I replaced all those Vars with their full path.

meaning that If I place that subrouting at the beginning of the non UBB software.cgi, I'll be telling it to go to the UBB verification subroutine and if it passes, then execute the page.

Am I close?
Posted By: Mark Badolato Re: A very hard one for me - 04/12/2001 7:21 AM
Quote
quote:
Because the only way to learn is to research and read. Ever heard of "give a man a fish...."?

Wants to Learn, sounds like you're on the right track, but I cannot say for sure as I have not looked at UBB code in quite some time, so I don't know specifics about it.

--mark
Posted By: CopyCat Re: A very hard one for me - 04/12/2001 7:43 AM
you are right, i was just kidding smile
thanks for the url btw
Posted By: Mark Badolato Re: A very hard one for me - 04/12/2001 8:05 AM
smile
© UBB.Developers