2017 © Pedro Peláez
 

library vbauth

Vbulletin auth library for Laravel 4 (Illuminate)

image

pperon/vbauth

Vbulletin auth library for Laravel 4 (Illuminate)

  • Friday, February 7, 2014
  • by przemekperon
  • Repository
  • 3 Watchers
  • 9 Stars
  • 111 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 14 Versions
  • 0 % Grown

The README.md

Authentication for VBulletin users in Laravel 4. Tested with VBulletin 4.x., (*1)

Installation

Add pperon/vbauth as a requirement to composer.json:, (*2)

{
    "require": {
        "pperon/vbauth": "1.*"
    }
}

Update your packages with composer update or install with composer install., (*3)

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:, (*4)

'providers' => array(
        ...
        ...
        'Pperon\Vbauth\VbauthServiceProvider',
),

In order to use shorter class alias add it to alias sections in app/config/app.php:, (*5)

'aliases' => array(
        ...
        ...
        'Vbauth'          => 'Pperon\Vbauth\Facades\Vbauth',
),

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., (*6)

Usage

Example usage in a controller:, (*7)

if(Vbauth::isAdmin()){
    // Show administrator page
    View::make('admin.index');
} elseif (Vbauth::isLoggedin()) {
    // Show user page
    View::make('user.index');   
} else {
    // Show guest page
    View::make('guest.index');
}

Vbulletin User Variables

You may access user information directly by calling Vbauth::get('fieldname'). Fields are defined in config.php (select_columns)., (*8)

Example:, (*9)

if(Vbauth::isLoggedin()) {
    $user_id  = Vbauth::get('userid');
    $username = Vbauth::get('username');
    $email    = Vbauth::get('email');
}

isLoggedIn()

Checks for VBulletin user cookie and returns:, (*10)

TRUE - user is logged in, FALSE - there is no vbulletin cookie (user not logged in), (*11)

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., (*12)

TRUE - user belongs to admin usergroup FALSE - user doesn't belong to admin usergroup, (*13)

is()

Checks whether the user belongs to specific usergroup. Default available groups: admin, moderator, user, banned, guest. You can add more in config.php., (*14)

TRUE - user belongs to specific group, (*15)

Example:, (*16)

if(Vbauth::is('moderator')) {
    View::make('moderator.panel');
}

logoutUrl()

Returns URL to logout script in Vbulletin installation., (*17)

Example:, (*18)

Redirect::to(Vbauth::logoutURL());

getUserInfo()

Returns user data for any choosen forum user, (*19)

Example:, (*20)

$user_id = 8;
$user = Vbauth::getUserInfo($user_id);
echo $user['email']; // displays email for user with user_id = 8
echo $user['username']; // show username

Change Log

v1.1.2

Added support for separate database connection (when vbulletin forum database is located in different database than laravel):, (*21)

Set the connection in app/config/database.php and add the connection name to config/packages/pperon/vbauth/config.php:, (*22)

  'db_connection' => 'vbconn', // vbconn is the connection name in database.php

v1.0.7

Added getUserInfo() method which returns user information for any forum user, (*23)

Example:, (*24)

$user_id = 8;
$user = Vbauth::getUserInfo($user_id);
echo $user['email']; // displays email for user with user_id = 8

The Versions

07/02 2014

dev-master

9999999-dev https://github.com/przemekperon/laravel-vbauth

Vbulletin auth library for Laravel 4 (Illuminate)

  Sources   Download

MIT

The Requires

 

by Przemyslaw Peron

laravel illuminate vbulletin vb

26/11 2013

v1.1.3

1.1.3.0 https://github.com/przemyslawperon/laravel-vbauth

Vbulletin auth library for Laravel 4 (Illuminate)

  Sources   Download

MIT

The Requires

 

by Przemyslaw Peron

laravel illuminate vbulletin vb

26/11 2013

v1.1.2

1.1.2.0 https://github.com/przemyslawperon/laravel-vbauth

Vbulletin auth library for Laravel 4 (Illuminate)

  Sources   Download

MIT

The Requires

 

by Przemyslaw Peron

laravel illuminate vbulletin vb

26/11 2013

v1.1.1

1.1.1.0 https://github.com/przemyslawperon/laravel-vbauth

Vbulletin auth library for Laravel 4 (Illuminate)

  Sources   Download

MIT

The Requires

 

by Przemyslaw Peron

laravel illuminate vbulletin vb

26/11 2013

v1.1

1.1.0.0 https://github.com/przemyslawperon/laravel-vbauth

Vbulletin auth library for Laravel 4 (Illuminate)

  Sources   Download

MIT

The Requires

 

by Przemyslaw Peron

laravel illuminate vbulletin vb

15/03 2013

1.0.7.x-dev

1.0.7.9999999-dev https://github.com/przemyslawperon/laravel-vbauth

Vbulletin auth library for Laravel 4 (Illuminate)

  Sources   Download

MIT

The Requires

 

by Przemyslaw Peron

laravel illuminate vbulletin vb

15/03 2013

v1.0.7

1.0.7.0 https://github.com/przemyslawperon/laravel-vbauth

Vbulletin auth library for Laravel 4 (Illuminate)

  Sources   Download

MIT

The Requires

 

by Przemyslaw Peron

laravel illuminate vbulletin vb

12/02 2013

v1.0.6

1.0.6.0 https://github.com/przemyslawperon/laravel-vbauth

Vbulletin auth library for Laravel 4 (Illuminate)

  Sources   Download

MIT

The Requires

 

by Przemyslaw Peron

laravel illuminate vbulletin vb

12/02 2013

v1.0.5

1.0.5.0 https://github.com/przemyslawperon/laravel-vbauth

Vbulletin auth library for Laravel 4 (Illuminate)

  Sources   Download

MIT

The Requires

 

by Przemyslaw Peron

laravel illuminate vbulletin vb

10/02 2013

v1.0.4

1.0.4.0 https://github.com/przemyslawperon/laravel-vbauth

Vbulletin auth library for Laravel 4 (Illuminate)

  Sources   Download

MIT

The Requires

 

by Przemyslaw Peron

laravel illuminate vbulletin vb

10/02 2013

v1.0.3-beta

1.0.3.0-beta https://github.com/przemyslawperon/laravel-vbauth

Vbulletin auth library for Laravel 4 (Illuminate)

  Sources   Download

MIT

The Requires

 

by Przemyslaw Peron

laravel illuminate vbulletin vb

09/02 2013

1.0.2

1.0.2.0 https://github.com/przemyslawperon/laravel-vbauth

Vbulletin auth library for Laravel 4 (Illuminate)

  Sources   Download

MIT

The Requires

 

by Przemyslaw Peron

laravel illuminate vbulletin vb

09/02 2013

v1.0.1

1.0.1.0 https://github.com/przemyslawperon/laravel-vbauth

Vbulletin auth library for Laravel 4 (Illuminate)

  Sources   Download

MIT

The Requires

 

by Przemyslaw Peron

laravel illuminate vbulletin vb

08/02 2013

v1.0

1.0.0.0 https://github.com/przemyslawperon/laravel-vbauth

Vbulletin auth library for Laravel 4 (Illuminate)

  Sources   Download

MIT

The Requires

 

by Przemyslaw Peron

laravel illuminate vbulletin vb