Auth_model.php

The functions that have been created in Auth_model you can use them in any module, controller, model or view using the following syntax $this->fxauth->function();

Available functions:

Check if you are connected:

$this->fxauth->isLogged();
  • This function doesn't require a parameter.
  • Returns true or false

Get Rol from an account:

$this->fxauth->getRol($id);
  • The ID is optional. if you leave the change empty it will take your ID (Requires being connected to take your ID)

Check if the user have rank "Guest" on the website:

$this->fxauth->isGuest($id);
  • The ID is optional. if you leave the change empty it will take your ID (Requires being connected to take your ID)
  • Returns true or false

Check if the user have rank "Administrator" on the website:

$this->fxauth->isAdmin($id);
  • The ID is optional. if you leave the change empty it will take your ID (Requires being connected to take your ID)
  • Returns true or false

Check if the user have rank "Moderator" on the website:

$this->fxauth->isModerator($id);
  • The ID is optional. if you leave the change empty it will take your ID (Requires being connected to take your ID)
  • Returns true or false

Check if the user have rank "Administrator" on the server:

$this->fxauth->isGM($id);
  • The ID is optional. if you leave the change empty it will take your ID (Requires being connected to take your ID)
  • If exist a record this will return the gmlevel or if the record doesn't exist this will return 0

Get any data from the "account" table of your server from a specific account:

$this->fxauth->getAccountByID($id);
  • The ID is optional. if you leave the change empty it will take your ID (Requires being connected to take your ID)

If a record exists, it returns an array to use row ('table'); for example:

$this->fxauth->getAccountByID($id)->row('username');
$this->fxauth->getAccountByID($id)->row('email');
  • If the record doesn't exist it return false

Get the ID of an account using the username:

$this->fxauth->getIDByUsername($username);
  • The username is optional. if you leave the change empty it will take the username from you (Requires being connected to take your Username)
  • If exist a record this will return the id of corresponding account or if the record doesn't exist this will return false

Get the ID of an account by email:

> $this->fxauth->getIDByEmail($email);
  • The email is optional. if you leave the change empty it will take the email from you (Requires being connected to take your Email)
  • If exist a record this will return the id of corresponding account or if the record doesn't exist this will return false

Check if an account is Ban on your server:

$this->fxauth->isBanned($id);
  • The ID is optional. if you leave the change empty it will take your ID (Requires being connected to take your ID)
  • If the account is suspended returns true or If the account is not suspended returns false