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..2cf54b563
--- /dev/null
+++ b/actions/profile/fields/reset.php
@@ -0,0 +1,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); \ No newline at end of file