aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_profile.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/acp/acp_profile.php')
-rw-r--r--phpBB/includes/acp/acp_profile.php38
1 files changed, 30 insertions, 8 deletions
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 19223847f0..4e8145009f 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -2,9 +2,8 @@
/**
*
* @package acp
-* @version $Id$
* @copyright (c) 2005 phpBB Group
-* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
@@ -30,6 +29,7 @@ class acp_profile
{
global $config, $db, $user, $auth, $template, $cache;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
+ global $request;
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
@@ -242,6 +242,15 @@ class acp_profile
$db->sql_freeresult($result);
add_log('admin', 'LOG_PROFILE_FIELD_ACTIVATE', $field_ident);
+
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response();
+ $json_response->send(array(
+ 'text' => $user->lang('DEACTIVATE'),
+ ));
+ }
+
trigger_error($user->lang['PROFILE_FIELD_ACTIVATED'] . adm_back_link($this->u_action));
break;
@@ -266,7 +275,16 @@ class acp_profile
$field_ident = (string) $db->sql_fetchfield('field_ident');
$db->sql_freeresult($result);
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response();
+ $json_response->send(array(
+ 'text' => $user->lang('ACTIVATE'),
+ ));
+ }
+
add_log('admin', 'LOG_PROFILE_FIELD_DEACTIVATE', $field_ident);
+
trigger_error($user->lang['PROFILE_FIELD_DEACTIVATED'] . adm_back_link($this->u_action));
break;
@@ -370,6 +388,7 @@ class acp_profile
'field_show_profile'=> 0,
'field_no_view' => 0,
'field_show_on_reg' => 0,
+ 'field_show_on_pm' => 0,
'field_show_on_vt' => 0,
'lang_name' => utf8_normalize_nfc(request_var('field_ident', '', true)),
'lang_explain' => '',
@@ -381,7 +400,7 @@ class acp_profile
// $exclude contains the data we gather in each step
$exclude = array(
- 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_vt', 'field_required', 'field_show_novalue', 'field_hide', 'field_show_profile', 'field_no_view'),
+ 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_pm', 'field_show_on_vt', 'field_required', 'field_show_novalue', 'field_hide', 'field_show_profile', 'field_no_view'),
2 => array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'),
3 => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options')
);
@@ -408,6 +427,7 @@ class acp_profile
'field_required',
'field_show_novalue',
'field_show_on_reg',
+ 'field_show_on_pm',
'field_show_on_vt',
'field_show_profile',
'field_hide',
@@ -489,7 +509,8 @@ class acp_profile
$cp->vars['field_default_value_day'] = $now['mday'];
$cp->vars['field_default_value_month'] = $now['mon'];
$cp->vars['field_default_value_year'] = $now['year'];
- $var = $_POST['field_default_value'] = 'now';
+ $var = 'now';
+ $request->overwrite('field_default_value', $var, \phpbb\request\request_interface::POST);
}
else
{
@@ -498,7 +519,8 @@ class acp_profile
$cp->vars['field_default_value_day'] = request_var('field_default_value_day', 0);
$cp->vars['field_default_value_month'] = request_var('field_default_value_month', 0);
$cp->vars['field_default_value_year'] = request_var('field_default_value_year', 0);
- $var = $_POST['field_default_value'] = sprintf('%2d-%2d-%4d', $cp->vars['field_default_value_day'], $cp->vars['field_default_value_month'], $cp->vars['field_default_value_year']);
+ $var = sprintf('%2d-%2d-%4d', $cp->vars['field_default_value_day'], $cp->vars['field_default_value_month'], $cp->vars['field_default_value_year']);
+ $request->overwrite('field_default_value', $var, \phpbb\request\request_interface::POST);
}
else
{
@@ -717,7 +739,7 @@ class acp_profile
}
else
{
- $_new_key_ary[$key] = (is_array($_REQUEST[$key])) ? utf8_normalize_nfc(request_var($key, array(''), true)) : utf8_normalize_nfc(request_var($key, '', true));
+ $_new_key_ary[$key] = ($field_type == FIELD_BOOL && $key == 'lang_options') ? utf8_normalize_nfc(request_var($key, array(''), true)) : utf8_normalize_nfc(request_var($key, '', true));
}
}
}
@@ -761,6 +783,7 @@ class acp_profile
'S_FIELD_REQUIRED' => ($cp->vars['field_required']) ? true : false,
'S_FIELD_SHOW_NOVALUE'=> ($cp->vars['field_show_novalue']) ? true : false,
'S_SHOW_ON_REG' => ($cp->vars['field_show_on_reg']) ? true : false,
+ 'S_SHOW_ON_PM' => ($cp->vars['field_show_on_pm']) ? true : false,
'S_SHOW_ON_VT' => ($cp->vars['field_show_on_vt']) ? true : false,
'S_FIELD_HIDE' => ($cp->vars['field_hide']) ? true : false,
'S_SHOW_PROFILE' => ($cp->vars['field_show_profile']) ? true : false,
@@ -1078,6 +1101,7 @@ class acp_profile
'field_required' => $cp->vars['field_required'],
'field_show_novalue' => $cp->vars['field_show_novalue'],
'field_show_on_reg' => $cp->vars['field_show_on_reg'],
+ 'field_show_on_pm' => $cp->vars['field_show_on_pm'],
'field_show_on_vt' => $cp->vars['field_show_on_vt'],
'field_hide' => $cp->vars['field_hide'],
'field_show_profile' => $cp->vars['field_show_profile'],
@@ -1653,5 +1677,3 @@ class acp_profile
return $sql;
}
}
-
-?>