aboutsummaryrefslogtreecommitdiff
path: root/actions/profile/fields/reset.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/profile/fields/reset.php')
-rw-r--r--actions/profile/fields/reset.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/actions/profile/fields/reset.php b/actions/profile/fields/reset.php
new file mode 100644
index 000000000..19efae479
--- /dev/null
+++ b/actions/profile/fields/reset.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Reset profile fields action
+ *
+ */
+
+$fieldlist = elgg_get_config('profile_custom_fields');
+if ($fieldlist) {
+ $fieldlistarray = explode(',', $fieldlist);
+ foreach ($fieldlistarray as $listitem) {
+ unset_config("admin_defined_profile_{$listitem}");
+ unset_config("admin_defined_profile_type_{$listitem}");
+ }
+}
+
+unset_config('profile_custom_fields');
+
+system_message(elgg_echo('profile:defaultprofile:reset'));
+
+forward(REFERER); \ No newline at end of file