Elgg  Version 4.3
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_echo($message_key, array $args=[], $language="")
Elgg language module Functions to manage language and translations.
Definition: languages.php:18
$value
Definition: generic.php:51
elgg_save_config($name, $value)
Save a configuration setting.
elgg_is_empty($value)
Check if a value isn&#39;t empty, but allow 0 and &#39;0&#39;.
Definition: input.php:179
$bool_settings
Definition: settings.php:4
get_input($variable, $default=null, $filter_result=true)
Parameter input functions.
Definition: input.php:20
foreach($bool_settings as $setting) $int_settings
Definition: settings.php:23
elgg_ok_response($content= '', $message= '', $forward_url=null, int $status_code=ELGG_HTTP_OK)
Prepares a successful response to be returned by a page or an action handler.
elgg_remove_config($name)
Removes a config setting.