<commit_before>.TH PHPUSERLITE 7 2012-12-03 "Copyright <NAME>" "PHP Programmer's Manual"
.SH NAME
phpuserlite \- provides oo user functionality to php
.\" +------------------+
.\" | CONTENTS SECTION |
.\" +------------------+
.SH CONTENTS
This documentation is divided into a number of sections, each
providing detailed information about an aspect of
.IR phpuserlite .
.br
Sections in this manual are:
.in +2n
.B INTRODUCTION
.br
.B CONFIGURATION
.br
.B STATIC METHODS
.br
.B INSTANCE METHODS
.br
.B EXCEPTIONS
.br
.\".B NOTES
.\".br
.B BUGS
.br
.\".B EXAMPLE
.\".br
.\".B SEE ALSO
.\".br
.\".B COLOPHON
.\" +----------------------+
.\" | INTRODUCTION SECTION |
.\" +----------------------+
.SH INTRODUCTION
.I phpuserlite
is a PHP module designed to provide the basis for websites
requiring a user login & management system, using an
.I SQLite
database throughout to store its data, and with a focus on
security
.\" +-----------------------+
.\" | CONFIGURATION SECTION |
.\" +-----------------------+
.SH CONFIGURATION
.I phpuserlite
can be configured using 'ini style' config files containing
.IR key = value
pairs for the parameters you wish to change. You can load a
specific config file using
.BR loadConfig (),
which you must call before any other methods (including
.BR setupDB ())
or config will be loaded from the file specified by the
.B DEFAULT_CONFIG_FILE
constant. Following is a complete list of the configuration
parameters available to you
.\" const User::db_path
.SS db_path
You should set this parameter to the path of the
.I SQLite
database file you want
.I phpuserlite
to use. Non-absolute paths will be treated as being relative
to the directory that
.I User.php
is in. The default value is
.I phpuserlite.db
.\" const User::salt_length
.SS salt_length
This is the number of bytes of random data used to salt data
that is hashed by
.IR phpuserlite .
The default value is
.IR 16 ,
which should be sufficient, so you probably do not need to alter
this
.\" const User::session_key_length
.SS session_key_length
This is the number of bytes of random data that is used to
generate the session keys used in login cookies. The default
value is
.IR 32 ,
which should be sufficient, so you probably do not need to
alter this
.\" const User::confirm_code_length
.SS confirm_code_length
This is the number of bytes of random data that is used to
generate the confirmation codes sent to users to confirm
registration and change of email. The default value is
.IR 16 ,
which should be sufficient, so you probably do not need to
alter this
.\" const User::hash_algorithm
.SS hash_algorithm
This is the hashing algorithm that
.I phpuserlite
uses throughout, with the exception of
.BR generateConfirmCode (),
which uses
.I sha1
for brevity. The default value is
.IR sha512 ,
but if you wish to use another hashing algorithm, you may
set this to any algorithm available to the php
.IR hash ()
function
.\" const User::hash_iterations
.SS hash_iterations
This is the number of times a password is passed through 
.B hash_algorithm
before being stored in, or checked against, the database.
The default value is
.IR 256 ,
which should be sufficient, so you probably do not need to
alter this
.\" const User::username_regex
.SS username_regex
This defines the prototype that all usernames of users managed
by
.I phpuserlite
must conform to.
.I phpuserlite
will refuse to register users who wish to register with
usernames that do not conform to this regex, and will ask
them to enter another username. The default value is
.I /^\[rs]w{4,32}$/
.\" const User::password_regex
.SS password_regex
This defines the prototype that all passwords of users managed
by
.I phpuserlite
must conform to.
.I phpuserlite
will refuse to register users who wish to register with
passwords that do not conform to this regex, and will ask
them to enter another password. The default value is
.IR /^.{6,128}$/ .
It is recommended that you only modify the minimum and maximum
characters, and then that you only increase them
.\" const User::email_regex
.SS email_regex
This is the regex used to attempt to assure that all users are
registered with a valid email address. The default value is
.IR /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\e.[A-Z]{2,4}$/i ,
which you should only change if are sure it will continue to
work, or if you wish to be more strict on who can register
.\" const User::cookie_session_length
.SS cookie_session_length
This is the time in seconds before a login session cookie will
expire, thus the amount of time a user will stay logged in
unless they logout manually. The default value is
.IR 604800 ,
which equates to 7 days
.\" const User::cookie_path
.SS cookie_path
This is the value that will be used for the path attribure of
all cookies issued by
.IR phpuserlite .
The default value is an empty string
.\" const User::cookie_domain
.SS cookie_domain
This is the value that will be used for the domain attribute of
all cookies issued by
.IR phpuserlite .
The default value is an empty string
.\" login_frequency_limit
.SS login_frequency_limit
.\" login_failure_limit
.SS login_failure_limit
.\" login_failure_period
.SS login_failure_period
.\" login_failure_cooldown
.SS login_failure_cooldown
.\" const User::login_form_template
.SS login_form_template
This is the template used by
.I phpuserlite
to generate login forms. When modifying this template, note that
you can use a form field named
.I cookie_duration
to pass an optional duration (in seconds) before the login
cookies expire, for example to implement a 'keep me logged in'
checkbox. Also pay attention to the
.IR [error] " & " [username]
placeholders, they are used to inject information into the<commit_msg>Added descriptions for login_frequency_limit, login_failure_limit, login_failure_period & login_failure_cooldown to the man page<commit_after>.TH PHPUSERLITE 7 2012-12-03 "Copyright <NAME>" "PHP Programmer's Manual"
.SH NAME
phpuserlite \- provides oo user functionality to php
.\" +------------------+
.\" | CONTENTS SECTION |
.\" +------------------+
.SH CONTENTS
This documentation is divided into a number of sections, each
providing detailed information about an aspect of
.IR phpuserlite .
.br
Sections in this manual are:
.in +2n
.B INTRODUCTION
.br
.B CONFIGURATION
.br
.B STATIC METHODS
.br
.B INSTANCE METHODS
.br
.B EXCEPTIONS
.br
.\".B NOTES
.\".br
.B BUGS
.br
.\".B EXAMPLE
.\".br
.\".B SEE ALSO
.\".br
.\".B COLOPHON
.\" +----------------------+
.\" | INTRODUCTION SECTION |
.\" +----------------------+
.SH INTRODUCTION
.I phpuserlite
is a PHP module designed to provide the basis for websites
requiring a user login & management system, using an
.I SQLite
database throughout to store its data, and with a focus on
security
.\" +-----------------------+
.\" | CONFIGURATION SECTION |
.\" +-----------------------+
.SH CONFIGURATION
.I phpuserlite
can be configured using 'ini style' config files containing
.IR key = value
pairs for the parameters you wish to change. You can load a
specific config file using
.BR loadConfig (),
which you must call before any other methods (including
.BR setupDB ())
or config will be loaded from the file specified by the
.B DEFAULT_CONFIG_FILE
constant. Following is a complete list of the configuration
parameters available to you
.\" const User::db_path
.SS db_path
You should set this parameter to the path of the
.I SQLite
database file you want
.I phpuserlite
to use. Non-absolute paths will be treated as being relative
to the directory that
.I User.php
is in. The default value is
.I phpuserlite.db
.\" const User::salt_length
.SS salt_length
This is the number of bytes of random data used to salt data
that is hashed by
.IR phpuserlite .
The default value is
.IR 16 ,
which should be sufficient, so you probably do not need to alter
this
.\" const User::session_key_length
.SS session_key_length
This is the number of bytes of random data that is used to
generate the session keys used in login cookies. The default
value is
.IR 32 ,
which should be sufficient, so you probably do not need to
alter this
.\" const User::confirm_code_length
.SS confirm_code_length
This is the number of bytes of random data that is used to
generate the confirmation codes sent to users to confirm
registration and change of email. The default value is
.IR 16 ,
which should be sufficient, so you probably do not need to
alter this
.\" const User::hash_algorithm
.SS hash_algorithm
This is the hashing algorithm that
.I phpuserlite
uses throughout, with the exception of
.BR generateConfirmCode (),
which uses
.I sha1
for brevity. The default value is
.IR sha512 ,
but if you wish to use another hashing algorithm, you may
set this to any algorithm available to the php
.IR hash ()
function
.\" const User::hash_iterations
.SS hash_iterations
This is the number of times a password is passed through 
.B hash_algorithm
before being stored in, or checked against, the database.
The default value is
.IR 256 ,
which should be sufficient, so you probably do not need to
alter this
.\" const User::username_regex
.SS username_regex
This defines the prototype that all usernames of users managed
by
.I phpuserlite
must conform to.
.I phpuserlite
will refuse to register users who wish to register with
usernames that do not conform to this regex, and will ask
them to enter another username. The default value is
.I /^\[rs]w{4,32}$/
.\" const User::password_regex
.SS password_regex
This defines the prototype that all passwords of users managed
by
.I phpuserlite
must conform to.
.I phpuserlite
will refuse to register users who wish to register with
passwords that do not conform to this regex, and will ask
them to enter another password. The default value is
.IR /^.{6,128}$/ .
It is recommended that you only modify the minimum and maximum
characters, and then that you only increase them
.\" const User::email_regex
.SS email_regex
This is the regex used to attempt to assure that all users are
registered with a valid email address. The default value is
.IR /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\e.[A-Z]{2,4}$/i ,
which you should only change if are sure it will continue to
work, or if you wish to be more strict on who can register
.\" const User::cookie_session_length
.SS cookie_session_length
This is the time in seconds before a login session cookie will
expire, thus the amount of time a user will stay logged in
unless they logout manually. The default value is
.IR 604800 ,
which equates to 7 days
.\" const User::cookie_path
.SS cookie_path
This is the value that will be used for the path attribure of
all cookies issued by
.IR phpuserlite .
The default value is an empty string
.\" const User::cookie_domain
.SS cookie_domain
This is the value that will be used for the domain attribute of
all cookies issued by
.IR phpuserlite .
The default value is an empty string
.\" login_frequency_limit
.SS login_frequency_limit
This is the minimum amount of time in seconds (as a float) that
.I phpuserlite
will allow between login attempts. Attempts made within this
limit will not be processed, so will never succeed even if the
password entered was correct. The default value is
.I 1.0
.\" login_failure_limit
.SS login_failure_limit
This is the number of failed login attempts that
.I phpuserlite
will allow in a row within
.I login_failure_period
seconds of each other before it enforces a cooldown; blocking
all login attempts for
.I login_failure_cooldown
seconds. The default value is
.I 5
.\" login_failure_period
.SS login_failure_period
This is the maximum amount of time (in seconds) between failed
login attempts that
.I phpuserlite
will count as 'in a row' for the purposes of determining if
.I login_failure_limit
has been reached. The default value is
.IR 300 ,
which equates to five minutes
.\" login_failure_cooldown
.SS login_failure_cooldown
This is the amount of time in seconds that
.I phpuserlite
will block login attempts for when
.I login_failure_limit
failed login attempts are made in a row. The default value is
.IR 300 ,
which equates to five minutes
.\" const User::login_form_template
.SS login_form_template
This is the template used by
.I phpuserlite
to generate login forms. When modifying this template, note that
you can use a form field named
.I cookie_duration
to pass an optional duration (in seconds) before the login
cookies expire, for example to implement a 'keep me logged in'
checkbox. Also pay attention to the
.IR [error] " & " [username]
placeholders, they are used to inject information into the
{'fraction_non_alphanumeric': 0.08087703798891656, 'fraction_numerical': 0.0076299092442374105, 'mean_word_length': 3.716666666666667, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '302523', 'n_tokens_mistral': 3637, 'n_tokens_neox': 3370, 'n_words': 1861}