1: <?php
2: /**
3: * This code is licensed under AGPLv3 license or Afterlogic Software License
4: * if commercial version of the product was purchased.
5: * For full statements of the licenses see LICENSE-AFTERLOGIC and LICENSE-AGPL3 files.
6: */
7:
8: namespace Aurora\Modules\Core;
9:
10: use Aurora\System\SettingsProperty;
11: use Aurora\System\Enums;
12:
13: /**
14: * @property bool $Disabled
15: * @property bool $AllowCapa
16: * @property bool $AllowPostLogin
17: * @property bool $CsrfTokenProtection
18: * @property int $CronTimeToRunSeconds
19: * @property int $CronTimeToKillSeconds
20: * @property string $CronTimeFile
21: * @property bool $UserSelectsDateFormat
22: * @property Enums\DateFormat $DateFormat
23: * @property array $DateFormatList
24: * @property array $LanguageList
25: * @property string $LanguageListComment
26: * @property string $Language
27: * @property bool $AutodetectLanguage
28: * @property string $PostLoginErrorRedirectUrl
29: * @property Enums\TimeFormat $TimeFormat
30: * @property string $SiteName
31: * @property string $ProductName
32: * @property int $AuthTokenCookieExpireTime
33: * @property bool $EnableFailedLoginBlock
34: * @property bool $AllowPostLogin
35: * @property int $LoginBlockAvailableTriesCount
36: * @property bool $LoginBlockDurationMinutes
37: * @property int $LoginBlockIpReputationThreshold
38: * @property bool $AllowGroups
39: * @property string $CookieSameSite
40: */
41:
42: class Settings extends \Aurora\System\Module\Settings
43: {
44: protected function initDefaults()
45: {
46: $this->aContainer = [
47: 'Disabled' => new SettingsProperty(
48: false,
49: 'bool',
50: null,
51: 'Setting to true disables the module'
52: ),
53: 'AllowCapa' => new SettingsProperty(
54: false,
55: 'bool',
56: null,
57: 'If set to true, product features can be enabled/disabled on user or tenant level'
58: ),
59: 'AllowPostLogin' => new SettingsProperty(
60: false,
61: 'bool',
62: null,
63: 'If set to true, credentials can be submitted via POST request'
64: ),
65: 'CsrfTokenProtection' => new SettingsProperty(
66: true,
67: 'bool',
68: null,
69: 'If set to true, CSRF protection is enabled'
70: ),
71: 'CronTimeToRunSeconds' => new SettingsProperty(
72: 10800,
73: 'int',
74: null,
75: 'Defines intervals in seconds to run a routine of deleting temporary files'
76: ),
77: 'CronTimeToKillSeconds' => new SettingsProperty(
78: 10800,
79: 'int',
80: null,
81: 'Defines minimal age in seconds of temporary files to be deleted'
82: ),
83: 'CronTimeFile' => new SettingsProperty(
84: '.clear.dat',
85: 'string',
86: null,
87: 'Defines filename for storing last timestamp when routine of deleting temporary files was run'
88: ),
89: 'UserSelectsDateFormat' => new SettingsProperty(
90: false,
91: 'bool',
92: null,
93: 'If set to true, users can select date format'
94: ),
95: 'DateFormat' => new SettingsProperty(
96: Enums\DateFormat::DDMMYYYY,
97: 'spec',
98: Enums\DateFormat::class,
99: 'Defines default date format used'
100: ),
101: 'DateFormatList' => new SettingsProperty(
102: [Enums\DateFormat::DDMMYYYY, Enums\DateFormat::MMDDYYYY, Enums\DateFormat::DD_MONTH_YYYY],
103: 'array',
104: null,
105: 'Defines default date format used'
106: ),
107: 'LanguageList' => new SettingsProperty(
108: [],
109: 'array',
110: null,
111: 'Empty array means that every language from every module will be available. [\"English\", \"German\"] means that only English and German languages will be used in the system.'
112: ),
113: 'LanguageListComment' => new SettingsProperty(
114: '',
115: 'string',
116: null,
117: 'Empty array means that every language from every module will be available. [\"English\", \"German\"] means that only English and German languages will be used in the system.'
118: ),
119: 'Language' => new SettingsProperty(
120: '',
121: 'string',
122: null,
123: 'Default interface language used'
124: ),
125: 'AutodetectLanguage' => new SettingsProperty(
126: true,
127: 'bool',
128: null,
129: 'Setting to true enables language autodetection'
130: ),
131: 'PostLoginErrorRedirectUrl' => new SettingsProperty(
132: './',
133: 'string',
134: null,
135: 'If login credentials were supplied with POST method, this setting defines redirect URL used when authentication error occurs'
136: ),
137: 'TimeFormat' => new SettingsProperty(
138: Enums\TimeFormat::F24,
139: 'spec',
140: Enums\TimeFormat::class,
141: 'Denotes time format used by default'
142: ),
143: 'SiteName' => new SettingsProperty(
144: '',
145: 'string',
146: null,
147: 'Text used in browser title as a website name'
148: ),
149: 'ProductName' => new SettingsProperty(
150: 'Unknown',
151: 'string',
152: null,
153: 'Product name, displayed in About tab of adminpanel'
154: ),
155: 'AuthTokenCookieExpireTime' => new SettingsProperty(
156: 30,
157: 'int',
158: null,
159: 'Expiration time for authentication cookie, in days'
160: ),
161: 'EnableFailedLoginBlock' => new SettingsProperty(
162: false,
163: 'bool',
164: null,
165: 'Setting to true enables feature of blocking user after a number of failed login attempts'
166: ),
167: 'LoginBlockAvailableTriesCount' => new SettingsProperty(
168: 10,
169: 'int',
170: null,
171: 'Number of failed login attempts which will result in blocking user'
172: ),
173: 'LoginBlockDurationMinutes' => new SettingsProperty(
174: 3,
175: 'int',
176: null,
177: 'Number of minutes user will be blocked for upon multiple failed login attempts'
178: ),
179: 'LoginBlockIpReputationThreshold ' => new SettingsProperty(
180: 0,
181: 'int',
182: null,
183: 'The setting determines the number of different users that need to be blocked from a specific IP address before that IP is considered to have a bad reputation and blocks any further login attempts from it.'
184: ),
185: 'AllowGroups' => new SettingsProperty(
186: false,
187: 'bool',
188: null,
189: 'Setting to true enables user groups which can be managed in adminpanel'
190: ),
191: 'CookieSameSite' => new SettingsProperty(
192: 'Strict',
193: 'string',
194: null,
195: 'Sets the SameSite value of system cookies such as AuthToken cookie. Possible values: None, Lax, or Strict'
196: ),
197: ];
198: }
199: }
200: