diff options
Diffstat (limited to 'phpBB/includes/ucp')
| -rw-r--r-- | phpBB/includes/ucp/info/ucp_profile.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_pm_compose.php | 3 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_pm_options.php | 17 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_prefs.php | 32 | 
4 files changed, 50 insertions, 4 deletions
diff --git a/phpBB/includes/ucp/info/ucp_profile.php b/phpBB/includes/ucp/info/ucp_profile.php index d19b80f4c0..4591776768 100644 --- a/phpBB/includes/ucp/info/ucp_profile.php +++ b/phpBB/includes/ucp/info/ucp_profile.php @@ -21,7 +21,7 @@ class ucp_profile_info  			'version'	=> '1.0.0',  			'modes'		=> array(  				'profile_info'	=> array('title' => 'UCP_PROFILE_PROFILE_INFO', 'auth' => '', 'cat' => array('UCP_PROFILE')), -				'signature'		=> array('title' => 'UCP_PROFILE_SIGNATURE', 'auth' => '', 'cat' => array('UCP_PROFILE')), +				'signature'		=> array('title' => 'UCP_PROFILE_SIGNATURE', 'auth' => 'acl_u_sig', 'cat' => array('UCP_PROFILE')),  				'avatar'		=> array('title' => 'UCP_PROFILE_AVATAR', 'auth' => 'cfg_allow_avatar && (cfg_allow_avatar_local || cfg_allow_avatar_remote || cfg_allow_avatar_upload || cfg_allow_avatar_remote_upload)', 'cat' => array('UCP_PROFILE')),  				'reg_details'	=> array('title' => 'UCP_PROFILE_REG_DETAILS', 'auth' => '', 'cat' => array('UCP_PROFILE')),  			), diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 05243e3d7a..d1786dd9ba 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -755,7 +755,8 @@ function compose_pm($id, $mode, $action, $user_folders = array())  			$return_box_lang = ($action === 'post' || $action === 'edit') ? 'PM_OUTBOX' : 'PM_INBOX'; -			$message = $user->lang['MESSAGE_STORED'] . '<br /><br />' . sprintf($user->lang['VIEW_PRIVATE_MESSAGE'], '<a href="' . $return_message_url . '">', '</a>'); +			$save_message = ($action === 'edit') ? $user->lang['MESSAGE_EDITED'] : $user->lang['MESSAGE_STORED']; +			$message = $save_message . '<br /><br />' . $user->lang('VIEW_PRIVATE_MESSAGE', '<a href="' . $return_message_url . '">', '</a>');  			$last_click_type = 'CLICK_RETURN_FOLDER';  			if ($folder_url) diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php index 58c2d087c8..efa390ed87 100644 --- a/phpBB/includes/ucp/ucp_pm_options.php +++ b/phpBB/includes/ucp/ucp_pm_options.php @@ -328,10 +328,23 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit  				trigger_error('RULE_ALREADY_DEFINED');  			} +			// Prevent users from flooding the rules table +			$sql = 'SELECT COUNT(rule_id) AS num_rules +				FROM ' . PRIVMSGS_RULES_TABLE . ' +				WHERE user_id = ' . (int) $user->data['user_id']; +			$result = $db->sql_query($sql); +			$num_rules = (int) $db->sql_fetchfield('num_rules'); +			$db->sql_freeresult($result); + +			if ($num_rules >= 5000) +			{ +				trigger_error('RULE_LIMIT_REACHED'); +			} +  			$sql = 'INSERT INTO ' . PRIVMSGS_RULES_TABLE . ' ' . $db->sql_build_array('INSERT', $rule_ary);  			$db->sql_query($sql); -			// Update users message rules +			// Set the user_message_rules bit  			$sql = 'UPDATE ' . USERS_TABLE . '  				SET user_message_rules = 1  				WHERE user_id = ' . $user->data['user_id']; @@ -378,7 +391,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit  			$row = $db->sql_fetchrow($result);  			$db->sql_freeresult($result); -			// Update users message rules +			// Unset the user_message_rules bit  			if (!$row)  			{  				$sql = 'UPDATE ' . USERS_TABLE . ' diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index 17d7d23f02..c6e43b831c 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -134,6 +134,35 @@ class ucp_prefs  				}  				$dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . '</option>'; +				// check if there are any user-selectable languages +				$sql = 'SELECT COUNT(lang_id) as languages_count +								FROM ' . LANG_TABLE; +				$result = $db->sql_query($sql); +				if ($db->sql_fetchfield('languages_count') > 1) +				{ +					$s_more_languages = true; +				} +				else +				{ +					$s_more_languages = false; +				} +				$db->sql_freeresult($result); + +				// check if there are any user-selectable styles +				$sql = 'SELECT COUNT(style_id) as styles_count +								FROM ' . STYLES_TABLE . ' +								WHERE style_active = 1'; +				$result = $db->sql_query($sql); +				if ($db->sql_fetchfield('styles_count') > 1) +				{ +					$s_more_styles = true; +				} +				else +				{ +					$s_more_styles = false; +				} +				$db->sql_freeresult($result); +  				$template->assign_vars(array(  					'ERROR'				=> (sizeof($error)) ? implode('<br />', $error) : '', @@ -155,6 +184,9 @@ class ucp_prefs  					'DEFAULT_DATEFORMAT'	=> $config['default_dateformat'],  					'A_DEFAULT_DATEFORMAT'	=> addslashes($config['default_dateformat']), +					'S_MORE_LANGUAGES'	=> $s_more_languages, +					'S_MORE_STYLES'			=> $s_more_styles, +  					'S_LANG_OPTIONS'		=> language_select($data['lang']),  					'S_STYLE_OPTIONS'		=> ($config['override_user_style']) ? '' : style_select($data['style']),  					'S_TZ_OPTIONS'			=> tz_select($data['tz'], true),  | 
