Page Index Toggle Pages: 1
Topic Tools
Normal Topic Sharing YaBB cookies/accounts (Read 2,841 times)
JonB
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,789
Location: Land of the Blazing Sun!

YaBB 2.6.0
Re: Sharing YaBB cookies/accounts
Reply #3 - Sep 20th, 2011 at 1:58pm
Post Tools
Off-Topic replies have been moved to this Topic.
  

I find your lack of faith disturbing.
Back to top
IP Logged
 
PiscesPhil
YaBB Newcomer
*
Offline



Posts: 21
Re: Sharing YaBB cookies/accounts
Reply #2 - Jun 3rd, 2011 at 12:55pm
Post Tools
Maybe a bit of a thread ressurection but here is some code to get the YaBB username from the cookie:

Code (Perl)
Select All
        my @cookies;
        my %crumbs;
        my $httpCookie = $ENV{'HTTP_COOKIE'};

        # Read in any cookie information stored on the user's computer.
        if( $httpCookie )
        {
                @cookies = split( /;/, $httpCookie );
                my $cookie;
                my $name;
                my $value;

                foreach $cookie( @cookies )
                {
                        ( $name, $value ) = split( /=/, $cookie );
                        $crumbs{ $name } = $value;
                }
        }

        my $yabbusername = 'Guest';
        my $yabbcookiename = 'Y2User-12345';

        if( $crumbs{$yabbcookiename} )
        {
                $yabbusername = $crumbs{$yabbcookiename};
        }

        return $yabbusername; 

  
Back to top
 
IP Logged
 
Captain John
Ex Member


Re: Sharing YaBB cookies/accounts
Reply #1 - Nov 25th, 2010 at 1:21am
Post Tools
You can call (html) pages directly from the YaBB tab menu.
http://www.yabbforum.com/codex/YaBB.pl?num=1290615231

or add a login to a main page - see the YaBB Codex http://www.yabbforum.com/codex/YaBB.pl?num=1208187977
  
Back to top
 
IP Logged
 
KHare
YaBB Newcomer
*
Offline



Posts: 1

YaBB 2.6.0
Sharing YaBB cookies/accounts
Nov 24th, 2010 at 7:38pm
Post Tools
I use YaBB as the site for an online game I run.  As part of the game I have other functions, totally unrelated to YaBB that I want put on my site.

What I'd like to do is use the YaBB accounts and cookies for those pages too.  This way, there is only one login for users to deal with and they can use YaBB to change passwords.  Why rebuild it when YaBB already works?

So what I need is a perl script that checks the user's cookies from Yabb and if they are good, lets me call my code to create the HTML page but if the cookies aren't good it sends them to the YaBB forum page to login.  I will put a button at the top of my forum to go back to my pages so that part isn't a problem.

Something like:

Code
Select All
#!/bin/perl -w

<include YaBB files>

if logged into YaBB
    call custom page code
else
    redirect to YaBB.pl
endif
 




Anybody already built such a thing?  Anybody who knows the 'API' well enough to just type this up?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Topic Tools
 
  « Board Index ‹ Board  ^Top