Constants

BCRYPT_COST

BCRYPT_COST

blowfish cost factor

BCRYPT_TYPE

BCRYPT_TYPE

blowfish encryption type

Properties

$data

$data : array

Type

array — Contains Information about Tables to get the information

$settings

$settings : array

Type

array — Contains Bridge-specific Settings, like cookie domain etc.

$blnSyncEmail

$blnSyncEmail : boolean

Type

boolean — Set true if email adress should be synced from CMS

$dependencies

$dependencies : 

Type

$shortcuts

$shortcuts : 

Type

$singleton

$singleton : 

Type

$class_hash

$class_hash : 

Type

$name

$name : 

Type

$bridgedb

$bridgedb : object

Type

object — Database Connection to CMS

$prefix

$prefix : string

Type

string — Prefix of CMS

$_shorts

$_shorts : 

Type

$_shorts_loaded

$_shorts_loaded : 

Type

$_class_index

$_class_index : 

Type

$blowfishCharacters

$blowfishCharacters : string

concated list of valid blowfish salt characters

Type

string

$supportedEncryptionTypes

$supportedEncryptionTypes : \array<string>

list of supported encryption type by software identifier

Type

\array

Methods

__construct()

__construct(object  $objBridgeDB, string  $strPrefix) 

Constructor

Parameters

object $objBridgeDB
string $strPrefix

check_password()

check_password(string  $password, string  $hash, string  $strSalt = '', boolean  $boolUseHash = false, string  $strUsername = "",   $arrUserdata = array()) : boolean

Check if Password matches with saved Hash

Parameters

string $password

Password

string $hash

Saved Passwordhash

string $strSalt

Saved Salt

boolean $boolUseHash

if $password is a hash or not

string $strUsername

Username

$arrUserdata

Returns

boolean —

true if password matches

sync_fields()

sync_fields() : array

Returns Array with fields that are available to sync Key = fieldid of CMS Value = Name of Field

Returns

array —

Available Fields for Synching

sync()

sync(array  $arrUserdata) : \boolean/array

Returns Array with synched Userdata.

Please return all data, the Bridge Class handles the matching to the profilefields. If you want to sync birthday and country, add key "birthday" and "country" Key = fieldid of CMS Value = fieldvalue

Parameters

array $arrUserdata

Userdata of CMS

Returns

\boolean/array —

Return false if sync is disabled, otherwise return array with synced data

autologin()

autologin(  $arrCookieData) : \boolean/array

Autologin. Log User into EQdkp Using Session Information from CMS

Parameters

$arrCookieData

Returns

\boolean/array —

Return false if autologin failed, otherwise array with EQdkp Userdata

logout()

logout() : boolean

Logout. Should be used to Logout User from CMS

Returns

boolean

before_login()

before_login(string  $strUsername, string  $strPassword, boolean  $boolSetAutologin = false, boolean  $boolUseHash = false) 

Fired before login. No return value, no influence to login.

Parameters

string $strUsername
string $strPassword
boolean $boolSetAutologin
boolean $boolUseHash

after_login()

after_login(string  $strUsername, string  $strPassword, boolean  $boolSetAutoLogin, array  $arrUserdata, boolean  $boolLoginResult, string  $boolUseHash = false) : boolean

Do some checks after User Passwordchecks.

Returning false prevents user from being logged into EQdkp.

Parameters

string $strUsername
string $strPassword
boolean $boolSetAutoLogin
array $arrUserdata
boolean $boolLoginResult
string $boolUseHash

Returns

boolean —

True if user should be logged in, false if not

login()

login(string  $strUsername, string  $strPassword, boolean  $boolSetAutologin = false, boolean  $boolUseHash = false) : boolean

Login method. Should only be overwritten if default login of Bridge is not enough for you.

Parameters

string $strUsername
string $strPassword
boolean $boolSetAutologin
boolean $boolUseHash

Returns

boolean —

Return 0 is default login should be used. Otherwise return a boolean for the login status.

__get()

__get(  $name) 

Parameters

$name

__isset()

__isset(  $name) 

Parameters

$name

__dependencies()

__dependencies() 

__shortcuts()

__shortcuts() 

__destruct()

__destruct() 

get_groups()

get_groups(  $blnWithID) 

Parameters

$blnWithID

isSupported()

isSupported(string  $type) : boolean

Returns true if given encryption type is supported.

Parameters

string $type

Returns

boolean

isBlowfish()

isBlowfish(string  $hash) : boolean

Returns true if given hash looks like a valid bcrypt hash.

Parameters

string $hash

Returns

boolean

isDifferentBlowfish()

isDifferentBlowfish(string  $hash) : boolean

Returns true if given bcrypt hash uses a different cost factor and should be re-computed.

Parameters

string $hash

Returns

boolean

checkPassword()

checkPassword(string  $username, string  $password, string  $dbHash) : boolean

Validates password against stored hash, encryption type is automatically resolved.

Parameters

string $username
string $password
string $dbHash

Returns

boolean

detectEncryption()

detectEncryption(string  $hash) : string

Returns encryption type if possible.

Parameters

string $hash

Returns

string

getDoubleSaltedHash()

getDoubleSaltedHash(string  $password, string  $salt = null) : string

Returns a double salted bcrypt hash.

Parameters

string $password
string $salt

Returns

string

getSaltedHash()

getSaltedHash(string  $password, string  $salt = null) : string

Returns a simple salted bcrypt hash.

Parameters

string $password
string $salt

Returns

string

getRandomSalt()

getRandomSalt() : string

Returns a random blowfish-compatible salt.

Returns

string

getRandomPassword()

getRandomPassword(integer  $length = 8) : string

Generates a random user password with the given character length.

Parameters

integer $length

Returns

string

getRandomValue()

getRandomValue(integer  $min = null, integer  $max = null) : integer

Generates a random value.

Parameters

integer $min
integer $max

Returns

integer

secureCompare()

secureCompare(string  $hash1, string  $hash2) : boolean

Compares two password hashes. This function is protected against timing attacks.

Parameters

string $hash1
string $hash2

Returns

boolean

getSalt()

getSalt(string  $salt) : string

Returns a blowfish salt, e.g. $2a$07$usesomesillystringforsalt$

Parameters

string $salt

Returns

string

ipb2()

ipb2(string  $username, string  $password, string  $salt, string  $dbHash) : boolean

Validates the password hash for Invision Power Board 2.x (ipb2).

Parameters

string $username
string $password
string $salt
string $dbHash

Returns

boolean

ipb3()

ipb3(string  $username, string  $password, string  $salt, string  $dbHash) : boolean

Validates the password hash for Invision Power Board 3.x (ipb3).

Parameters

string $username
string $password
string $salt
string $dbHash

Returns

boolean

mybb1()

mybb1(string  $username, string  $password, string  $salt, string  $dbHash) : boolean

Validates the password hash for MyBB 1.x (mybb1).

Parameters

string $username
string $password
string $salt
string $dbHash

Returns

boolean

smf1()

smf1(string  $username, string  $password, string  $salt, string  $dbHash) : boolean

Validates the password hash for Simple Machines Forums 1.x (smf1).

Parameters

string $username
string $password
string $salt
string $dbHash

Returns

boolean

smf2()

smf2(string  $username, string  $password, string  $salt, string  $dbHash) : boolean

Validates the password hash for Simple Machines Forums 2.x (smf2).

Parameters

string $username
string $password
string $salt
string $dbHash

Returns

boolean

vb3()

vb3(string  $username, string  $password, string  $salt, string  $dbHash) : boolean

Validates the password hash for vBulletin 3 (vb3).

Parameters

string $username
string $password
string $salt
string $dbHash

Returns

boolean

vb4()

vb4(string  $username, string  $password, string  $salt, string  $dbHash) : boolean

Validates the password hash for vBulletin 4 (vb4).

Parameters

string $username
string $password
string $salt
string $dbHash

Returns

boolean

vb5()

vb5(string  $username, string  $password, string  $salt, string  $dbHash) : boolean

Validates the password hash for vBulletin 5 (vb5).

Parameters

string $username
string $password
string $salt
string $dbHash

Returns

boolean

wbb2()

wbb2(string  $username, string  $password, string  $salt, string  $dbHash) : boolean

Validates the password hash for WoltLab Burning Board 2 (wbb2).

Parameters

string $username
string $password
string $salt
string $dbHash

Returns

boolean

wcf1()

wcf1(string  $username, string  $password, string  $salt, string  $dbHash) : boolean

Validates the password hash for WoltLab Community Framework 1.x (wcf1).

Parameters

string $username
string $password
string $salt
string $dbHash

Returns

boolean

wcf2()

wcf2(string  $username, string  $password, string  $salt, string  $dbHash) : boolean

Validates the password hash for WoltLab Community Framework 2.x (wcf2).

Parameters

string $username
string $password
string $salt
string $dbHash

Returns

boolean

xf1()

xf1(string  $username, string  $password, string  $salt, string  $dbHash) : boolean

Validates the password hash for XenForo 1.x with (xf1).

Parameters

string $username
string $password
string $salt
string $dbHash

Returns

boolean

sso()

sso(  $arrUserdata,   $boolAutoLogin,   $strPassword) 

Parameters

$arrUserdata
$boolAutoLogin
$strPassword

__checkPassword()

__checkPassword(  $username,   $password,   $hash) 

Parameters

$username
$password
$hash

getIpAddress()

getIpAddress() : string

Returns the ipv6 address of the client.

Returns

string

convertIPv4To6()

convertIPv4To6(string  $ip) : string

Converts given ipv4 to ipv6.

Parameters

string $ip

Returns

string