mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-10 18:54:08 +02:00
Merge remote-tracking branch 'upstream/develop' into feature/avatars
* upstream/develop: (255 commits) [ticket/10935] Limit number of PM rules per user to 5000 [ticket/10801] Fixed quickmod tools. [ticket/9551] uncomment line and change length to 255 [ticket/10925] Clarify installation requirements for SQLite [ticket/10938] Serve subforum listing on forumlist from template loop [ticket/10640] Change subject length in mcp in subsilver [ticket/10640] Change subject length in MCP [ticket/10640] Do not change default value of truncate_string() [ticket/10640] Change maximum subject length [ticket/10936] remove PCRE and mbstring support check [ticket/10936] fix language key [ticket/10829] Delete T_STYLESHEET_NAME - no longer used. [ticket/10829] $style_name -> $style_path in style class. [ticket/10743] Renaming user->theme [ticket/10743] Changing obtain_cfg_items [ticket/10882] Fix test name - oops. [ticket/10931] Apply strtolower() correctly, i.e. not on false. [ticket/10931] Also test get_bytes() and get_string() with false. [ticket/10931] Make to_numeric function globally available. [ticket/10932] Use included composer.phar in build process ... Conflicts: phpBB/includes/mcp/mcp_warn.php phpBB/install/database_update.php phpBB/styles/prosilver/template/ucp_avatar_options.html
This commit is contained in:
@@ -23,6 +23,7 @@ class ucp_profile_info
|
||||
'signature' => array('title' => 'UCP_PROFILE_SIGNATURE', 'auth' => '', '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')),
|
||||
'autologin_keys'=> array('title' => 'UCP_PROFILE_AUTOLOGIN_KEYS', 'auth' => '', 'cat' => array('UCP_PROFILE')),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@@ -327,10 +327,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'];
|
||||
@@ -377,7 +390,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 . '
|
||||
|
@@ -60,7 +60,14 @@ class ucp_prefs
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
$data['style'] = ($config['override_user_style']) ? $config['default_style'] : $data['style'];
|
||||
if ($config['override_user_style'])
|
||||
{
|
||||
$data['style'] = (int) $config['default_style'];
|
||||
}
|
||||
else if (!phpbb_style_is_active($data['style']))
|
||||
{
|
||||
$data['style'] = (int) $user->data['user_style'];
|
||||
}
|
||||
|
||||
$error = validate_data($data, array(
|
||||
'dateformat' => array('string', false, 1, 30),
|
||||
|
@@ -682,6 +682,60 @@ class ucp_profile
|
||||
));
|
||||
|
||||
break;
|
||||
|
||||
case 'autologin_keys':
|
||||
|
||||
add_form_key('ucp_autologin_keys');
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
$keys = request_var('keys', array(''));
|
||||
|
||||
if (!check_form_key('ucp_autologin_keys'))
|
||||
{
|
||||
$error[] = 'FORM_INVALID';
|
||||
}
|
||||
|
||||
if (!sizeof($error))
|
||||
{
|
||||
if (!empty($keys))
|
||||
{
|
||||
$sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '
|
||||
WHERE user_id = ' . (int) $user->data['user_id'] . '
|
||||
AND ' . $db->sql_in_set('key_id', $keys) ;
|
||||
|
||||
$db->sql_query($sql);
|
||||
|
||||
meta_refresh(3, $this->u_action);
|
||||
$message = $user->lang['AUTOLOGIN_SESSION_KEYS_DELETED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
|
||||
trigger_error($message);
|
||||
}
|
||||
}
|
||||
|
||||
// Replace "error" strings with their real, localised form
|
||||
$error = array_map(array($user, 'lang'), $error);
|
||||
}
|
||||
|
||||
$sql = 'SELECT key_id, last_ip, last_login
|
||||
FROM ' . SESSIONS_KEYS_TABLE . '
|
||||
WHERE user_id = ' . (int) $user->data['user_id'];
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$template->assign_block_vars('sessions', array(
|
||||
'errors' => $error,
|
||||
|
||||
'KEY' => $row['key_id'],
|
||||
'IP' => $row['last_ip'],
|
||||
'LOGIN_TIME' => $user->format_date($row['last_login']),
|
||||
));
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
|
Reference in New Issue
Block a user