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