Elgg  Version master
settings.php
Go to the documentation of this file.
1 <?php
2 
3 // checkboxes (on/off)
5  'security_protect_upgrade',
6  'security_protect_cron',
7  'security_disable_password_autocomplete',
8  'security_email_require_password',
9  'security_email_require_confirmation',
10  'security_notify_admins',
11  'security_notify_user_admin',
12  'security_notify_user_ban',
13  'security_notify_user_password',
14  'session_bound_entity_icons',
15  'subresource_integrity_enabled',
16 ];
17 
18 foreach ($bool_settings as $setting) {
19  elgg_save_config($setting, (bool) get_input($setting));
20 }
21 
22 // integer settings
24  'minusername',
25  'min_password_length',
26  'min_password_lower',
27  'min_password_upper',
28  'min_password_number',
29  'min_password_special',
30 ];
31 
32 foreach ($int_settings as $setting) {
33  $value = get_input($setting);
34  if (elgg_is_empty($value)) {
35  // input was left empty ('') so remove config setting
36  elgg_remove_config($setting);
37  } else {
38  elgg_save_config($setting, (int) $value);
39  }
40 }
41 
42 return elgg_ok_response('', elgg_echo('admin:configuration:success'));
elgg_ok_response($content= '', string|array $message= '', string $forward_url=null, int $status_code=ELGG_HTTP_OK)
Prepares a successful response to be returned by a page or an action handler.
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
$value
Definition: generic.php:51
get_input(string $variable, $default=null, bool $filter_result=true)
Parameter input functions.
Definition: input.php:20
elgg_is_empty($value)
Check if a value isn&#39;t empty, but allow 0 and &#39;0&#39;.
Definition: input.php:176
$bool_settings
Definition: settings.php:4
elgg_save_config(string $name, $value)
Save a configuration setting.
elgg_remove_config(string $name)
Removes a config setting.
foreach($bool_settings as $setting) $int_settings
Definition: settings.php:23