Elgg  Version 3.0
update_basic.php
Go to the documentation of this file.
1 <?php
14 if (!$site) {
15  throw new InstallationException("The system is missing an ElggSite entity!");
16 }
17 if (!($site instanceof ElggSite)) {
18  throw new InstallationException("Passing a non-ElggSite to an ElggSite constructor!");
19 }
20 
21 $site->description = get_input('sitedescription');
22 $site->name = strip_tags(get_input('sitename'));
23 $site->email = get_input('siteemail');
24 $site->save();
25 
26 // allow new user registration?
27 $allow_registration = ('on' === get_input('allow_registration', false));
28 elgg_save_config('allow_registration', $allow_registration);
29 
30 // setup walled garden
31 $walled_garden = ('on' === get_input('walled_garden', false));
32 elgg_save_config('walled_garden', $walled_garden);
33 
34 elgg_save_config('language', get_input('language'));
35 
36 $default_limit = (int) get_input('default_limit');
37 if ($default_limit < 1) {
38  return elgg_error_response(elgg_echo('admin:configuration:default_limit'));
39 }
40 
41 elgg_save_config('default_limit', $default_limit);
42 
44 return elgg_ok_response('', elgg_echo('admin:configuration:success'), $forward);
$forward
$allow_registration
elgg_normalize_site_url($unsafe_url)
From untrusted input, get a site URL safe for forwarding.
Definition: output.php:237
$walled_garden
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg_save_config($name, $value)
Save a configuration setting.
$default_limit
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
elgg_error_response($error= '', $forward_url=REFERRER, $status_code=ELGG_HTTP_OK)
Prepare an error response to be returned by a page or an action handler.
$site
elgg_get_site_entity()
Get the current site entity.
Definition: entities.php:130
elgg_ok_response($content= '', $message= '', $forward_url=null, $status_code=ELGG_HTTP_OK)
Prepares a successful response to be returned by a page or an action handler.
const REFERER
Definition: constants.php:52