aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/adm/style/acp_users_profile.html4
-rw-r--r--phpBB/docs/events.md21
-rw-r--r--phpBB/includes/acp/acp_users.php15
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 @@
<fieldset>
<legend>{L_USER_PROFILE}</legend>
+ <!-- EVENT acp_users_profile_before -->
<dl>
<dt><label for="jabber">{L_UCP_JABBER}{L_COLON}</label></dt>
<dd><input type="email" id="jabber" name="jabber" value="{JABBER}" /></dd>
@@ -10,6 +11,7 @@
<dt><label for="birthday">{L_BIRTHDAY}{L_COLON}</label><br /><span>{L_BIRTHDAY_EXPLAIN}</span></dt>
<dd>{L_DAY}{L_COLON} <select id="birthday" name="bday_day">{S_BIRTHDAY_DAY_OPTIONS}</select> {L_MONTH}{L_COLON} <select name="bday_month">{S_BIRTHDAY_MONTH_OPTIONS}</select> {L_YEAR}{L_COLON} <select name="bday_year">{S_BIRTHDAY_YEAR_OPTIONS}</select></dd>
</dl>
+ <!-- EVENT acp_users_profile_after -->
</fieldset>
<!-- IF .profile_fields -->
@@ -26,7 +28,7 @@
<!-- END profile_fields -->
</fieldset>
<!-- ENDIF -->
-
+ <!-- EVENT acp_users_profile_custom_after -->
<fieldset class="quick">
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
{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 . '