aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-03-30 10:49:06 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-03-30 10:49:06 +0000
commit9f82dec04b18813c060e5a090a149c1a2c140689 (patch)
treeefab7d5e9ce8166ff4bff69d180c82230c3df481 /phpBB/includes
parent331a549c42a74472d27dadbe213618a7b914a737 (diff)
downloadforums-9f82dec04b18813c060e5a090a149c1a2c140689.tar
forums-9f82dec04b18813c060e5a090a149c1a2c140689.tar.gz
forums-9f82dec04b18813c060e5a090a149c1a2c140689.tar.bz2
forums-9f82dec04b18813c060e5a090a149c1a2c140689.tar.xz
forums-9f82dec04b18813c060e5a090a149c1a2c140689.zip
some changes/bugfixes
git-svn-id: file:///svn/phpbb/trunk@7241 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acm/acm_file.php2
-rw-r--r--phpBB/includes/acp/acp_board.php2
-rw-r--r--phpBB/includes/acp/acp_icons.php2
-rw-r--r--phpBB/includes/acp/acp_language.php23
-rw-r--r--phpBB/includes/auth.php2
-rw-r--r--phpBB/includes/functions.php15
-rw-r--r--phpBB/includes/functions_transfer.php4
-rw-r--r--phpBB/includes/ucp/ucp_activate.php11
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php16
-rw-r--r--phpBB/includes/ucp/ucp_profile.php27
10 files changed, 64 insertions, 40 deletions
diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php
index 9700b6ee8d..e18008421e 100644
--- a/phpBB/includes/acm/acm_file.php
+++ b/phpBB/includes/acm/acm_file.php
@@ -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);
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 6fb2b5f9d6..36406b8b27 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -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',
diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php
index 8c6ebbc996..4433119b7c 100644
--- a/phpBB/includes/acp/acp_icons.php
+++ b/phpBB/includes/acp/acp_icons.php
@@ -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], ' -&gt; ' . htmlspecialchars($after_txt)) . '</option>' . $order_list;
+ $order_list = '<option value="' . ($row[$fields . '_order'] + 1) . '"' . $selected . '>' . sprintf($user->lang['AFTER_' . $lang], ' -&gt; ' . $after_txt) . '</option>' . $order_list;
}
}
$db->sql_freeresult($result);
diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php
index 50fb854d54..5805318a93 100644
--- a/phpBB/includes/acp/acp_language.php
+++ b/phpBB/includes/acp/acp_language.php
@@ -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 . '&amp;action=details&amp;id=' . $lang_id . '&amp;language_file=' . urlencode($selected_lang_file)), E_USER_WARNING);
diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php
index c8aa56adc2..f28f449fba 100644
--- a/phpBB/includes/auth.php
+++ b/phpBB/includes/auth.php
@@ -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]];
}
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index be0ef0e237..acd7f4469e 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -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'] . '&amp;t=1&amp;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
);
}
diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php
index 7be2e4acd6..51a7fa8bb7 100644
--- a/phpBB/includes/functions_transfer.php
+++ b/phpBB/includes/functions_transfer.php
@@ -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/';
diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php
index e9fbe69938..6b17b28ba0 100644
--- a/phpBB/includes/ucp/ucp_activate.php
+++ b/phpBB/includes/ucp/ucp_activate.php
@@ -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"));
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 6df48c8c3e..d48f11a71d 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -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]
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 7309b34377..f50c322fce 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -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);
}