aboutsummaryrefslogtreecommitdiff
path: root/actions/profile/fields/reset.php
blob: 2cf54b563381a367b2e5016c32c68f43bc758843 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
/**
 * Reset profile fields action
 *
 */

$fieldlist = get_plugin_setting('user_defined_fields', 'profile');
if ($fieldlist) {
	$fieldlistarray = explode(',', $fieldlist);
	foreach ($fieldlistarray as $listitem) {
		clear_plugin_setting("admin_defined_profile_{$listitem}", 'profile');
		clear_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);