aboutsummaryrefslogtreecommitdiff
path: root/mod/profile/actions/resetdefaultprofile.php
blob: 3ada044e852f107c4388ac19be506d2987b28014 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
/**
 * Elgg profile plugin edit default profile action
 *
 * @package ElggProfile
 */

global $CONFIG;

if ($fieldlist = get_plugin_setting('user_defined_fields', 'profile')) {
	$fieldlistarray = explode(',', $fieldlist);
	foreach($fieldlistarray as $listitem) {
		set_plugin_setting("admin_defined_profile_{$listitem}", '', 'profile');
		set_plugin_setting("admin_defined_profile_type_{$listitem}", '', 'profile');
	}
}

set_plugin_setting('user_defined_fields', FALSE, 'profile');

system_message(elgg_echo('profile:defaultprofile:reset'));

forward(REFERER);