some tiny changes...

git-svn-id: file:///svn/phpbb/trunk@5967 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2006-05-26 15:04:27 +00:00
parent 8dc9fc089b
commit 9fca29eae3
33 changed files with 193 additions and 101 deletions

View file

@ -41,6 +41,10 @@
<dt><label for="jab_resource">{L_JAB_RESOURCE}:</label><br /><span>{L_JAB_RESOURCE_EXPLAIN}</span></dt> <dt><label for="jab_resource">{L_JAB_RESOURCE}:</label><br /><span>{L_JAB_RESOURCE_EXPLAIN}</span></dt>
<dd><input type="text" id="jab_resource" name="jab_resource" value="{JAB_RESOURCE}" /></dd> <dd><input type="text" id="jab_resource" name="jab_resource" value="{JAB_RESOURCE}" /></dd>
</dl> </dl>
<dl>
<dt><label for="jab_package_size">{L_JAB_PACKAGE_SIZE}:</label><br /><span>{L_JAB_PACKAGE_SIZE_EXPLAIN}</span></dt>
<dd><input type="text" id="jab_package_size" name="jab_package_size" value="{JAB_PACKAGE_SIZE}" /></dd>
</dl>
</fieldset> </fieldset>
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">

View file

@ -40,12 +40,13 @@ $sql = 'SELECT attach_id, in_message, post_msg_id, extension
FROM ' . ATTACHMENTS_TABLE . " FROM ' . ATTACHMENTS_TABLE . "
WHERE attach_id = $download_id"; WHERE attach_id = $download_id";
$result = $db->sql_query_limit($sql, 1); $result = $db->sql_query_limit($sql, 1);
$attachment = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!($attachment = $db->sql_fetchrow($result))) if (!$attachment)
{ {
trigger_error('ERROR_NO_ATTACHMENT'); trigger_error('ERROR_NO_ATTACHMENT');
} }
$db->sql_freeresult($result);
if ((!$attachment['in_message'] && !$config['allow_attachments']) || ($attachment['in_message'] && !$config['allow_pm_attach'])) if ((!$attachment['in_message'] && !$config['allow_attachments']) || ($attachment['in_message'] && !$config['allow_pm_attach']))
{ {
@ -105,12 +106,14 @@ $sql = 'SELECT attach_id, in_message, post_msg_id, extension, physical_filename,
FROM ' . ATTACHMENTS_TABLE . " FROM ' . ATTACHMENTS_TABLE . "
WHERE attach_id = $download_id"; WHERE attach_id = $download_id";
$result = $db->sql_query_limit($sql, 1); $result = $db->sql_query_limit($sql, 1);
$attachment = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!($attachment = $db->sql_fetchrow($result))) if (!$attachment)
{ {
trigger_error('ERROR_NO_ATTACHMENT'); trigger_error('ERROR_NO_ATTACHMENT');
} }
$db->sql_freeresult($result);
$attachment['physical_filename'] = basename($attachment['physical_filename']); $attachment['physical_filename'] = basename($attachment['physical_filename']);
@ -136,6 +139,7 @@ if ($download_mode == PHYSICAL_LINK)
} }
redirect($config['upload_path'] . '/' . $attachment['physical_filename']); redirect($config['upload_path'] . '/' . $attachment['physical_filename']);
exit;
} }
else else
{ {
@ -160,7 +164,7 @@ function send_file_to_browser($attachment, $upload_dir, $category)
// Determine the Browser the User is using, because of some nasty incompatibilities. // Determine the Browser the User is using, because of some nasty incompatibilities.
// borrowed from phpMyAdmin. :) // borrowed from phpMyAdmin. :)
$user_agent = (!empty($_SERVER['HTTP_USER_AGENT'])) ? $_SERVER['HTTP_USER_AGENT'] : ''; $user_agent = $user->browser;
if (ereg('Opera(/| )([0-9].[0-9]{1,2})', $user_agent, $log_version)) if (ereg('Opera(/| )([0-9].[0-9]{1,2})', $user_agent, $log_version))
{ {
@ -278,7 +282,15 @@ function download_allowed()
} }
// Check for own server... // Check for own server...
if (preg_match('#^.*?' . $config['server_name'] . '.*?$#i', $hostname)) $server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
// Forcing server vars is the only way to specify/override the protocol
if ($config['force_server_vars'] || !$server_name)
{
$server_name = $config['server_name'];
}
if (preg_match('#^.*?' . preg_quote($server_name, '#') . '.*?$#i', $hostname))
{ {
$allowed = true; $allowed = true;
} }

View file

@ -37,6 +37,8 @@ class acm
{ {
return false; return false;
} }
return true;
} }
function unload() function unload()

View file

@ -1323,7 +1323,7 @@ class acp_attachments
{ {
$hostlist_tmp[] = "'" . $row['site_hostname'] . "'"; $hostlist_tmp[] = "'" . $row['site_hostname'] . "'";
} }
break; // break;
} }
while ($row = $db->sql_fetchrow($result)); while ($row = $db->sql_fetchrow($result));

View file

@ -966,6 +966,8 @@ class acp_forums
add_log('admin', 'LOG_FORUM_EDIT', $forum_data['forum_name']); add_log('admin', 'LOG_FORUM_EDIT', $forum_data['forum_name']);
} }
return $errors;
} }
/** /**

View file

@ -42,6 +42,7 @@ class acp_jabber
$jab_username = request_var('jab_username', $config['jab_username']); $jab_username = request_var('jab_username', $config['jab_username']);
$jab_password = request_var('jab_password', $config['jab_password']); $jab_password = request_var('jab_password', $config['jab_password']);
$jab_resource = request_var('jab_resource', $config['jab_resource']); $jab_resource = request_var('jab_resource', $config['jab_resource']);
$jab_package_size = request_var('jab_package_size', $config['jab_package_size']);
$jabber = new jabber(); $jabber = new jabber();
$error = array(); $error = array();
@ -160,7 +161,8 @@ class acp_jabber
'JAB_PORT' => $new['jab_port'], 'JAB_PORT' => $new['jab_port'],
'JAB_USERNAME' => $new['jab_username'], 'JAB_USERNAME' => $new['jab_username'],
'JAB_PASSWORD' => $new['jab_password'], 'JAB_PASSWORD' => $new['jab_password'],
'JAB_RESOURCE' => $new['jab_resource']) 'JAB_RESOURCE' => $new['jab_resource'],
'JAB_PACKAGE_SIZE' => $new['jab_package_size'])
); );
} }
} }

View file

@ -621,6 +621,7 @@ class acp_users
{ {
$error[] = 'NEW_EMAIL_ERROR'; $error[] = 'NEW_EMAIL_ERROR';
} }
$error[] = 'NEW_EMAIL_ERROR';
// Which updates do we need to do? // Which updates do we need to do?
$update_warning = ($user_row['user_warnings'] != $data['warnings']) ? true : false; $update_warning = ($user_row['user_warnings'] != $data['warnings']) ? true : false;

View file

@ -50,7 +50,13 @@ class bbcode
if (!$this->bbcode_bitfield) if (!$this->bbcode_bitfield)
{ {
return $message; // Remove the uid from tags that have not been transformed into HTML
if ($this->bbcode_uid)
{
$message = str_replace(':' . $this->bbcode_uid, '', $message);
}
return;
} }
$str = array('search' => array(), 'replace' => array()); $str = array('search' => array(), 'replace' => array());

View file

@ -341,7 +341,7 @@ class dbal
if (empty($_GET['explain'])) if (empty($_GET['explain']))
{ {
return; return false;
} }
if (!$query && $this->query_hold != '') if (!$query && $this->query_hold != '')
@ -516,6 +516,8 @@ class dbal
break; break;
} }
return true;
} }
} }

View file

@ -331,6 +331,8 @@ class dbal_postgres extends dbal
unset($this->open_queries[(int) $query_id]); unset($this->open_queries[(int) $query_id]);
return @pg_free_result($query_id); return @pg_free_result($query_id);
} }
return false;
} }
/** /**

View file

@ -1994,7 +1994,7 @@ function add_log()
break; break;
default: default:
return; return false;
} }
$db->sql_query('INSERT INTO ' . LOG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); $db->sql_query('INSERT INTO ' . LOG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));

View file

@ -760,7 +760,7 @@ class jabber
function get_info_from_iq_key($packet = NULL) function get_info_from_iq_key($packet = NULL)
{ {
return (is_array($packet)) ? $packet['iq']['#']['query'][0]['#']['key'][0]['#'] : false; return (is_array($packet) && isset($packet['iq']['#']['query'][0]['#']['key'][0]['#'])) ? $packet['iq']['#']['query'][0]['#']['key'][0]['#'] : false;
} }
function get_info_from_iq_error($packet = NULL) function get_info_from_iq_error($packet = NULL)
@ -1020,6 +1020,8 @@ class make_xml extends jabber
return $text; return $text;
} }
return false;
} }
function _preg_grep_keys($pattern, $array) function _preg_grep_keys($pattern, $array)

View file

@ -202,7 +202,7 @@ class messenger
if ($break) if ($break)
{ {
return; return true;
} }
switch ($method) switch ($method)

View file

@ -178,6 +178,8 @@ function update_post_information($type, $ids, $return_update_sql = false)
WHERE {$type}_id = $update_id"; WHERE {$type}_id = $update_id";
$db->sql_query($sql); $db->sql_query($sql);
} }
return;
} }
/** /**
@ -1263,7 +1265,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
// We do not handle erasing posts here // We do not handle erasing posts here
if ($mode == 'delete') if ($mode == 'delete')
{ {
return; return false;
} }
$current_time = time(); $current_time = time();

View file

@ -270,7 +270,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
if (!$user->data['user_new_privmsg']) if (!$user->data['user_new_privmsg'])
{ {
return; return 0;
} }
$user_new_privmsg = (int) $user->data['user_new_privmsg']; $user_new_privmsg = (int) $user->data['user_new_privmsg'];
@ -709,7 +709,7 @@ function handle_mark_actions($user_id, $mark_action)
if (!sizeof($msg_ids)) if (!sizeof($msg_ids))
{ {
return; return false;
} }
switch ($mark_action) switch ($mark_action)
@ -889,6 +889,8 @@ function delete_pm($user_id, $msg_ids, $folder_id)
WHERE msg_id IN (' . $delete_ids . ')'; WHERE msg_id IN (' . $delete_ids . ')';
$db->sql_query($sql); $db->sql_query($sql);
} }
return true;
} }
/** /**
@ -1099,7 +1101,7 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr
// We do not handle erasing posts here // We do not handle erasing posts here
if ($mode == 'delete') if ($mode == 'delete')
{ {
return; return false;
} }
$current_time = time(); $current_time = time();

View file

@ -414,6 +414,10 @@ class custom_profile
return $tpl_fields; return $tpl_fields;
} }
else
{
trigger_error('Wrong mode for custom profile', E_USER_ERROR);
}
} }
/** /**

View file

@ -114,12 +114,7 @@ class filespec
function get($property) function get($property)
{ {
if ($this->init_error) if ($this->init_error || !isset($this->$property))
{
return;
}
if (!isset($this->$property))
{ {
return false; return false;
} }
@ -284,6 +279,8 @@ class filespec
$this->file_moved = true; $this->file_moved = true;
$this->additional_checks(); $this->additional_checks();
unset($this->upload); unset($this->upload);
return true;
} }
function additional_checks() function additional_checks()
@ -302,13 +299,18 @@ class filespec
$max_filesize = ($this->upload->max_filesize >= 1048576) ? round($this->upload->max_filesize / 1048576 * 100) / 100 : (($this->upload->max_filesize >= 1024) ? round($this->upload->max_filesize / 1024 * 100) / 100 : $this->upload->max_filesize); $max_filesize = ($this->upload->max_filesize >= 1048576) ? round($this->upload->max_filesize / 1048576 * 100) / 100 : (($this->upload->max_filesize >= 1024) ? round($this->upload->max_filesize / 1024 * 100) / 100 : $this->upload->max_filesize);
$this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'WRONG_FILESIZE'], $max_filesize, $size_lang); $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'WRONG_FILESIZE'], $max_filesize, $size_lang);
return;
return false;
} }
if (!$this->upload->valid_dimensions($this)) if (!$this->upload->valid_dimensions($this))
{ {
$this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'WRONG_SIZE'], $this->upload->min_width, $this->upload->min_height, $this->upload->max_width, $this->upload->max_height, $this->width, $this->height); $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'WRONG_SIZE'], $this->upload->min_width, $this->upload->min_height, $this->upload->max_width, $this->upload->max_height, $this->width, $this->height);
return false;
} }
return true;
} }
} }

View file

@ -20,7 +20,7 @@ function user_get_id_name(&$user_id_ary, &$username_ary)
// are neither array filled? // are neither array filled?
if ($user_id_ary && $username_ary) if ($user_id_ary && $username_ary)
{ {
return; return false;
} }
else if (!$user_id_ary && !$username_ary) else if (!$user_id_ary && !$username_ary)
{ {

View file

@ -823,7 +823,7 @@ class parse_message extends bbcode_firstpass
} }
$this->message_status = 'parsed'; $this->message_status = 'parsed';
return; return false;
} }
// Formatting text for display // Formatting text for display
@ -864,7 +864,7 @@ class parse_message extends bbcode_firstpass
} }
$this->message_status = 'display'; $this->message_status = 'display';
return; return false;
} }
// Decode message to be placed back into form box // Decode message to be placed back into form box
@ -887,6 +887,7 @@ class parse_message extends bbcode_firstpass
} }
$this->message_status = 'plain'; $this->message_status = 'plain';
return false;
} }
// Replace magic urls of form http://xxx.xxx., www.xxx. and xxx@xxx.xxx. // Replace magic urls of form http://xxx.xxx., www.xxx. and xxx@xxx.xxx.

View file

@ -648,6 +648,8 @@ class fulltext_mysql extends search_backend
} }
$db->sql_query('TRUNCATE TABLE ' . SEARCH_TABLE); $db->sql_query('TRUNCATE TABLE ' . SEARCH_TABLE);
return false;
} }
/** /**
@ -679,6 +681,8 @@ class fulltext_mysql extends search_backend
} }
$db->sql_query('TRUNCATE TABLE ' . SEARCH_TABLE); $db->sql_query('TRUNCATE TABLE ' . SEARCH_TABLE);
return false;
} }
/** /**

View file

@ -1179,6 +1179,8 @@ class user extends session
$format = substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1); $format = substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1);
return str_replace('||', $this->lang['datetime']['YESTERDAY'], strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates)); return str_replace('||', $this->lang['datetime']['YESTERDAY'], strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates));
} }
return strtr(@gmdate(str_replace('|', '', $format), $gmepoch + $this->timezone + $this->dst), $lang_dates);
} }
function get_iso_lang_id() function get_iso_lang_id()

View file

@ -483,6 +483,8 @@ class template
$this->_tpldata[$blockname][$key] = array_merge($this->_tpldata[$blockname][$key], $vararray); $this->_tpldata[$blockname][$key] = array_merge($this->_tpldata[$blockname][$key], $vararray);
return true; return true;
} }
return false;
} }
/** /**

View file

@ -39,8 +39,7 @@ function compose_pm($id, $mode, $action)
$preview = (isset($_POST['preview'])); $preview = (isset($_POST['preview']));
$save = (isset($_POST['save'])); $save = (isset($_POST['save']));
$load = (isset($_POST['load'])); $load = (isset($_POST['load']));
$cancel = (isset($_POST['cancel'])); $cancel = (isset($_POST['cancel']) && !isset($_POST['save']));
$confirm = (isset($_POST['confirm']));
$delete = (isset($_POST['delete'])); $delete = (isset($_POST['delete']));
$remove_u = (isset($_REQUEST['remove_u'])); $remove_u = (isset($_REQUEST['remove_u']));
@ -361,6 +360,8 @@ function compose_pm($id, $mode, $action)
$message = request_var('message', '', true); $message = request_var('message', '', true);
if ($subject && $message) if ($subject && $message)
{
if (confirm_box(true))
{ {
$sql = 'INSERT INTO ' . DRAFTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( $sql = 'INSERT INTO ' . DRAFTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
'user_id' => $user->data['user_id'], 'user_id' => $user->data['user_id'],
@ -377,9 +378,24 @@ function compose_pm($id, $mode, $action)
trigger_error($message); trigger_error($message);
} }
else
{
$s_hidden_fields = build_hidden_fields(array(
'mode' => $mode,
'action' => $action,
'save' => true,
'subject' => $subject,
'message' => $message,
'u' => $to_user_id,
'g' => $to_group_id,
'p' => $msg_id)
);
unset($subject); confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields);
unset($message); }
}
unset($subject, $message);
} }
// Load Draft // Load Draft

View file

@ -376,7 +376,7 @@ function get_user_informations($user_id, $user_row)
if (!$user_id) if (!$user_id)
{ {
return; return array();
} }
if (empty($user_row)) if (empty($user_row))

View file

@ -183,12 +183,12 @@ class ucp_register
{ {
if ($new_password != $password_confirm) if ($new_password != $password_confirm)
{ {
$error[] = 'NEW_PASSWORD_ERROR'; $error[] = $user->lang['NEW_PASSWORD_ERROR'];
} }
if ($email != $email_confirm) if ($email != $email_confirm)
{ {
$error[] = 'NEW_EMAIL_ERROR'; $error[] = $user->lang['NEW_EMAIL_ERROR'];
} }
} }

View file

@ -51,6 +51,7 @@ class ucp_resend
{ {
$email_template = 'coppa_welcome_inactive'; $email_template = 'coppa_welcome_inactive';
}*/ }*/
/*
if ($config['require_activation'] == USER_ACTIVATION_ADMIN) if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
{ {
$email_template = 'admin_welcome_inactive'; $email_template = 'admin_welcome_inactive';
@ -59,6 +60,7 @@ class ucp_resend
{ {
$email_template = 'user_welcome_inactive'; $email_template = 'user_welcome_inactive';
} }
*/
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx); include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);

View file

@ -106,6 +106,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_check', '4');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_enable', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_enable', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_host', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_host', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_password', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_password', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_package_size', '20');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_port', '5222'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_port', '5222');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_resource', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_resource', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_username', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_username', '');

View file

@ -32,28 +32,28 @@ if (empty($lang) || !is_array($lang))
$lang = array_merge($lang, array( $lang = array_merge($lang, array(
'ACP_JABBER_SETTINGS_EXPLAIN' => 'Here you can enable and control the use Jabber for instant messaging and board notices. Jabber is an opensource protocol and therefore available for use by anyone. Some Jabber servers include gateways or transports which allow you to contact users on other networks. Not all servers offer all transports and changes in protocols can prevent transports from operating. Note that it may take several seconds to update Jabber account details, do not stop the script till completed!', 'ACP_JABBER_SETTINGS_EXPLAIN' => 'Here you can enable and control the use Jabber for instant messaging and board notices. Jabber is an opensource protocol and therefore available for use by anyone. Some Jabber servers include gateways or transports which allow you to contact users on other networks. Not all servers offer all transports and changes in protocols can prevent transports from operating. Note that it may take several seconds to update Jabber account details, do not stop the script till completed!',
'JAB_ENABLE' => 'Enable Jabber',
'JAB_ENABLE_EXPLAIN' => 'Enables use of jabber messaging and notifications',
'JAB_SERVER' => 'Jabber server',
'JAB_SERVER_EXPLAIN' => 'See %sjabber.org%s for a list of servers',
'JAB_PORT' => 'Jabber port',
'JAB_PORT_EXPLAIN' => 'Leave blank unless you know it is not 5222',
'JAB_USERNAME' => 'Jabber username',
'JAB_USERNAME_EXPLAIN' => 'If this user is not registered it will be created if possible.',
'JAB_PASSWORD' => 'Jabber password',
'JAB_RESOURCE' => 'Jabber resource',
'JAB_RESOURCE_EXPLAIN' => 'The resource locates this particular connection, e.g. board, home, etc.',
'JAB_PASS_CHANGED' => 'Jabber password changed successfully',
'JAB_REGISTERED' => 'New account registered successfully',
'JAB_CHANGED' => 'Jabber account changed successfully',
'JAB_SETTINGS_CHANGED' => 'Jabber settings changed successfully',
'ERR_JAB_USERNAME' => 'The username specified already exists, please choose an alternative.',
'ERR_JAB_REGISTER' => 'An error occured trying to register this account, %s',
'ERR_JAB_PASSCHG' => 'Could not change password', 'ERR_JAB_PASSCHG' => 'Could not change password',
'ERR_JAB_PASSFAIL' => 'Password update failed, %s', 'ERR_JAB_PASSFAIL' => 'Password update failed, %s',
'ERR_JAB_REGISTER' => 'An error occured trying to register this account, %s',
'ERR_JAB_USERNAME' => 'The username specified already exists, please choose an alternative.',
'JAB_CHANGED' => 'Jabber account changed successfully',
'JAB_ENABLE' => 'Enable Jabber',
'JAB_ENABLE_EXPLAIN' => 'Enables use of jabber messaging and notifications',
'JAB_PACKAGE_SIZE' => 'Jabber Package Size',
'JAB_PACKAGE_SIZE_EXPLAIN' => 'This is the number of messages sent in one package. If set to 0 the message is sent immediatly and gets not queued for later sending.',
'JAB_PASSWORD' => 'Jabber password',
'JAB_PASS_CHANGED' => 'Jabber password changed successfully',
'JAB_PORT' => 'Jabber port',
'JAB_PORT_EXPLAIN' => 'Leave blank unless you know it is not 5222',
'JAB_REGISTERED' => 'New account registered successfully',
'JAB_RESOURCE' => 'Jabber resource',
'JAB_RESOURCE_EXPLAIN' => 'The resource locates this particular connection, e.g. board, home, etc.',
'JAB_SERVER' => 'Jabber server',
'JAB_SERVER_EXPLAIN' => 'See %sjabber.org%s for a list of servers',
'JAB_SETTINGS_CHANGED' => 'Jabber settings changed successfully',
'JAB_USERNAME' => 'Jabber username',
'JAB_USERNAME_EXPLAIN' => 'If this user is not registered it will be created if possible.',
)); ));
// Auth settings // Auth settings

View file

@ -159,6 +159,8 @@ $lang = array_merge($lang, array(
'SAVE' => 'Save', 'SAVE' => 'Save',
'SAVE_DATE' => 'Saved at', 'SAVE_DATE' => 'Saved at',
'SAVE_DRAFT' => 'Save Draft',
'SAVE_DRAFT_CONFIRM' => 'Please note that saved drafts only include the subject and the message, any other element will be removed. Do you want to save your draft now?',
'SMILIES' => 'Smilies', 'SMILIES' => 'Smilies',
'SMILIES_ARE_OFF' => 'Smilies are <u>OFF</u>', 'SMILIES_ARE_OFF' => 'Smilies are <u>OFF</u>',
'SMILIES_ARE_ON' => 'Smilies are <u>ON</u>', 'SMILIES_ARE_ON' => 'Smilies are <u>ON</u>',

View file

@ -442,6 +442,7 @@ $lang = array_merge($lang, array(
'WATCHED_FORUMS' => 'Watched Forums', 'WATCHED_FORUMS' => 'Watched Forums',
'WATCHED_TOPICS' => 'Watched Topics', 'WATCHED_TOPICS' => 'Watched Topics',
'WRONG_ACTIVATION' => 'The activation key you supplied does not match any in the database', 'WRONG_ACTIVATION' => 'The activation key you supplied does not match any in the database',
'WRONG_DATA_WEBSITE' => 'The website address has to be a valid url, including the protocol. For example http://www.example.com/.',
'YOUR_DETAILS' => 'Your activity', 'YOUR_DETAILS' => 'Your activity',
'YOUR_FOES' => 'Your foes', 'YOUR_FOES' => 'Your foes',

View file

@ -225,7 +225,7 @@ switch ($mode)
case 'jabber': case 'jabber':
$lang = 'JABBER'; $lang = 'JABBER';
$sql_field = 'user_jabber'; $sql_field = 'user_jabber';
$s_select = (@extension_loaded('xml')) ? 'S_SEND_JABBER' : 'S_NO_SEND_JABBER'; $s_select = (@extension_loaded('xml') && $config['jab_enable']) ? 'S_SEND_JABBER' : 'S_NO_SEND_JABBER';
$s_action = "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=contact&amp;action=$action&amp;u=$user_id"; $s_action = "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=contact&amp;action=$action&amp;u=$user_id";
break; break;
@ -255,16 +255,16 @@ switch ($mode)
break; break;
case 'jabber': case 'jabber':
if ($submit && @extension_loaded('xml')) if ($submit && @extension_loaded('xml') && $config['jab_enable'])
{ {
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx); include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
$subject = sprintf($user->lang['IM_JABBER_SUBJECT'], $user->data['username'], $config['server_name']); $subject = sprintf($user->lang['IM_JABBER_SUBJECT'], $user->data['username'], $config['server_name']);
$message = request_var('message', '', true); $message = request_var('message', '', true);
$messenger = new messenger(); $messenger = new messenger(false);
$messenger->template('profile_send_email', $row['user_lang']); $messenger->template('profile_send_im', $row['user_lang']);
$messenger->subject(html_entity_decode($subject)); $messenger->subject(html_entity_decode($subject));
$messenger->replyto($user->data['user_email']); $messenger->replyto($user->data['user_email']);
@ -279,7 +279,6 @@ switch ($mode)
); );
$messenger->send(NOTIFY_IM); $messenger->send(NOTIFY_IM);
$messenger->save_queue();
$s_select = 'S_SENT_JABBER'; $s_select = 'S_SENT_JABBER';
} }
@ -1222,6 +1221,7 @@ function show_profile($data)
'RANK_IMG' => $rank_img, 'RANK_IMG' => $rank_img,
'RANK_IMG_SRC' => $rank_img_src, 'RANK_IMG_SRC' => $rank_img_src,
'ICQ_STATUS_IMG' => (!empty($data['user_icq'])) ? '<img src="http://web.icq.com/whitepages/online?icq=' . $data['user_icq'] . '&amp;img=5" width="18" height="18" border="0" />' : '', 'ICQ_STATUS_IMG' => (!empty($data['user_icq'])) ? '<img src="http://web.icq.com/whitepages/online?icq=' . $data['user_icq'] . '&amp;img=5" width="18" height="18" border="0" />' : '',
'S_JABBER_ENABLED' => ($config['jab_enable']) ? true : false,
'U_PROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=$user_id", 'U_PROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&amp;mode=viewprofile&amp;u=$user_id",
'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? "{$phpbb_root_path}search.$phpEx$SID&amp;author=" . urlencode($username) . "&amp;sr=posts" : '', 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? "{$phpbb_root_path}search.$phpEx$SID&amp;author=" . urlencode($username) . "&amp;sr=posts" : '',

View file

@ -37,8 +37,7 @@ $preview = (isset($_POST['preview'])) ? true : false;
$save = (isset($_POST['save'])) ? true : false; $save = (isset($_POST['save'])) ? true : false;
$load = (isset($_POST['load'])) ? true : false; $load = (isset($_POST['load'])) ? true : false;
$delete = (isset($_POST['delete'])) ? true : false; $delete = (isset($_POST['delete'])) ? true : false;
$cancel = (isset($_POST['cancel'])) ? true : false; $cancel = (isset($_POST['cancel']) && !isset($_POST['save'])) ? true : false;
$confirm = (isset($_POST['confirm'])) ? true : false;
$refresh = (isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['edit_comment']) || isset($_POST['cancel_unglobalise']) || $save || $load) ? true : false; $refresh = (isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['edit_comment']) || isset($_POST['cancel_unglobalise']) || $save || $load) ? true : false;
$mode = ($delete && !$preview && !$refresh && $submit) ? 'delete' : request_var('mode', ''); $mode = ($delete && !$preview && !$refresh && $submit) ? 'delete' : request_var('mode', '');
@ -396,6 +395,8 @@ if ($save && $user->data['is_registered'] && $auth->acl_get('u_savedrafts'))
$message = request_var('message', '', true); $message = request_var('message', '', true);
if ($subject && $message) if ($subject && $message)
{
if (confirm_box(true))
{ {
$sql = 'INSERT INTO ' . DRAFTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( $sql = 'INSERT INTO ' . DRAFTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
'user_id' => $user->data['user_id'], 'user_id' => $user->data['user_id'],
@ -417,6 +418,21 @@ if ($save && $user->data['is_registered'] && $auth->acl_get('u_savedrafts'))
trigger_error($message); trigger_error($message);
} }
else
{
$s_hidden_fields = build_hidden_fields(array(
'mode' => $mode,
'save' => true,
'f' => $forum_id,
't' => $topic_id,
'subject' => $subject,
'message' => $message,
)
);
confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields);
}
}
unset($subject, $message); unset($subject, $message);
} }
@ -618,7 +634,7 @@ if ($submit || $preview || $refresh)
if (($result = validate_username(($mode == 'edit' && $post_data['post_username']) ? $post_data['post_username'] : $post_data['username'])) != false) if (($result = validate_username(($mode == 'edit' && $post_data['post_username']) ? $post_data['post_username'] : $post_data['username'])) != false)
{ {
$error[] = $result; $error[] = $user->lang[$result];
} }
} }

View file

@ -107,7 +107,7 @@
</tr> </tr>
<tr> <tr>
<td class="gen" nowrap="nowrap" align="right">{L_JABBER}: </td> <td class="gen" nowrap="nowrap" align="right">{L_JABBER}: </td>
<td><!-- IF U_JABBER --><a href="{U_JABBER}" onclick="popup('{U_JABBER}', 550, 320); return false">{JABBER_IMG}</a><!-- ENDIF --></td> <td><!-- IF U_JABBER and S_JABBER_ENABLED --><a href="{U_JABBER}" onclick="popup('{U_JABBER}', 550, 320); return false">{JABBER_IMG}</a><!-- ELSEIF U_JABBER -->{JABBER_IMG}<!-- ENDIF --></td>
</tr> </tr>
</table></td> </table></td>
<td class="row1"><table cellspacing="1" cellpadding="2" border="0"> <td class="row1"><table cellspacing="1" cellpadding="2" border="0">