Utility Functions
$this->bitauth->activate($activation_code)
This will activate a user based on the activation_code generated by add_user() if $require_activation is TRUE.
$this->bitauth->set_password($user_id, $new_password)
This will hash the plain text password passed to $new_password, and update the user along with the value for password_last_set.
$this->bitauth->get_role($slug)
This will return the bit offset for a role based on the slug that is passed. This is a utility function used internally in BitAuth.
$this->bitauth->get_roles()
This returns an array of all roles defined in the configuration. The array is exactly as it's defined, in the format:
array( 'slug' => 'description' );
$this->bitauth->set_login_field($field)
Declares a field that must be matched on login. There is no processing done before or after this check, an exact match is required. So, for example, if you want a case-insensitive match, you should run strtolower() on the data before it's stored in the database, and also on the form data before it's checked.
More on this method can be found in Logging In/Logging Out.
$this->bitauth->check_login_fields($user, $data)
This is a utility function called by login() which checks any fields
$this->bitauth->set_error($str, $update_session = TRUE)
Stores an error message in BitAuth. Currently, BitAuth only stores one message at a time. By default, this message will be saved to the session, you can disable this by passing FALSE as the second parameter.
$this->bitauth->get_error($incl_delim = TRUE)
Retrieves the message stored by $this->bitauth->set_error(). The message is wrapped with $_error_delim_prefix and $_error_delim_suffix, unless passed FALSE as a parameter.
$this->bitauth->set_error_delimiters($prefix, $suffix)
Set the prefix and suffix error delimiters.
$this->bitauth->locked_out()
Returns TRUE if the current IP is locked out
$this->bitauth->log_attempt($user_id, $success = FALSE)
Logs a login attempt.
$this->bitauth->hash_password($str)
This function will hash the string it is given. This is a utility function used internally by BitAuth.
$this->bitauth->generate_code()
Generates a random sha1 hash used for things like activation, forgot password, etc. Length of the string returned is 40 characters.
$this->bitauth->complexity_requirements($separator = '<br/>')
This function returns a string explaining the complexity requirements you have defined in your configuration. Called by the bitauth_valid_password form_validation rule.