aboutsummaryrefslogtreecommitdiff
path: root/actions/admin/site/update_basic.php
blob: 5914ab0b543a84b89672b8f11c3987a023bd91c7 (plain)
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
<?php
/**
 * Elgg update site action
 *
 * This is an update version of the sitesettings/install action
 * which is used by the admin panel to modify basic settings.
 *
 * @package Elgg
 * @subpackage Core
 * @author Curverider Ltd
 * @link http://elgg.org/
 */

admin_gatekeeper();

if (datalist_get('default_site')) {
	$site = get_entity(datalist_get('default_site'));
	if (!($site instanceof ElggSite)) {
		throw new InstallationException(elgg_echo('InvalidParameterException:NonElggSite'));
	}

	$site->description = get_input('sitedescription');
	$site->name = get_input('sitename');
	$site->email = get_input('siteemail');
	$site->save();

	set_config('language', get_input('language'), $site->getGUID());

	forward($_SERVER['HTTP_REFERER']);
	exit;
}