Browse Source

updated Config/Aauth

- changed codestandard to CodeIgniter4 (phpcs)
- added document doc & class doc
- added phpcs:ignore
- fixed code aligments
v3-dev
REJack 7 years ago
parent
commit
dc6d124c7f
  1. 266
      application/Config/Aauth.php

266
application/Config/Aauth.php

@ -1,8 +1,34 @@
<?php <?php
/**
* CodeIgniter-Aauth
*
* Aauth is a User Authorization Library for CodeIgniter 4.x, which aims to make
* easy some essential jobs such as login, permissions and access operations.
* Despite ease of use, it has also very advanced features like groupping,
* access management, public access etc..
*
* @package CodeIgniter-Aauth
* @author Magefly Team
* @author Jacob Tomlinson
* @author Tim Swagger (Renowne, LLC) <tim@renowne.com>
* @author Raphael Jackstadt <info@rejack.de>
* @copyright 2014-2017 Emre Akay
* @copyright 2018 Magefly
* @license https://opensource.org/licenses/MIT MIT License
* @link https://github.com/magefly/CodeIgniter-Aauth
*/
namespace Config; namespace Config;
use CodeIgniter\Config\BaseConfig; use CodeIgniter\Config\BaseConfig;
/**
* Aauth Config
*
* @package CodeIgniter-Aauth
*
* phpcs:disable Squiz.Commenting.VariableComment
*/
class Aauth extends BaseConfig class Aauth extends BaseConfig
{ {
/* /*
@ -12,29 +38,28 @@ class Aauth extends BaseConfig
| |
| 'linkNoPermission' | 'linkNoPermission'
| |
| If user don't have permisssion to see the page he will be redirected | If user don't have permisssion to see the page he will be redirected
| the page specified. | the page specified.
| (default: false) | (default: false)
| |
| 'linkResetPassword' | 'linkResetPassword'
| |
| Link for reset_password without site_url or base_url | Link for reset_password without site_url or base_url
| (default: '/account/reset_password') | (default: '/account/reset_password')
| |
| 'linkVerification' | 'linkVerification'
| |
| Link for verification without site_url or base_url | Link for verification without site_url or base_url
| (default: '/account/verification') | (default: '/account/verification')
| 'linkVerification' | 'linkVerification'
| |
| Redirect path to TOTP Verification page | Redirect path to TOTP Verification page
| (default: '/account/twofactor_verification') | (default: '/account/twofactor_verification')
|
*/ */
public $linkNoPermission = false; public $linkNoPermission = false;
public $linkResetPassword = '/account/reset_password'; public $linkResetPassword = '/account/reset_password';
public $linkVerification = '/account/verification'; public $linkVerification = '/account/verification';
public $linkTotp = '/account/twofactor_verification'; public $linkTotp = '/account/twofactor_verification';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -43,18 +68,17 @@ class Aauth extends BaseConfig
| |
| 'userVerification' | 'userVerification'
| |
| User Verification, if TRUE sends a verification email on account creation | User Verification, if TRUE sends a verification email on account creation
| (default: false) | (default: false)
| |
| 'userAdditionalChars' | 'userAdditionalChars'
| |
| Additional valid chars for username. Non alphanumeric characters that are | Additional valid chars for username. Non alphanumeric characters that are
| allowed by default | allowed by default
| (default: array()) | (default: [])
|
*/ */
public $userVerification = false; public $userVerification = false;
public $userAdditionalChars = array(); public $userAdditionalChars = [];
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -63,31 +87,30 @@ class Aauth extends BaseConfig
| |
| 'passwordMin' | 'passwordMin'
| |
| Password min char length | Password min char length
| (default: 8) | (default: 8)
| |
| 'passwordMax' | 'passwordMax'
| |
| Password max char length | Password max char length
| (default: 32) | (default: 32)
| |
| 'passwordHashAlgo' | 'passwordHashAlgo'
| |
| password_hash algorithm (PASSWORD_DEFAULT, PASSWORD_BCRYPT) | password_hash algorithm (PASSWORD_DEFAULT, PASSWORD_BCRYPT)
| for details see http://php.net/manual/de/password.constants.php | for details see http://php.net/manual/de/password.constants.php
| (default: PASSWORD_DEFAULT) | (default: PASSWORD_DEFAULT)
| |
| 'passwordHashOptions' | 'passwordHashOptions'
| |
| password_hash options array | password_hash options array
| for details see http://php.net/manual/en/function.password-hash.php | for details see http://php.net/manual/en/function.password-hash.php
| (default: array()) | (default: [])
|
*/ */
public $passwordMin = 8; public $passwordMin = 8;
public $passwordMax = 32; public $passwordMax = 32;
public $passwordHashAlgo = PASSWORD_DEFAULT; public $passwordHashAlgo = PASSWORD_DEFAULT;
public $passwordHashOptions = array(); public $passwordHashOptions = [];
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -96,43 +119,42 @@ class Aauth extends BaseConfig
| |
| 'loginUseUsername' | 'loginUseUsername'
| |
| Login Identificator, if TRUE username needed to login else email address | Login Identificator, if TRUE username needed to login else email address
| (default: false) | (default: false)
| |
| 'loginRemember' | 'loginRemember'
| |
| Remember time (in relative format) elapsed after connecting and automatic | Remember time (in relative format) elapsed after connecting and automatic
| logout for usage with cookies. | logout for usage with cookies.
| Relative format (e.g. '+ 1 week', '+ 1 month') for details see | Relative format (e.g. '+ 1 week', '+ 1 month') for details see
| http://php.net/manual/de/datetime.formats.relative.php | http://php.net/manual/de/datetime.formats.relative.php
| (default: '+14 days') | (default: '+14 days')
| |
| 'loginProtection' | 'loginProtection'
| |
| Enables the DDoS Protection, user will be banned temporary when he exceed the login 'try' | Enables the DDoS Protection, user will be banned temporary when he exceed the login 'try'
| (default: true) | (default: true)
| |
| 'loginAttemptLimit' | 'loginAttemptLimit'
| |
| Login attempts limit | Login attempts limit
| (default: 10) | (default: 10)
| |
| 'loginAttemptLimitTimePeriod' | 'loginAttemptLimitTimePeriod'
| |
| Period of time for max login attempts | Period of time for max login attempts
| (default: '5 minutes') | (default: '5 minutes')
| |
| 'loginAttemptRemoveSuccessful' | 'loginAttemptRemoveSuccessful'
| |
| Enables removing login attempt after successful login | Enables removing login attempt after successful login
| (default: true) | (default: true)
|
*/ */
public $loginRemember = '+14 days'; public $loginRemember = '+14 days';
public $loginUseUsername = false; public $loginUseUsername = false;
public $loginProtection = true; public $loginProtection = true;
public $loginAttemptLimit = 10; public $loginAttemptLimit = 10;
public $loginAttemptLimitTimePeriod = '5 minutes'; public $loginAttemptLimitTimePeriod = '5 minutes';
public $loginAttemptRemoveSuccessful = true; public $loginAttemptRemoveSuccessful = true;
/* /*
@ -142,25 +164,24 @@ class Aauth extends BaseConfig
| |
| 'emailFrom' | 'emailFrom'
| |
| Sender email address, used for remind_password, send_verification and | Sender email address, used for remind_password, send_verification and
| reset_password | reset_password
| (default: 'admin@example.com') | (default: 'admin@example.com')
| |
| 'emailFromName' | 'emailFromName'
| |
| Sender name, used for remind_password, send_verification and | Sender name, used for remind_password, send_verification and
| reset_password | reset_password
| (default: 'Aauth v3') | (default: 'Aauth v3')
| |
| 'emailConfig' | 'emailConfig'
| |
| Array of Config for CI's Email Library | Array of Config for CI's Email Library
| (default: false) | (default: [])
|
*/ */
public $emailFrom = 'admin@example.com'; public $emailFrom = 'sys@xpresspaper.eu';
public $emailFromName = 'Aauth v3'; public $emailFromName = 'Aauth v3';
public $emailConfig = false; public $emailConfig = [];
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -169,29 +190,28 @@ class Aauth extends BaseConfig
| |
| 'totpEnabled' | 'totpEnabled'
| |
| Enables the Time-based One-time Password Algorithm | Enables the Time-based One-time Password Algorithm
| (default: false) | (default: false)
| |
| 'totpOnIpChange' | 'totpOnIpChange'
| |
| TOTP only on IP Change | TOTP only on IP Change
| (default: false) | (default: false)
| |
| 'totpResetPassword' | 'totpResetPassword'
| |
| Reset TOTP secret on reset_password() | Reset TOTP secret on reset_password()
| (default: false) | (default: false)
| |
| 'totpLogin' | 'totpLogin'
| |
| TOTP required if uses has TOTP secret on login() | TOTP required if uses has TOTP secret on login()
| (default: false) | (default: false)
|
*/ */
public $totpEnabled = false; public $totpEnabled = false;
public $totpOnIpChange = false; public $totpOnIpChange = false;
public $totpResetPassword = false; public $totpResetPassword = false;
public $totpLogin = false; public $totpLogin = false;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -200,29 +220,28 @@ class Aauth extends BaseConfig
| |
| 'recaptchaEnabled' | 'recaptchaEnabled'
| |
| Enables reCAPTCHA (for details see www.google.com/recaptcha/admin) | Enables reCAPTCHA (for details see www.google.com/recaptcha/admin)
| (default: 'admin@example.com') | (default: 'admin@example.com')
| |
| 'recaptchaLoginAttempts' | 'recaptchaLoginAttempts'
| |
| Login Attempts to display reCAPTCHA | Login Attempts to display reCAPTCHA
| (default: '') | (default: '')
| |
| 'recaptchaSiteKey' | 'recaptchaSiteKey'
| |
| The reCAPTCHA siteKey | The reCAPTCHA siteKey
| (default: '') | (default: '')
| |
| 'recaptchaSecret' | 'recaptchaSecret'
| |
| The reCAPTCHA secretKey | The reCAPTCHA secretKey
| (default: '') | (default: '')
|
*/ */
public $recaptchaEnabled = false; public $recaptchaEnabled = false;
public $recaptchaLoginAttempts = 6; public $recaptchaLoginAttempts = 6;
public $recaptchaSiteKey = ''; public $recaptchaSiteKey = '';
public $recaptchaSecret = ''; public $recaptchaSecret = '';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -231,23 +250,22 @@ class Aauth extends BaseConfig
| |
| 'adminGroup' | 'adminGroup'
| |
| Name of admin group | Name of admin group
| (default: 'admin') | (default: 'admin')
| |
| 'defaultGroup' | 'defaultGroup'
| |
| Name of default group, the new user is added in it | Name of default group, the new user is added in it
| (default: 'default') | (default: 'default')
| |
| 'publicGroup' | 'publicGroup'
| |
| Name of Public group , people who not logged in | Name of Public group , people who not logged in
| (default: 'public') | (default: 'public')
|
*/ */
public $adminGroup = 'admin'; public $adminGroup = 'admin';
public $defaultGroup = 'default'; public $defaultGroup = 'default';
public $publicGroup = 'public'; public $publicGroup = 'public';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -256,59 +274,58 @@ class Aauth extends BaseConfig
| |
| 'dbProfile' | 'dbProfile'
| |
| The configuration database profile (definied in Config/Database.php) | The configuration database profile (definied in Config/Database.php)
| (default: 'default') | (default: 'default')
| |
| 'dbTableUsers' | 'dbTableUsers'
| |
| The table which containss users | The table which containss users
| (default: 'aauth_users') | (default: 'aauth_users')
| |
| 'dbTableUserVariables' | 'dbTableUserVariables'
| |
| The table which contains users variables | The table which contains users variables
| (default: 'aauth_user_variables') | (default: 'aauth_user_variables')
| |
| 'dbTableLoginAttempts' | 'dbTableLoginAttempts'
| |
| The table which contains login attempts | The table which contains login attempts
| (default: 'aauth_login_attempts') | (default: 'aauth_login_attempts')
| |
| 'dbTableLoginTokens' | 'dbTableLoginTokens'
| |
| The table which contains login tokens | The table which contains login tokens
| (default: 'aauth_login_tokens') | (default: 'aauth_login_tokens')
| |
| 'dbTableGroups' | 'dbTableGroups'
| |
| The table which contains groups | The table which contains groups
| (default: 'aauth_groups') | (default: 'aauth_groups')
| |
| 'dbTableGroupToUser' | 'dbTableGroupToUser'
| |
| The table which contains join of users and groups | The table which contains join of users and groups
| (default: 'aauth_group_to_user') | (default: 'aauth_group_to_user')
| |
| 'dbTableGroupToGroup' | 'dbTableGroupToGroup'
| |
| The table which contains join of subgroups and groups | The table which contains join of subgroups and groups
| (default: 'aauth_group_to_group') | (default: 'aauth_group_to_group')
| |
| 'dbTablePerms' | 'dbTablePerms'
| |
| The table which contains permissions | The table which contains permissions
| (default: 'aauth_perms') | (default: 'aauth_perms')
| |
| 'dbTablePermToUser' | 'dbTablePermToUser'
| |
| The table which contains permissions for users | The table which contains permissions for users
| (default: 'aauth_perm_to_user') | (default: 'aauth_perm_to_user')
| |
| 'dbTablePermToGroup' | 'dbTablePermToGroup'
| |
| The table which contains permissions for groups | The table which contains permissions for groups
| (default: 'aauth_perm_to_group') | (default: 'aauth_perm_to_group')
|
*/ */
public $dbProfile = 'default'; public $dbProfile = 'default';
public $dbTableUsers = 'aauth_users'; public $dbTableUsers = 'aauth_users';
@ -321,5 +338,4 @@ class Aauth extends BaseConfig
public $dbTablePerms = 'aauth_perms'; public $dbTablePerms = 'aauth_perms';
public $dbTablePermToUser = 'aauth_perm_to_user'; public $dbTablePermToUser = 'aauth_perm_to_user';
public $dbTablePermToGroup = 'aauth_perm_to_group'; public $dbTablePermToGroup = 'aauth_perm_to_group';
} }

Loading…
Cancel
Save