Download the PHP package pperon/vbauth without Composer
On this page you can find all versions of the php package pperon/vbauth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pperon/vbauth
More information about pperon/vbauth
Files in pperon/vbauth
Package vbauth
Short Description Vbulletin auth library for Laravel 4 (Illuminate)
License MIT
Homepage https://github.com/przemyslawperon/laravel-vbauth
Informations about the package vbauth
Authentication for VBulletin users in Laravel 4. Tested with VBulletin 4.x.
Installation
Add pperon/vbauth
as a requirement to composer.json:
Update your packages with composer update
or install with composer install
.
Once Composer has installed or updated your packages you need to register Vbauth with Laravel itself. Open app/config/app.php and find the providers key towards the bottom and add:
In order to use shorter class alias add it to alias sections in app/config/app.php:
Configuration
Default configuration file is located in vendor/pperon/vbauth/src/config/config.php but you should overwrite it with app/config/packages/pperon/vbauth/config.php
file.
Usage
Example usage in a controller:
Vbulletin User Variables
You may access user information directly by calling Vbauth::get('fieldname'). Fields are defined in config.php (select_columns).
Example:
isLoggedIn()
Checks for VBulletin user cookie and returns:
TRUE - user is logged in, FALSE - there is no vbulletin cookie (user not logged in)
isAdmin()
Checks whether the user belongs to Admin usergroup. Usually this means the user belongs to usergroup with id = 6 but you can modify this in config.php file by changing admin group ids.
TRUE - user belongs to admin usergroup FALSE - user doesn't belong to admin usergroup
is()
Checks whether the user belongs to specific usergroup. Default available groups: admin, moderator, user, banned, guest
. You can add more in config.php.
TRUE - user belongs to specific group
Example:
logoutUrl()
Returns URL to logout script in Vbulletin installation.
Example:
getUserInfo()
Returns user data for any choosen forum user
Example:
Change Log
v1.1.2
Added support for separate database connection (when vbulletin forum database is located in different database than laravel):
Set the connection in app/config/database.php and add the connection name to config/packages/pperon/vbauth/config.php:
v1.0.7
Added getUserInfo()
method which returns user information for any forum user
Example: