Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin

Quote Reply
Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin In reply to
Find the auth_get_user sub and replace it with the code below - the plugin on our site is modified a lot more than this but I've extracted just the part you need to get the vBulletin ID added to the User table.

Code:
sub auth_get_user {
# -------------------------------------------------------------------
# This function returns a user with Links SQL info. You should modify
# this code if you also want access to the vBulletin information.
#
my $args = shift;
GT::Plugins->action(STOP); # Make sure we don't run the main code.

my $user_db = $DB->table('Users');
my $user = $user_db->get($args->{Username});
if (! $user) {
$user->{Username} = $args->{Username};
$user->{Password} = ' ';
my $sth = $AUTH_DBH->prepare('SELECT email FROM ' . $VB_CFG->{tableprefix} . 'user WHERE username = ?');
$sth->execute($args->{Username});

my ($email) = $sth->fetchrow_array;
my $sth = $AUTH_DBH->prepare('SELECT userid FROM ' . $VB_CFG->{tableprefix} . 'user WHERE username = ?');
$sth->execute($args->{Username});

my ($id) = $sth->fetchrow_array;

$user->{vbID} = $id;
$user->{Email} = $email;
$user->{Name} = '';
$user->{ReceiveMail} = 'No';
$user->{Status} = 'Registered';

my $defaults = $user_db->default();
foreach (keys %$defaults) {
$user->{$_} = $defaults->{$_} unless (exists $user->{$_});
}
$user_db->insert($user) or Links::fatal("Unable to auto-create user: $args->{Username}. Reason: $GT::SQL::error");
}
return $user;
}

You will also need to add a new INT field to the User table, call it vbID and it should work fine.
Subject Author Views Date
Thread Need help with plugin (starting with SSI) - Auth_vBulletin V.E.C.T.O.R. 16702 May 12, 2009, 9:33 PM
Thread Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
V.E.C.T.O.R. 16473 May 15, 2009, 4:47 PM
Thread Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
VishalT 16448 May 15, 2009, 6:54 PM
Thread Re: [SWDevil.Com] Need help with plugin (starting with SSI) - Auth_vBulletin
V.E.C.T.O.R. 16442 May 15, 2009, 9:04 PM
Thread Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
VishalT 16462 May 15, 2009, 9:43 PM
Thread Re: [SWDevil.Com] Need help with plugin (starting with SSI) - Auth_vBulletin
V.E.C.T.O.R. 16423 May 16, 2009, 11:16 AM
Thread Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
VishalT 16469 May 16, 2009, 12:15 PM
Thread Re: [SWDevil.Com] Need help with plugin (starting with SSI) - Auth_vBulletin
V.E.C.T.O.R. 16455 May 17, 2009, 4:43 AM
Thread Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
V.E.C.T.O.R. 16413 May 23, 2009, 8:24 PM
Thread Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
V.E.C.T.O.R. 16391 May 23, 2009, 11:06 PM
Thread Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
V.E.C.T.O.R. 16377 May 23, 2009, 11:17 PM
Thread Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
V.E.C.T.O.R. 16375 May 23, 2009, 11:38 PM
Thread Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
V.E.C.T.O.R. 16374 May 24, 2009, 12:18 AM
Thread Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
V.E.C.T.O.R. 16366 May 24, 2009, 2:16 AM
Thread Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
V.E.C.T.O.R. 16338 May 24, 2009, 2:36 PM
Thread Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
aus_dave 16408 May 25, 2009, 6:12 PM
Thread Re: [aus_dave] Need help with plugin (starting with SSI) - Auth_vBulletin
V.E.C.T.O.R. 16347 May 25, 2009, 6:43 PM
Thread Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
aus_dave 16336 May 25, 2009, 7:01 PM
Thread Re: [aus_dave] Need help with plugin (starting with SSI) - Auth_vBulletin
V.E.C.T.O.R. 16298 May 25, 2009, 7:21 PM
Thread Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
V.E.C.T.O.R. 16311 May 26, 2009, 9:38 AM
Thread Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
V.E.C.T.O.R. 16289 May 26, 2009, 12:42 PM
Thread Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
V.E.C.T.O.R. 16257 May 26, 2009, 1:23 PM
Thread Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
V.E.C.T.O.R. 16237 May 26, 2009, 1:51 PM
Thread Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
V.E.C.T.O.R. 16214 May 26, 2009, 8:24 PM
Post Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
V.E.C.T.O.R. 16238 May 26, 2009, 9:17 PM
Thread Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
V.E.C.T.O.R. 2442 May 26, 2009, 11:19 PM
Post Re: [V.E.C.T.O.R.] Need help with plugin (starting with SSI) - Auth_vBulletin
aus_dave 2406 May 27, 2009, 3:27 AM