aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp/ucp_profile.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2015-02-02 23:22:23 +0100
committerJoas Schilling <nickvergessen@gmx.de>2015-02-02 23:22:23 +0100
commit7330c0afd39ddce251bca17e8fc9fcec26cee831 (patch)
tree820d5aa26ba9c4c1a448bbba4ed4b99da93a4a5a /phpBB/includes/ucp/ucp_profile.php
parent6678570f49969e3a6e47d917c142448c591f4c5a (diff)
parentbe1b114114786d4084a77d153d92253a31ad1a8d (diff)
downloadforums-7330c0afd39ddce251bca17e8fc9fcec26cee831.tar
forums-7330c0afd39ddce251bca17e8fc9fcec26cee831.tar.gz
forums-7330c0afd39ddce251bca17e8fc9fcec26cee831.tar.bz2
forums-7330c0afd39ddce251bca17e8fc9fcec26cee831.tar.xz
forums-7330c0afd39ddce251bca17e8fc9fcec26cee831.zip
Merge pull request #3325 from rxu/ticket/13536
[ticket/13536] Add ACP/UCP core events to allow modifying user profile data on editing
Diffstat (limited to 'phpBB/includes/ucp/ucp_profile.php')
-rw-r--r--phpBB/includes/ucp/ucp_profile.php24
1 files changed, 23 insertions, 1 deletions
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 436023a4a2..c1cdcf88ca 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -32,7 +32,7 @@ class ucp_profile
function main($id, $mode)
{
global $cache, $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
- global $request, $phpbb_container;
+ global $request, $phpbb_container, $phpbb_dispatcher;
$user->add_lang('posting');
@@ -307,6 +307,17 @@ class ucp_profile
$data['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']);
}
+ /**
+ * Modify user data on editing profile in UCP
+ *
+ * @event core.ucp_profile_modify_profile_info
+ * @var array data Array with user profile data
+ * @var bool submit Flag indicating if submit button has been pressed
+ * @since 3.1.4-RC1
+ */
+ $vars = array('data', 'submit');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_profile_modify_profile_info', compact($vars)));
+
add_form_key('ucp_profile_info');
if ($submit)
@@ -363,6 +374,17 @@ class ucp_profile
$sql_ary['user_birthday'] = $data['user_birthday'];
}
+ /**
+ * Modify profile data in UCP before submitting to the database
+ *
+ * @event core.ucp_profile_info_modify_sql_ary
+ * @var array cp_data Array with the user custom profile fields data
+ * @var array data Array with user profile data
+ * @since 3.1.4-RC1
+ */
+ $vars = array('cp_data', 'data');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_profile_info_modify_sql_ary', compact($vars)));
+
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $user->data['user_id'];