From 6b87e062929c6a6bb115c99d1851b1d0cd3fa6ee Mon Sep 17 00:00:00 2001 From: Richard McGirr Date: Fri, 6 Mar 2015 07:26:35 -0500 Subject: [PATCH] [ticket/13675] Add validate to acp_profile event and add template events for acp users profile PHPBB3-13675 --- phpBB/adm/style/acp_users_profile.html | 4 +++- phpBB/docs/events.md | 21 +++++++++++++++++++++ phpBB/includes/acp/acp_users.php | 15 ++++++++++++++- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/phpBB/adm/style/acp_users_profile.html b/phpBB/adm/style/acp_users_profile.html index d32348ff1c..573534fc95 100644 --- a/phpBB/adm/style/acp_users_profile.html +++ b/phpBB/adm/style/acp_users_profile.html @@ -2,6 +2,7 @@
{L_USER_PROFILE} +
@@ -10,6 +11,7 @@

{L_BIRTHDAY_EXPLAIN}
{L_DAY}{L_COLON} {L_MONTH}{L_COLON} {L_YEAR}{L_COLON}
+
@@ -26,7 +28,7 @@ - +
{S_FORM_TOKEN} diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 08b9d2cd18..b45ad92e4c 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -177,6 +177,27 @@ acp_ranks_list_header_before * Purpose: Add content after the last header-column (but before the action column) in the ranks list in the ACP +acp_users_profile_before +=== +* Locations: + + adm/style/acp_users_profile.html +* Since: 3.1.4-RC1 +* Purpose: Add content before the profile details when editing a user in the ACP + +acp_users_profile_after +=== +* Locations: + + adm/style/acp_users_profile.html +* Since: 3.1.4-RC1 +* Purpose: Add content after the profile details but before the custom profile fields when editing a user in the ACP + +acp_users_profile_custom_after +=== +* Locations: + + adm/style/acp_users_profile.html +* Since: 3.1.4-RC1 +* Purpose: Add content after the the custom profile fields when editing a user in the ACP + acp_simple_footer_after === * Location: adm/style/simple_footer.html diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 3c957a7093..8c17fb6311 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1414,6 +1414,18 @@ class acp_users $error[] = 'FORM_INVALID'; } + /** + * Validate profile data in ACP before submitting to the database + * + * @event core.acp_users_profile_validate + * @var bool submit Flag indicating if submit button has been pressed + * @var array data Array with user profile data + * @var array error Array with the form errors + * @since 3.1.4-RC1 + */ + $vars = array('submit', 'data', 'error'); + extract($phpbb_dispatcher->trigger_event('core.acp_users_profile_validate', compact($vars))); + if (!sizeof($error)) { $sql_ary = array( @@ -1429,9 +1441,10 @@ class acp_users * @var array data Array with user profile data * @var int user_id The user id * @var array user_row Array with the full user data + * @var array sql_ary Array with sql data * @since 3.1.4-RC1 */ - $vars = array('cp_data', 'data', 'user_id', 'user_row'); + $vars = array('cp_data', 'data', 'user_id', 'user_row', 'sql_ary'); extract($phpbb_dispatcher->trigger_event('core.acp_users_profile_modify_sql_ary', compact($vars))); $sql = 'UPDATE ' . USERS_TABLE . '