diff options
Diffstat (limited to 'phpBB/includes/ucp')
| -rw-r--r-- | phpBB/includes/ucp/ucp_activate.php | 7 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_pm.php | 4 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_pm_compose.php | 31 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_pm_viewfolder.php | 1 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_pm_viewmessage.php | 5 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_prefs.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/ucp/ucp_register.php | 4 | 
7 files changed, 43 insertions, 11 deletions
diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php index 8debaabf31..b00c1b9f52 100644 --- a/phpBB/includes/ucp/ucp_activate.php +++ b/phpBB/includes/ucp/ucp_activate.php @@ -98,6 +98,13 @@ class ucp_activate  				SET user_actkey = ''  				WHERE user_id = {$user_row['user_id']}";  			$db->sql_query($sql); + +			// Create the correct logs +			add_log('user', $user_row['user_id'], 'LOG_USER_ACTIVE_USER'); +			if ($auth->acl_get('a_user')) +			{ +				add_log('admin', 'LOG_USER_ACTIVE', $user_row['username']); +			}  		}  		if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password) diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php index e1c51170db..c675928a5b 100644 --- a/phpBB/includes/ucp/ucp_pm.php +++ b/phpBB/includes/ucp/ucp_pm.php @@ -115,7 +115,7 @@ class ucp_pm  			case 'compose':  				$action = request_var('action', 'post'); -				get_folder($user->data['user_id']); +				$user_folders = get_folder($user->data['user_id']);  				if (!$auth->acl_get('u_sendpm'))  				{ @@ -130,7 +130,7 @@ class ucp_pm  				}  				include($phpbb_root_path . 'includes/ucp/ucp_pm_compose.' . $phpEx); -				compose_pm($id, $mode, $action); +				compose_pm($id, $mode, $action, $user_folders);  				$tpl_file = 'posting_body';  			break; diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index b596e72c41..05243e3d7a 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -20,7 +20,7 @@ if (!defined('IN_PHPBB'))  * Compose private message  * Called from ucp_pm with mode == 'compose'  */ -function compose_pm($id, $mode, $action) +function compose_pm($id, $mode, $action, $user_folders = array())  {  	global $template, $db, $auth, $user;  	global $phpbb_root_path, $phpEx, $config; @@ -135,6 +135,7 @@ function compose_pm($id, $mode, $action)  	}  	$sql = ''; +	$folder_id = 0;  	// What is all this following SQL for? Well, we need to know  	// some basic information in all cases before we do anything. @@ -398,7 +399,7 @@ function compose_pm($id, $mode, $action)  	unset($message_text);  	$s_action = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=$mode&action=$action", true, $user->session_id); -	$s_action .= ($msg_id) ? "&p=$msg_id" : ''; +	$s_action .= (($folder_id) ? "&f=$folder_id" : '') . (($msg_id) ? "&p=$msg_id" : '');  	// Delete triggered ?  	if ($action == 'delete') @@ -741,10 +742,30 @@ function compose_pm($id, $mode, $action)  			$msg_id = submit_pm($action, $subject, $pm_data);  			$return_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=view&p=' . $msg_id); -			$return_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=outbox'); -			meta_refresh(3, $return_message_url); +			$inbox_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox'); +			$outbox_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=outbox'); + +			$folder_url = ''; +			if (($folder_id > 0) && isset($user_folders[$folder_id])) +			{ +				$folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=' . $folder_id); +			} + +			$return_box_url = ($action === 'post' || $action === 'edit') ? $outbox_folder_url : $inbox_folder_url; +			$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>') . '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $return_folder_url . '">', '</a>', $user->lang['PM_OUTBOX']); +			$message = $user->lang['MESSAGE_STORED'] . '<br /><br />' . sprintf($user->lang['VIEW_PRIVATE_MESSAGE'], '<a href="' . $return_message_url . '">', '</a>'); + +			$last_click_type = 'CLICK_RETURN_FOLDER'; +			if ($folder_url) +			{ +				$message .= '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $folder_url . '">', '</a>', $user_folders[$folder_id]['folder_name']); +				$last_click_type = 'CLICK_GOTO_FOLDER'; +			} +			$message .= '<br /><br />' . sprintf($user->lang[$last_click_type], '<a href="' . $return_box_url . '">', '</a>', $user->lang[$return_box_lang]); + +			meta_refresh(3, $return_message_url);  			trigger_error($message);  		} diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index 6b7172ca2b..bd7bf89854 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -169,6 +169,7 @@ function view_folder($id, $mode, $folder_id, $folder)  					'PM_IMG'			=> ($row_indicator) ? $user->img('pm_' . $row_indicator, '') : '',  					'ATTACH_ICON_IMG'	=> ($auth->acl_get('u_pm_download') && $row['message_attachment'] && $config['allow_pm_attach']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', +					'S_PM_UNREAD'		=> ($row['pm_unread']) ? true : false,  					'S_PM_DELETED'		=> ($row['pm_deleted']) ? true : false,  					'S_PM_REPORTED'		=> (isset($row['report_id'])) ? true : false,  					'S_AUTHOR_DELETED'	=> ($row['author_id'] == ANONYMOUS) ? true : false, diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 16700c490c..d0cfa1ffd2 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -172,6 +172,8 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)  	// Number of "to" recipients  	$num_recipients = (int) preg_match_all('/:?(u|g)_([0-9]+):?/', $message_row['to_address'], $match); +	$bbcode_status	= ($config['allow_bbcode'] && $config['auth_bbcode_pm'] && $auth->acl_get('u_pm_bbcode')) ? true : false; +  	$template->assign_vars(array(  		'MESSAGE_AUTHOR_FULL'		=> get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),  		'MESSAGE_AUTHOR_COLOUR'		=> get_username_string('colour', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']), @@ -206,7 +208,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)  		'U_PM'			=> ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($user_info['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $author_id) : '',  		'U_WWW'			=> (!empty($user_info['user_website'])) ? $user_info['user_website'] : '', -		'U_ICQ'			=> ($user_info['user_icq']) ? 'http://www.icq.com/people/webmsg.php?to=' . urlencode($user_info['user_icq']) : '', +		'U_ICQ'			=> ($user_info['user_icq']) ? 'http://www.icq.com/people' . urlencode($user_info['user_icq']) . '/' : '',  		'U_AIM'			=> ($user_info['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=aim&u=' . $author_id) : '',  		'U_YIM'			=> ($user_info['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($user_info['user_yim']) . '&.src=pg' : '',  		'U_MSN'			=> ($user_info['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=msnm&u=' . $author_id) : '', @@ -229,6 +231,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)  		'S_AUTHOR_DELETED'	=> ($author_id == ANONYMOUS) ? true : false,  		'S_SPECIAL_FOLDER'	=> in_array($folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX)),  		'S_PM_RECIPIENTS'	=> $num_recipients, +		'S_BBCODE_ALLOWED'	=> ($bbcode_status) ? 1 : 0,  		'U_PRINT_PM'		=> ($config['print_pm'] && $auth->acl_get('u_pm_printpm')) ? "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=print" : '',  		'U_FORWARD_PM'		=> ($config['forward_pm'] && $auth->acl_get('u_sendpm') && $auth->acl_get('u_pm_forward')) ? "$url&mode=compose&action=forward&f=$folder_id&p=" . $message_row['msg_id'] : '') diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index cc8565e69d..13167b2b3d 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -65,7 +65,7 @@ class ucp_prefs  					$error = validate_data($data, array(  						'dateformat'	=> array('string', false, 1, 30), -						'lang'			=> array('match', false, '#^[a-z0-9_\-]{2,}$#i'), +						'lang'			=> array('language_iso_name'),  						'tz'			=> array('num', false, -14, 14),  					)); diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 7fd99da55a..13b9945851 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -56,7 +56,7 @@ class ucp_register  		{  			$use_lang = ($change_lang) ? basename($change_lang) : basename($user_lang); -			if (file_exists($user->lang_path . $use_lang . '/')) +			if (!validate_language_iso_name($use_lang))  			{  				if ($change_lang)  				{ @@ -210,7 +210,7 @@ class ucp_register  					array('email')),  				'email_confirm'		=> array('string', false, 6, 60),  				'tz'				=> array('num', false, -14, 14), -				'lang'				=> array('match', false, '#^[a-z_\-]{2,}$#i'), +				'lang'				=> array('language_iso_name'),  			));  			if (!check_form_key('ucp_register'))  | 
