Skip to content
Keramat Jokar edited this page May 13, 2024 · 1 revision

How to access the user object

$this->user->method();

cookieLogIn()

[Int] setUserDetails($username, $sha_pass_hash)

When they log in this should be called to set all the user details.

String $username

String $sha_pass_hash

[String hashed password] createHash([$username, $password])

Creates a hash of the password we enter

(Optional) String $username

(Optional) String $password plain text

is_logged_in()

is_not_logged_in()

isOnline()

[Boolean] requireRank($requiredRank [, $die])

Check if the user has permission to do a certain task

Int $requiredRank ID column

(Optional) Boolean $die

[Boolean] isStaff([$id])

Check if the user rank has any staff permissions

(Optional) $id

[Boolean] isGm()

[Boolean] isDev()

[Boolean] isAdmin()

[Boolean] isOwner()

[Int] getRank([$userId])

Get the CMS user rank (ranks table)

(Optional) Int $userId

getUserData()

[String] getUserGroup()

Get the user group name

[String] getAccountStatus([$id])

Check if the account is banned or active

(Optional) $id

[String] getNickname([$id])

Get the nickname

(Optional) Int $id

[String] getAvatar([$id, $size])

Get the user's avatar

(Optional) Int $id

(Optional) String $size

[Array] getCharacters($userId [, $realmId])

get the user it's characters, returns array with realmnames and character names and character id when specified realm is -1 or the default

int $userId

(Optional) int $realmId

getId([$username])

(Optional) $username

getUsername([$id])

(Optional) $id

getPassword()

getEmail()

getExpansion()

getOnline()

getRegisterDate()

getVp()

getDp()

getLastIP()

setUsername($newUsername)

$newUsername

setPassword($newPassword)

$newPassword

setEmail($newEmail)

$newEmail

setExpansion($newExpansion)

$newExpansion

setRank($newRank)

$newRank

setVp($newVp)

$newVp

setDp($newDp)

$newDp