mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-12 03:34:04 +02:00
some changes/bugfixes
git-svn-id: file:///svn/phpbb/trunk@7241 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -116,7 +116,7 @@ class acm
|
||||
}
|
||||
|
||||
$expired = true;
|
||||
include($this->cache_dir . $entry);
|
||||
@include($this->cache_dir . $entry);
|
||||
if ($expired)
|
||||
{
|
||||
@unlink($this->cache_dir . $entry);
|
||||
|
@@ -48,7 +48,7 @@ class acp_board
|
||||
'default_dateformat' => array('lang' => 'DEFAULT_DATE_FORMAT', 'validate' => 'string', 'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true),
|
||||
'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'string', 'type' => 'select', 'function' => 'tz_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => false),
|
||||
'board_dst' => array('lang' => 'SYSTEM_DST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
'default_style' => array('lang' => 'DEFAULT_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => false),
|
||||
'default_style' => array('lang' => 'DEFAULT_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => false),
|
||||
'override_user_style' => array('lang' => 'OVERRIDE_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
|
||||
'legend2' => 'WARNINGS',
|
||||
|
@@ -136,7 +136,7 @@ class acp_icons
|
||||
}
|
||||
|
||||
$after_txt = ($mode == 'smilies') ? $row['code'] : $row['icons_url'];
|
||||
$order_list = '<option value="' . ($row[$fields . '_order'] + 1) . '"' . $selected . '>' . sprintf($user->lang['AFTER_' . $lang], ' -> ' . htmlspecialchars($after_txt)) . '</option>' . $order_list;
|
||||
$order_list = '<option value="' . ($row[$fields . '_order'] + 1) . '"' . $selected . '>' . sprintf($user->lang['AFTER_' . $lang], ' -> ' . $after_txt) . '</option>' . $order_list;
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
@@ -105,9 +105,10 @@ class acp_language
|
||||
}
|
||||
|
||||
$hidden_data = build_hidden_fields(array(
|
||||
'file' => $this->language_file,
|
||||
'dir' => $this->language_directory,
|
||||
'method' => $method)
|
||||
'file' => $this->language_file,
|
||||
'dir' => $this->language_directory,
|
||||
'language_file' => $selected_lang_file,
|
||||
'method' => $method)
|
||||
);
|
||||
|
||||
$hidden_data .= build_hidden_fields(array('entry' => $_POST['entry']), true, STRIP);
|
||||
@@ -301,21 +302,13 @@ class acp_language
|
||||
include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx);
|
||||
$method = request_var('method', '');
|
||||
|
||||
switch ($method)
|
||||
if ($method != 'ftp' && $method != 'ftp_fsock')
|
||||
{
|
||||
case 'ftp':
|
||||
$transfer = new ftp(request_var('host', ''), request_var('username', ''), request_var('password', ''), request_var('root_path', ''), request_var('port', ''), request_var('timeout', ''));
|
||||
break;
|
||||
|
||||
case 'ftp_fsock':
|
||||
$transfer = new ftp_fsock(request_var('host', ''), request_var('username', ''), request_var('password', ''), request_var('root_path', ''), request_var('port', ''), request_var('timeout', ''));
|
||||
break;
|
||||
|
||||
default:
|
||||
trigger_error($user->lang['INVALID_UPLOAD_METHOD'], E_USER_ERROR);
|
||||
break;
|
||||
trigger_error($user->lang['INVALID_UPLOAD_METHOD'], E_USER_ERROR);
|
||||
}
|
||||
|
||||
$transfer = new $method(request_var('host', ''), request_var('username', ''), request_var('password', ''), request_var('root_path', ''), request_var('port', ''), request_var('timeout', ''));
|
||||
|
||||
if (($result = $transfer->open_session()) !== true)
|
||||
{
|
||||
trigger_error($user->lang[$result] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id . '&language_file=' . urlencode($selected_lang_file)), E_USER_WARNING);
|
||||
|
@@ -121,7 +121,7 @@ class auth
|
||||
// But if we check for a global option only, we won't combine the options...
|
||||
if ($f != 0 && isset($this->acl_options['local'][$opt]))
|
||||
{
|
||||
if (isset($this->acl[$f]))
|
||||
if (isset($this->acl[$f]) && isset($this->acl[$f][$this->acl_options['local'][$opt]]))
|
||||
{
|
||||
$this->cache[$f][$opt] |= $this->acl[$f][$this->acl_options['local'][$opt]];
|
||||
}
|
||||
|
@@ -2874,7 +2874,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||
{
|
||||
// Images
|
||||
case ATTACHMENT_CATEGORY_IMAGE:
|
||||
$l_downloaded_viewed = $user->lang['VIEWED'];
|
||||
$l_downloaded_viewed = 'VIEWED_COUNT';
|
||||
|
||||
$block_array += array(
|
||||
'S_IMAGE' => true,
|
||||
@@ -2885,7 +2885,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||
|
||||
// Images, but display Thumbnail
|
||||
case ATTACHMENT_CATEGORY_THUMB:
|
||||
$l_downloaded_viewed = $user->lang['VIEWED'];
|
||||
$l_downloaded_viewed = 'VIEWED_COUNT';
|
||||
$thumbnail_link = append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&t=1&f=' . (int) $forum_id);
|
||||
|
||||
$block_array += array(
|
||||
@@ -2896,7 +2896,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||
|
||||
// Windows Media Streams
|
||||
case ATTACHMENT_CATEGORY_WM:
|
||||
$l_downloaded_viewed = $user->lang['VIEWED'];
|
||||
$l_downloaded_viewed = 'VIEWED_COUNT';
|
||||
|
||||
// Giving the filename directly because within the wm object all variables are in local context making it impossible
|
||||
// to validate against a valid session (all params can differ)
|
||||
@@ -2915,7 +2915,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||
// Real Media Streams
|
||||
case ATTACHMENT_CATEGORY_RM:
|
||||
case ATTACHMENT_CATEGORY_QUICKTIME:
|
||||
$l_downloaded_viewed = $user->lang['VIEWED'];
|
||||
$l_downloaded_viewed = 'VIEWED_COUNT';
|
||||
|
||||
$block_array += array(
|
||||
'S_RM_FILE' => ($display_cat == ATTACHMENT_CATEGORY_RM) ? true : false,
|
||||
@@ -2932,7 +2932,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||
case ATTACHMENT_CATEGORY_FLASH:
|
||||
list($width, $height) = getimagesize($filename);
|
||||
|
||||
$l_downloaded_viewed = $user->lang['VIEWED'];
|
||||
$l_downloaded_viewed = 'VIEWED_COUNT';
|
||||
|
||||
$block_array += array(
|
||||
'S_FLASH_FILE' => true,
|
||||
@@ -2945,7 +2945,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||
break;
|
||||
|
||||
default:
|
||||
$l_downloaded_viewed = $user->lang['DOWNLOADED'];
|
||||
$l_downloaded_viewed = 'DOWNLOAD_COUNT';
|
||||
|
||||
$block_array += array(
|
||||
'S_FILE' => true,
|
||||
@@ -2953,11 +2953,10 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
|
||||
break;
|
||||
}
|
||||
|
||||
$l_download_count = (!isset($attachment['download_count']) || $attachment['download_count'] == 0) ? $user->lang['DOWNLOAD_NONE'] : (($attachment['download_count'] == 1) ? sprintf($user->lang['DOWNLOAD_COUNT'], $attachment['download_count']) : sprintf($user->lang['DOWNLOAD_COUNTS'], $attachment['download_count']));
|
||||
$l_download_count = (!isset($attachment['download_count']) || $attachment['download_count'] == 0) ? $user->lang[$l_downloaded_viewed . '_NONE'] : (($attachment['download_count'] == 1) ? sprintf($user->lang[$l_downloaded_viewed], $attachment['download_count']) : sprintf($user->lang[$l_downloaded_viewed . 'S'], $attachment['download_count']));
|
||||
|
||||
$block_array += array(
|
||||
'U_DOWNLOAD_LINK' => $download_link,
|
||||
'L_DOWNLOADED_VIEWED' => $l_downloaded_viewed,
|
||||
'L_DOWNLOAD_COUNT' => $l_download_count
|
||||
);
|
||||
}
|
||||
|
@@ -32,8 +32,8 @@ class transfer
|
||||
{
|
||||
global $phpbb_root_path;
|
||||
|
||||
$this->file_perms = '0644';
|
||||
$this->dir_perms = '0777';
|
||||
$this->file_perms = 0644;
|
||||
$this->dir_perms = 0777;
|
||||
|
||||
// We use the store directory as temporary path to circumvent open basedir restrictions
|
||||
$this->tmp_path = $phpbb_root_path . 'store/';
|
||||
|
@@ -25,7 +25,7 @@ class ucp_activate
|
||||
$user_id = request_var('u', 0);
|
||||
$key = request_var('k', '');
|
||||
|
||||
$sql = 'SELECT user_id, username, user_type, user_email, user_newpasswd, user_lang, user_notify_type, user_actkey
|
||||
$sql = 'SELECT user_id, username, user_type, user_email, user_newpasswd, user_lang, user_notify_type, user_actkey, user_inactive_reason
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE user_id = $user_id";
|
||||
$result = $db->sql_query($sql);
|
||||
@@ -101,7 +101,14 @@ class ucp_activate
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = (!$update_password) ? 'ACCOUNT_ACTIVE' : 'PASSWORD_ACTIVATED';
|
||||
if (!$update_password)
|
||||
{
|
||||
$message = ($user_row['user_inactive_reason'] == INACTIVE_PROFILE) ? 'ACCOUNT_ACTIVE_PROFILE' : 'ACCOUNT_ACTIVE';
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = 'PASSWORD_ACTIVATED';
|
||||
}
|
||||
}
|
||||
|
||||
meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
|
||||
|
@@ -923,17 +923,25 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove
|
||||
global $auth, $db, $user;
|
||||
|
||||
// Delete User [TO/BCC]
|
||||
if ($remove_u)
|
||||
if ($remove_u && !empty($_REQUEST['remove_u']) && is_array($_REQUEST['remove_u']))
|
||||
{
|
||||
$remove_user_id = array_keys($_REQUEST['remove_u']);
|
||||
unset($address_list['u'][(int) $remove_user_id[0]]);
|
||||
|
||||
if (isset($remove_user_id[0]))
|
||||
{
|
||||
unset($address_list['u'][(int) $remove_user_id[0]]);
|
||||
}
|
||||
}
|
||||
|
||||
// Delete Group [TO/BCC]
|
||||
if ($remove_g)
|
||||
if ($remove_g && !empty($_REQUEST['remove_g']) && is_array($_REQUEST['remove_g']))
|
||||
{
|
||||
$remove_group_id = array_keys($_REQUEST['remove_g']);
|
||||
unset($address_list['g'][(int) $remove_group_id[0]]);
|
||||
|
||||
if (isset($remove_group_id[0]))
|
||||
{
|
||||
unset($address_list['g'][(int) $remove_group_id[0]]);
|
||||
}
|
||||
}
|
||||
|
||||
// Add User/Group [TO]
|
||||
|
@@ -116,8 +116,12 @@ class ucp_profile
|
||||
add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_EMAIL', $data['username'], $user->data['user_email'], $data['email']);
|
||||
}
|
||||
|
||||
$message = 'PROFILE_UPDATED';
|
||||
|
||||
if ($config['email_enable'] && $data['email'] != $user->data['user_email'] && $user->data['user_type'] != USER_FOUNDER && ($config['require_activation'] == USER_ACTIVATION_SELF || $config['require_activation'] == USER_ACTIVATION_ADMIN))
|
||||
{
|
||||
$message = ($config['require_activation'] == USER_ACTIVATION_SELF) ? 'ACCOUNT_EMAIL_CHANGED' : 'ACCOUNT_EMAIL_CHANGED_ADMIN';
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
||||
|
||||
$server_url = generate_board_url();
|
||||
@@ -184,9 +188,9 @@ class ucp_profile
|
||||
|
||||
user_active_flip('deactivate', $user->data['user_id'], INACTIVE_PROFILE);
|
||||
|
||||
$sql_ary += array(
|
||||
'user_actkey' => $user_actkey,
|
||||
);
|
||||
// Because we want the profile to be reactivated we set user_newpasswd to empty (else the reactivation will fail)
|
||||
$sql_ary['user_actkey'] = $user_actkey;
|
||||
$sql_ary['user_newpasswd'] = '';
|
||||
}
|
||||
|
||||
if (sizeof($sql_ary))
|
||||
@@ -203,8 +207,21 @@ class ucp_profile
|
||||
user_update_name($user->data['username'], $data['username']);
|
||||
}
|
||||
|
||||
meta_refresh(3, $this->u_action);
|
||||
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
|
||||
// Now, we can remove the user completely (kill the session) - NOT BEFORE!!!
|
||||
if (!empty($sql_ary['user_actkey']))
|
||||
{
|
||||
meta_refresh(5, append_sid($phpbb_root_path . 'index.' . $phpEx));
|
||||
$message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid($phpbb_root_path . 'index.' . $phpEx) . '">', '</a>');
|
||||
|
||||
// Because the user gets deactivated we log him out too, killing his session
|
||||
$user->session_kill();
|
||||
}
|
||||
else
|
||||
{
|
||||
meta_refresh(3, $this->u_action);
|
||||
$message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
|
||||
}
|
||||
|
||||
trigger_error($message);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user