Browse Source

Merge branch 'release-2.1' of git://github.com/SimpleMachines/SMF2.1.git into minor-stuff

Suki 11 years ago
parent
commit
51416af52f

+ 2 - 4
Sources/Load.php

@@ -1685,9 +1685,6 @@ function loadTheme($id_theme = 0, $initialize = true)
 	if (isset($modSettings['load_average']))
 		$context['load_average'] = $modSettings['load_average'];
 
-	// Set some permission related settings.
-	$context['show_login_bar'] = !empty($user_info['is_guest']) && !empty($modSettings['enableVBStyleLogin']);
-
 	// Detect the browser. This is separated out because it's also used in attachment downloads
 	detectBrowser();
 
@@ -2396,8 +2393,9 @@ function getLanguages($use_cache = true, $favor_utf8 = true)
 		// Default language directories to try.
 		$language_directories = array(
 			$settings['default_theme_dir'] . '/languages',
-			$settings['actual_theme_dir'] . '/languages',
 		);
+		if (!empty($settings['actual_theme_dir']) && $settings['actual_theme_dir'] != $settings['default_theme_dir'])
+			$language_directories[] = $settings['actual_theme_dir'] . '/languages';
 
 		// We possibly have a base theme directory.
 		if (!empty($settings['base_theme_dir']))

+ 6 - 0
Sources/LogInOut.php

@@ -43,6 +43,12 @@ function Login()
 		loadLanguage('Login');
 		loadTemplate('Login');
 		$context['sub_template'] = 'login';
+
+		if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')
+		{
+			$context['from_ajax'] = true;
+			$context['template_layers'] = array();
+		}
 	}
 
 	// Get the template ready.... not really much else to do.

+ 1 - 1
Sources/ManageBans.php

@@ -918,7 +918,7 @@ function saveTriggers($suggestions = array(), $ban_group, $member = 0, $ban_id =
  */
 function removeBanTriggers($items_ids = array(), $group_id = false)
 {
-	global $smcFunc;
+	global $smcFunc, $scripturl;
 
 	if ($group_id !== false)
 		$group_id = (int) $group_id;

+ 16 - 13
Sources/ManageServer.php

@@ -513,14 +513,14 @@ function ModifyLoadBalancingSettings($return_config = false)
 
 	// Set the default values for each option.
 	$default_values = array(
-		'loadavg_auto_opt' => '1.0',
-		'loadavg_search' => '2.5',
-		'loadavg_allunread' => '2.0',
-		'loadavg_unreadreplies' => '3.5',
-		'loadavg_show_posts' => '2.0',
-		'loadavg_userstats' => '10.0',
-		'loadavg_bbc' => '30.0',
-		'loadavg_forum' => '40.0',
+		'loadavg_auto_opt' => 1.0,
+		'loadavg_search' => 2.5,
+		'loadavg_allunread' => 2.0,
+		'loadavg_unreadreplies' => 3.5,
+		'loadavg_show_posts' => 2.0,
+		'loadavg_userstats' => 10.0,
+		'loadavg_bbc' => 30.0,
+		'loadavg_forum' => 40.0,
 	);
 
 	// Loop through the settings.
@@ -528,7 +528,7 @@ function ModifyLoadBalancingSettings($return_config = false)
 	{
 		// Use the default value if the setting isn't set yet.
 		$value = !isset($modSettings[$name]) ? $value : $modSettings[$name];
-		$config_vars[] = array('text', $name, 'value' => $value, 'disabled' => $disabled);
+		$config_vars[] = array('float', $name, 'value' => $value, 'disabled' => $disabled);
 	}
 
 	call_integration_hook('integrate_loadavg_settings', array(&$config_vars));
@@ -547,12 +547,15 @@ function ModifyLoadBalancingSettings($return_config = false)
 		{
 			if (strpos($key, 'loadavg') === 0 || $key === 'loadavg_enable')
 				continue;
-			elseif ($key == 'loadavg_auto_opt' && $value <= 1)
-				$_POST['loadavg_auto_opt'] = '1.0';
+			else
+				$_POST[$key] = (float) $value;
+
+			if ($key == 'loadavg_auto_opt' && $value <= 1)
+				$_POST['loadavg_auto_opt'] = 1.0;
 			elseif ($key == 'loadavg_forum' && $value < 10)
-				$_POST['loadavg_forum'] = '10.0';
+				$_POST['loadavg_forum'] = 10.0;
 			elseif ($value < 2)
-				$_POST[$key] = '2.0';
+				$_POST[$key] = 2.0;
 		}
 
 		call_integration_hook('integrate_save_loadavg_settings');

+ 0 - 1
Sources/ManageSettings.php

@@ -238,7 +238,6 @@ function ModifyLayoutSettings($return_config = false)
 			// Stuff that just is everywhere - today, search, online, etc.
 			array('select', 'todayMod', array($txt['today_disabled'], $txt['today_only'], $txt['yesterday_today'])),
 			array('check', 'onlineEnable'),
-			array('check', 'enableVBStyleLogin'),
 		'',
 			// This is like debugging sorta.
 			array('check', 'timeLoadPageEnable'),

+ 14 - 5
Sources/PersonalMessage.php

@@ -2703,7 +2703,7 @@ function MessageActionsApply()
 				// If this label is in the list and we're not adding it, remove it
 				if (array_key_exists($to_label[$row['id_pm']], $labels) && $type !== 'add')
 					unset($labels[$to_label[$row['id_pm']]]);
-				else if ($type !== 'remove')
+				else if ($type !== 'rem')
 					$labels[$to_label[$row['id_pm']]] = $to_label[$row['id_pm']];
 			}
 
@@ -2711,7 +2711,7 @@ function MessageActionsApply()
 			if ($type == 'rem' && empty($labels))
 				$in_inbox = 1;
 			// Adding new labels, but removing inbox and applying new ones
-			elseif($type == 'add' && !empty($options['pm_remove_inbox_label']) && !empty($labels))
+			elseif ($type == 'add' && !empty($options['pm_remove_inbox_label']) && !empty($labels))
 				$in_inbox = 0;
 			// Just adding it to the inbox
 			else
@@ -3242,7 +3242,7 @@ function ManageLabels()
 		// Deleting an existing label?
 		elseif (isset($_POST['delete'], $_POST['delete_label']))
 		{
-			foreach ($_POST['delete_label'] AS $label)
+			foreach ($_POST['delete_label'] AS $label => $dummy)
 			{
 				unset($the_labels[$label]);
 				$labels_to_remove[] = $label;
@@ -3315,14 +3315,23 @@ function ManageLabels()
 				DELETE FROM {db_prefix}pm_labels
 				WHERE id_label IN ({array_int:labels_to_delete})',
 				array(
-					'labels_to_delete' => $labels_to_delete,
+					'labels_to_delete' => $labels_to_remove,
+				)
+			);
+
+			// Now remove the now-deleted labels from any PMs...
+			$smcFunc['db_query']('', '
+				DELETE FROM {db_prefix}pm_labeled_messages
+				WHERE id_label IN ({array_int:labels_to_delete})',
+				array(
+					'labels_to_delete' => $labels_to_remove,
 				)
 			);
 
 			// Get any PMs with no labels which aren't in the inbox
 			$get_stranded_pms = $smcFunc['db_query']('', '
 				SELECT pmr.id_pm
-				FROM {db_prefix}pm_recipients
+				FROM {db_prefix}pm_recipients AS pmr
 					LEFT JOIN {db_prefix}pm_labeled_messages AS pml ON (pml.id_pm = pmr.id_pm)
 				WHERE pml.id_label IS NULL
 					AND pmr.in_inbox = {int:not_in_inbox}

+ 34 - 11
Sources/Profile-Modify.php

@@ -181,6 +181,15 @@ function loadProfileFields($force_reload = false)
 			'subtext' => $txt['valid_email'],
 			'log_change' => true,
 			'permission' => 'profile_password',
+			'js_submit' => !empty($modSettings['send_validation_onChange']) ? '
+	form_handle.addEventListener(\'submit\', function(event)
+	{
+		if (this.email_address.value != "'. $cur_profile['email_address'] .'")
+		{
+			alert('. JavaScriptEscape($txt['email_change_logout']) .');
+			return true;
+		}
+	}, false);' : '',
 			'input_validate' => create_function('&$value', '
 				global $context, $old_profile, $profile_vars, $sourcedir, $modSettings;
 
@@ -783,6 +792,29 @@ function setupProfileContext($fields)
 		}
 	}
 
+	// Some spicy JS.
+	addInlineJavascript('
+	var form_handle = document.forms.creator;
+	createEventListener(form_handle);
+	'. (!empty($context['require_password']) ? '
+	form_handle.addEventListener(\'submit\', function(event)
+	{
+		if (this.oldpasswrd.value == "")
+		{
+			event.preventDefault();
+			alert('. (JavaScriptEscape($txt['required_security_reasons'])) .');
+			return false;
+		}
+	}, false);' : ''), true);
+
+	// Any onsubmit javascript?
+	if (!empty($context['profile_onsubmit_javascript']))
+		addInlineJavascript($context['profile_onsubmit_javascript'], true);
+
+	// Any totally custom stuff?
+	if (!empty($context['profile_javascript']))
+		addInlineJavascript($context['profile_javascript'], true);
+
 	// Free up some memory.
 	unset($profile_fields);
 }
@@ -2829,7 +2861,7 @@ function profileLoadAvatarData()
 
 	// Second level selected avatar...
 	$context['avatar_selected'] = substr(strrchr($context['member']['avatar']['server_pic'], '/'), 1);
-	return true;
+	return !empty($context['member']['avatar']['allow_server_stored']) || !empty($context['member']['avatar']['allow_external']) || !empty($context['member']['avatar']['allow_upload']);
 }
 
 /**
@@ -3471,16 +3503,7 @@ function profileSendActivation()
 	$context['user']['is_logged'] = false;
 	$context['user']['is_guest'] = true;
 
-	// Send them to the done-with-registration-login screen.
-	loadTemplate('Register');
-
-	$context['page_title'] = $txt['profile'];
-	$context['sub_template'] = 'after';
-	$context['title'] = $txt['activate_changed_email_title'];
-	$context['description'] = $txt['activate_changed_email_desc'];
-
-	// We're gone!
-	obExit();
+	redirectexit('action=sendactivation');
 }
 
 /**

+ 1 - 1
Sources/Profile.php

@@ -906,7 +906,7 @@ function loadCustomFields($memID, $area = 'summary')
 		}
 		elseif ($row['field_type'] == 'text')
 		{
-			$input_html = '<input type="text" name="customfield[' . $row['col_name'] . ']" id="customfield[' . $row['col_name'] . ']"' . ($row['field_length'] != 0 ? 'maxlength="' . $row['field_length'] . '"' : '') . ' size="' . ($row['field_length'] == 0 || $row['field_length'] >= 50 ? 50 : ($row['field_length'] > 30 ? 30 : ($row['field_length'] > 10 ? 20 : 10))) . '" value="' . $value . '" class="input_text"' . $row['show_reg'] == 2 ? ' required' : '' . '>';
+			$input_html = '<input type="text" name="customfield[' . $row['col_name'] . ']" id="customfield[' . $row['col_name'] . ']"' . ($row['field_length'] != 0 ? 'maxlength="' . $row['field_length'] . '"' : '') . ' size="' . ($row['field_length'] == 0 || $row['field_length'] >= 50 ? 50 : ($row['field_length'] > 30 ? 30 : ($row['field_length'] > 10 ? 20 : 10))) . '" value="' . $value . '" class="input_text"' . ($row['show_reg'] == 2 ? ' required' : '') . '>';
 		}
 		else
 		{

+ 23 - 0
Sources/Register.php

@@ -882,4 +882,27 @@ function RegisterCheckUsername()
 	$context['valid_username'] = empty($errors);
 }
 
+/**
+ * It doesn't actually send anything, this action just shows a message for a guest.
+ *
+ */
+function SendActivation()
+{
+	global $context, $txt;
+
+	$context['user']['is_logged'] = false;
+	$context['user']['is_guest'] = true;
+
+	// Send them to the done-with-registration-login screen.
+	loadTemplate('Register');
+
+	$context['page_title'] = $txt['profile'];
+	$context['sub_template'] = 'after';
+	$context['title'] = $txt['activate_changed_email_title'];
+	$context['description'] = $txt['activate_changed_email_desc'];
+
+	// We're gone!
+	obExit();
+}
+
 ?>

+ 0 - 12
Sources/Subs.php

@@ -2841,7 +2841,6 @@ function setupThemeContext($forceload = false)
 	$context['in_maintenance'] = !empty($maintenance);
 	$context['current_time'] = timeformat(time(), false);
 	$context['current_action'] = isset($_GET['action']) ? $smcFunc['htmlspecialchars']($_GET['action']) : '';
-	$context['show_quick_login'] = !empty($modSettings['enableVBStyleLogin']) && $user_info['is_guest'];
 
 	// Get some news...
 	$context['news_lines'] = array_filter(explode("\n", str_replace("\r", '', trim(addslashes($modSettings['news'])))));
@@ -2913,9 +2912,6 @@ function setupThemeContext($forceload = false)
 	// Setup the main menu items.
 	setupMenuContext();
 
-	if (empty($settings['theme_version']))
-		$context['show_vBlogin'] = $context['show_quick_login'];
-
 	// This is here because old index templates might still use it.
 	$context['show_news'] = !empty($settings['enable_news']);
 
@@ -3224,7 +3220,6 @@ function template_footer()
 
 	foreach (array_reverse($context['template_layers']) as $layer)
 		loadSubTemplate($layer . '_below', true);
-
 }
 
 /**
@@ -3834,13 +3829,6 @@ function setupMenuContext()
 					),
 				),
 			),
-			'login' => array(
-				'title' => $txt['login'],
-				'href' => $scripturl . '?action=login',
-				'show' => $user_info['is_guest'],
-				'sub_buttons' => array(
-				),
-			),
 			'register' => array(
 				'title' => $txt['register'],
 				'href' => $scripturl . '?action=register',

+ 2 - 2
Themes/default/BoardIndex.template.php

@@ -407,7 +407,7 @@ function template_ic_block_stats()
 
 function template_ic_block_online()
 {
-	global $context, $scripturl, $txt, $modSettings;
+	global $context, $scripturl, $txt, $modSettings, $settings;
 	// "Users online" - in order of activity.
 	echo '
 			<div class="title_barIC">
@@ -444,7 +444,7 @@ function template_ic_block_online()
 		// Showing membergroups?
 		if (!empty($settings['show_group_key']) && !empty($context['membergroups']))
 			echo '
-				<span class="membergroups">[' . implode(',&nbsp;', $context['membergroups']). ']</span>';
+				<span class="membergroups">' . implode(',&nbsp;', $context['membergroups']). '</span>';
 	}
 
 	echo '

+ 44 - 37
Themes/default/Login.template.php

@@ -18,69 +18,76 @@ function template_login()
 	echo '
 		<script src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>
 
-		<form action="', $scripturl, '?action=login2" name="frmLogin" id="frmLogin" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\', \'' . (!empty($context['login_token']) ? $context['login_token'] : '') . '\');"' : '', '>
 		<div class="tborder login">
 			<div class="cat_bar">
 				<h3 class="catbg">
 					<img src="', $settings['images_url'], '/icons/login_hd.png" alt="" class="icon"> ', $txt['login'], '
 				</h3>
 			</div>
-			<div class="roundframe">';
+			<div class="roundframe">
+				<form class="login" action="', $scripturl, '?action=login2" name="frmLogin" id="frmLogin" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\', \'' . (!empty($context['login_token']) ? $context['login_token'] : '') . '\');"' : '', '>';
 
 	// Did they make a mistake last time?
 	if (!empty($context['login_errors']))
 		echo '
-			<p class="errorbox">', implode('<br>', $context['login_errors']), '</p><br>';
+					<p class="errorbox">', implode('<br>', $context['login_errors']), '</p><br>';
 
 	// Or perhaps there's some special description for this time?
 	if (isset($context['description']))
 		echo '
-				<p class="description">', $context['description'], '</p>';
+					<p class="description">', $context['description'], '</p>';
 
 	// Now just get the basic information - username, password, etc.
 	echo '
-				<dl>
-					<dt>', $txt['username'], ':</dt>
-					<dd><input type="text" name="user" size="20" value="', $context['default_username'], '" class="input_text"></dd>
-					<dt>', $txt['password'], ':</dt>
-					<dd><input type="password" name="passwrd" value="', $context['default_password'], '" size="20" class="input_password"></dd>
-				</dl>';
+					<dl>
+						<dt>', $txt['username'], ':</dt>
+						<dd><input type="text" id="', !empty($context['from_ajax']) ? 'ajax_' : '', 'loginuser" name="user" size="20" value="', $context['default_username'], '" class="input_text"></dd>
+						<dt>', $txt['password'], ':</dt>
+						<dd><input type="password" id="', !empty($context['from_ajax']) ? 'ajax_' : '', 'loginpass" name="passwrd" value="', $context['default_password'], '" size="20" class="input_password"></dd>
+					</dl>';
 
 	if (!empty($modSettings['enableOpenID']))
-		echo '<p><strong>&mdash;', $txt['or'], '&mdash;</strong></p>
-				<dl>
-					<dt>', $txt['openid'], ':</dt>
-					<dd><input type="text" name="openid_identifier" class="input_text openid_login" size="17">&nbsp;<a href="', $scripturl, '?action=helpadmin;help=register_openid" onclick="return reqOverlayDiv(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" alt="', $txt['help'], '" class="centericon"></a></dd>
-				</dl>
-				<hr>';
+		echo '
+					<p><strong>&mdash;', $txt['or'], '&mdash;</strong></p>
+					<dl>
+						<dt>', $txt['openid'], ':</dt>
+						<dd><input type="text" name="openid_identifier" class="input_text openid_login" size="17">&nbsp;<a href="', $scripturl, '?action=helpadmin;help=register_openid" onclick="return reqOverlayDiv(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics.png" alt="', $txt['help'], '" class="centericon"></a></dd>
+					</dl>
+					<hr>';
 
 	echo '
-				<dl>
-					<dt>', $txt['mins_logged_in'], ':</dt>
-					<dd><input type="number" name="cookielength" size="4" maxlength="4" value="', $modSettings['cookieTime'], '"', $context['never_expire'] ? ' disabled' : '', ' class="input_text"></dd>
-					<dt>', $txt['always_logged_in'], ':</dt>
-					<dd><input type="checkbox" name="cookieneverexp"', $context['never_expire'] ? ' checked' : '', ' class="input_check" onclick="this.form.cookielength.disabled = this.checked;"></dd>';
+					<dl>
+						<dt>', $txt['mins_logged_in'], ':</dt>
+						<dd><input type="number" name="cookielength" size="4" maxlength="4" value="', $modSettings['cookieTime'], '"', $context['never_expire'] ? ' disabled' : '', ' class="input_text"></dd>
+						<dt>', $txt['always_logged_in'], ':</dt>
+						<dd><input type="checkbox" name="cookieneverexp"', $context['never_expire'] ? ' checked' : '', ' class="input_check" onclick="this.form.cookielength.disabled = this.checked;"></dd>';
 	// If they have deleted their account, give them a chance to change their mind.
 	if (isset($context['login_show_undelete']))
 		echo '
-					<dt class="alert">', $txt['undelete_account'], ':</dt>
-					<dd><input type="checkbox" name="undelete" class="input_check"></dd>';
+						<dt class="alert">', $txt['undelete_account'], ':</dt>
+						<dd><input type="checkbox" name="undelete" class="input_check"></dd>';
 	echo '
-				</dl>
-				<p><input type="submit" value="', $txt['login'], '" class="button_submit"></p>
-				<p class="smalltext"><a href="', $scripturl, '?action=reminder">', $txt['forgot_your_password'], '</a></p>
-				<input type="hidden" name="hash_passwrd" value="">
-				<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
-				<input type="hidden" name="', $context['login_token_var'], '" value="', $context['login_token'], '">
-			</div>
-		</div>
-		</form>';
-
-	// Focus on the correct input - username or password.
+					</dl>
+					<p><input type="submit" value="', $txt['login'], '" class="button_submit"></p>
+					<p class="smalltext"><a href="', $scripturl, '?action=reminder">', $txt['forgot_your_password'], '</a></p>
+					<input type="hidden" name="hash_passwrd" value="">
+					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
+					<input type="hidden" name="', $context['login_token_var'], '" value="', $context['login_token'], '">
+					<script>
+						setTimeout(function() {
+							document.getElementById("', !empty($context['from_ajax']) ? 'ajax_' : '', isset($context['default_username']) && $context['default_username'] != '' ? 'loginpass' : 'loginuser', '").focus();
+						}, 150);
+					</script>
+				</form>';
+
+	// It is a long story as to why we have this when we're clearly not going to use it.
+	if (!empty($context['from_ajax']))
+		echo '
+					<br>
+					<a href="javascript:self.close();"></a>';
 	echo '
-		<script><!-- // --><![CDATA[
-			document.forms.frmLogin.', isset($context['default_username']) && $context['default_username'] != '' ? 'passwrd' : 'user', '.focus();
-		// ]]></script>';
+			</div>
+		</div>';
 }
 
 // Tell a guest to get lost or login!

+ 4 - 4
Themes/default/ManageMembers.template.php

@@ -92,7 +92,7 @@ function template_search_members()
 									</select>
 								</dt>
 								<dd>
-									<input type="text" name="last_online" id="last_online" value="" size="10" class="input_text"><span class="smalltext">', $txt['date_format'], '</span>
+									<input type="date" name="last_online" id="last_online" value="" size="10" class="input_text"><span class="smalltext">', $txt['date_format'], '</span>
 								</dd>
 							</dl>
 						</div>
@@ -108,13 +108,13 @@ function template_search_members()
 									<strong><label for="email">', $txt['email_address'], ':</label></strong>
 								</dt>
 								<dd>
-									<input type="text" name="email" id="email" value="" class="input_text">
+									<input type="email" name="email" id="email" value="" class="input_text">
 								</dd>
 								<dt class="righttext">
 									<strong><label for="website">', $txt['website'], ':</label></strong>
 								</dt>
 								<dd>
-									<input type="text" name="website" id="website" value="" class="input_text">
+									<input type="url" name="website" id="website" value="" class="input_text">
 								</dd>
 								<dt class="righttext">
 									<strong><label for="location">', $txt['location'], ':</label></strong>
@@ -132,7 +132,7 @@ function template_search_members()
 									<strong><label for="messenger">', $txt['messenger_address'], ':</label></strong>
 								</dt>
 								<dd>
-									<input type="number" name="messenger" id="messenger" value="" class="input_text">
+									<input type="text" name="messenger" id="messenger" value="" class="input_text">
 								</dd>
 							</dl>
 						</div>

+ 1 - 33
Themes/default/Profile.template.php

@@ -1300,7 +1300,7 @@ function template_edit_options()
 
 	// The main header!
 	echo '
-		<form action="', (!empty($context['profile_custom_submit_url']) ? $context['profile_custom_submit_url'] : $scripturl . '?action=profile;area=' . $context['menu_item_selected'] . ';u=' . $context['id_member']), '" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator" enctype="multipart/form-data" onsubmit="return checkProfileSubmit();">
+		<form action="', (!empty($context['profile_custom_submit_url']) ? $context['profile_custom_submit_url'] : $scripturl . '?action=profile;area=' . $context['menu_item_selected'] . ';u=' . $context['id_member']), '" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator" enctype="multipart/form-data">
 			<div class="cat_bar">
 				<h3 class="catbg">
 					<img src="', $settings['images_url'], '/icons/profile_hd.png" alt="" class="icon">';
@@ -1504,38 +1504,6 @@ function template_edit_options()
 			</div>
 		</form>';
 
-	// Some javascript!
-	echo '
-		<script><!-- // --><![CDATA[
-			function checkProfileSubmit()
-			{';
-
-	// If this part requires a password, make sure to give a warning.
-	if ($context['require_password'])
-		echo '
-				// Did you forget to type your password?
-				if (document.forms.creator.oldpasswrd.value == "")
-				{
-					alert("', $txt['required_security_reasons'], '");
-					return false;
-				}';
-
-	// Any onsubmit javascript?
-	if (!empty($context['profile_onsubmit_javascript']))
-		echo '
-				', $context['profile_javascript'];
-
-	echo '
-			}';
-
-	// Any totally custom stuff?
-	if (!empty($context['profile_javascript']))
-		echo '
-			', $context['profile_javascript'];
-
-	echo '
-		// ]]></script>';
-
 	// Any final spellchecking stuff?
 	if (!empty($context['show_spellchecking']))
 		echo '

+ 9 - 0
Themes/default/css/index.css

@@ -1949,6 +1949,12 @@ ul#smfFadeScroller li {
 #upshrinkHeaderIC span.membergroups {
 	display: block;
 }
+#upshrinkHeaderIC span.membergroups:before {
+	content: '[';
+}
+#upshrinkHeaderIC span.membergroups:after {
+	content: ']';
+}
 #upshrinkHeaderIC p.last {
 	border-top: double #ddd;
 	padding-bottom: 0;
@@ -2845,6 +2851,9 @@ fieldset.merge_options {
 	width: 540px;
 	margin: 0 auto;
 }
+.popup_content .login {
+	width: 100%;
+}
 .login dl {
 	overflow: auto;
 	clear: right;

+ 3 - 38
Themes/default/index.template.php

@@ -195,7 +195,7 @@ function template_body_above()
 	else
 		echo '
 			<ul class="floatleft welcome">
-				<li>', sprintf($txt[$context['can_register'] ? 'welcome_guest_register' : 'welcome_guest'], $txt['guest_title'], $scripturl . '?action=login'), '</li>
+				<li>', sprintf($txt[$context['can_register'] ? 'welcome_guest_register' : 'welcome_guest'], $txt['guest_title'], $context['forum_name'], $scripturl . '?action=login', 'return reqOverlayDiv(this.href, ' . JavaScriptEscape($txt['login']) . ');', $scripturl . '?action=register'), '</li>
 			</ul>';
 
 	if ($context['allow_search'])
@@ -263,43 +263,8 @@ function template_body_above()
 		<div id="upper_section">
 			<div id="inner_section">
 				<div id="inner_wrap">
-					<div class="user">';
-
-	// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
-	if (!empty($context['show_login_bar']))
-	{
-		echo '
-						<script src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>
-						<form id="guest_form" action="', $scripturl, '?action=login2;quicklogin" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\', \'' . (!empty($context['login_token']) ? $context['login_token'] : '') . '\');"' : '', '>
-							<input type="text" name="user" size="10" class="input_text">
-							<input type="password" name="passwrd" size="10" class="input_password">
-							<select name="cookielength">
-								<option value="60">', $txt['one_hour'], '</option>
-								<option value="1440">', $txt['one_day'], '</option>
-								<option value="10080">', $txt['one_week'], '</option>
-								<option value="43200">', $txt['one_month'], '</option>
-								<option value="-1" selected>', $txt['forever'], '</option>
-							</select>
-							<input type="submit" value="', $txt['login'], '" class="button_submit">
-							<div>', $txt['quick_login_dec'], '</div>';
-
-		if (!empty($modSettings['enableOpenID']))
-			echo '
-							<br><input type="text" name="openid_identifier" size="25" class="input_text openid_login">';
-
-		echo '
-							<input type="hidden" name="hash_passwrd" value="">
-							<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
-							<input type="hidden" name="', $context['login_token_var'], '" value="', $context['login_token'], '">
-						</form>';
-	}
-	else
-	{
-		echo '
-						', $context['current_time'];
-	}
-
-	echo'
+					<div class="user">
+						', $context['current_time'], '
 					</div>';
 	// Show a random news item? (or you could pick one from news_lines...)
 	if (!empty($settings['enable_news']) && !empty($context['random_news_line']))

+ 0 - 1
Themes/default/languages/Help.english.php

@@ -256,7 +256,6 @@ $helptxt['pollMode'] = 'This selects whether polls are enabled or not. If polls
 		from the topic listing. You can choose to continue to show the regular topic without their polls by selecting
 		&quot;Show Existing Polls as Topics&quot;.<br><br>To choose who can post polls, view polls, and similar, you
 		can allow and disallow those permissions. Remember this if polls are not working.';
-$helptxt['enableVBStyleLogin'] = 'This will show a more compact login on every page of the forum for guests.';
 $helptxt['enableCompressedOutput'] = 'This option will compress output to lower bandwidth consumption, but it requires
 		zlib to be installed.';
 $helptxt['disableTemplateEval'] = 'By default, templates are evaluated instead of just included. This helps with showing more useful debug information in case a template contains an error.<br><br>

+ 0 - 1
Themes/default/languages/ManageSettings.english.php

@@ -82,7 +82,6 @@ $txt['today_disabled'] = 'Disabled';
 $txt['today_only'] = 'Only Today';
 $txt['yesterday_today'] = 'Today &amp; Yesterday';
 $txt['onlineEnable'] = 'Show online/offline in posts and PMs';
-$txt['enableVBStyleLogin'] = 'Show a quick login on every page';
 $txt['defaultMaxMembers'] = 'Members per page in member list';
 $txt['timeLoadPageEnable'] = 'Display time taken to create every page';
 $txt['disableHostnameLookup'] = 'Disable hostname lookups';

+ 1 - 3
Themes/default/languages/Profile.english.php

@@ -61,6 +61,7 @@ $txt['invalid_registration'] = 'Invalid Date Registered value, valid example:';
 $txt['current_password'] = 'Current Password';
 // Don't use entities in the below string, except the main ones. (lt, gt, quot.)
 $txt['required_security_reasons'] = 'For security reasons, your current password is required to make changes to your account.';
+$txt['email_change_logout'] = 'Since you decided to change your email, you will need to reactivate your account. You will now be logged out.';
 
 $txt['timeoffset_autodetect'] = 'auto detect';
 
@@ -261,9 +262,6 @@ $txt['avatar_max_size_wh'] = 'Max size: %1$spx by %2$spx';
 $txt['avatar_max_size_w'] = 'Max size: %1$spx wide';
 $txt['avatar_max_size_h'] = 'Max size: %2$spx high';
 
-$txt['activate_changed_email_title'] = 'Email Address Changed';
-$txt['activate_changed_email_desc'] = 'You\'ve changed your email address. In order to validate this address you will receive an email. Click the link in that email to reactivate your account.';
-
 // Use numeric entities in the below three strings.
 $txt['no_reminder_email'] = 'Unable to send reminder email.';
 $txt['send_email'] = 'Send an email to';

+ 5 - 4
Themes/default/languages/index.english.php

@@ -209,10 +209,10 @@ $txt['female'] = 'Female';
 
 $txt['error_invalid_characters_username'] = 'Invalid character used in Username.';
 
-$txt['welcome_guest'] = 'Welcome, <strong>%1$s</strong>. Please <a href="%2$s">login</a>.';
+$txt['welcome_guest'] = 'Welcome, <strong>%1$s</strong>. Please <a href="%3$s" onclick="%4$s">login</a>.';
 
 //$txt['welcome_guest_register'] = 'Welcome, <strong>%1$s</strong>. Please <a href="' . $scripturl . '?action=login">login</a> or <a href="' . $scripturl . '?action=register">register</a>.';
-$txt['welcome_guest_register'] = 'Welcome to <strong>' . $context['forum_name'] . '</strong>. Please <a href="' . $scripturl . '?action=login">login</a> or <a href="' . $scripturl . '?action=register">register</a>.';
+$txt['welcome_guest_register'] = 'Welcome to <strong>%2$s</strong>. Please <a href="%3$s" onclick="%4$s">login</a> or <a href="%5$s">register</a>.';
 
 $txt['please_login'] = 'Please <a href="' . $scripturl . '?action=login">login</a>.';
 $txt['login_or_register'] = 'Please <a href="' . $scripturl . '?action=login">login</a> or <a href="' . $scripturl . '?action=register">register</a>.';
@@ -762,7 +762,8 @@ $txt['summary'] = 'Summary';
 $txt['account'] = 'Account Settings';
 $txt['theme'] = 'Look and Layout';
 $txt['forumprofile'] = 'Forum Profile';
-
+$txt['activate_changed_email_title'] = 'Email Address Changed';
+$txt['activate_changed_email_desc'] = 'You\'ve changed your email address. In order to validate this address you will receive an email. Click the link in that email to reactivate your account.';
 $txt['modSettings_title'] = 'Features and Options';
 $txt['package'] = 'Package Manager';
 $txt['errlog'] = 'Error Log';
@@ -826,4 +827,4 @@ $txt['debug_browser'] = 'Browser ID: ';
 $txt['debug_hooks'] = 'Hooks called: ';
 $txt['debug_instances'] = 'Instances created: ';
 $txt['are_sure_mark_read'] = 'Are you sure you want to mark messages as read?';
-?>
+?>

+ 1 - 0
index.php

@@ -334,6 +334,7 @@ function smf_main()
 		'restoretopic' => array('RemoveTopic.php', 'RestoreTopic'),
 		'search' => array('Search.php', 'PlushSearch1'),
 		'search2' => array('Search.php', 'PlushSearch2'),
+		'sendactivation' => array('Register.php', 'SendActivation'),
 		'smstats' => array('Stats.php', 'SMStats'),
 		'suggest' => array('Subs-Editor.php', 'AutoSuggestHandler'),
 		'spellcheck' => array('Subs-Post.php', 'SpellCheck'),

+ 0 - 1
other/install_2-1_mysql.sql

@@ -1706,7 +1706,6 @@ VALUES ('smfVersion', '{$smf_version}'),
 	('karmaTimeRestrictAdmins', '1'),
 	('enablePreviousNext', '1'),
 	('pollMode', '1'),
-	('enableVBStyleLogin', '1'),
 	('enableCompressedOutput', '{$enableCompressedOutput}'),
 	('karmaWaitTime', '1'),
 	('karmaMinPosts', '0'),

+ 0 - 1
other/install_2-1_postgresql.sql

@@ -2217,7 +2217,6 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('karmaMode', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('karmaTimeRestrictAdmins', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('enablePreviousNext', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('pollMode', '1');
-INSERT INTO {$db_prefix}settings (variable, value) VALUES ('enableVBStyleLogin', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('enableCompressedOutput', '{$enableCompressedOutput}');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('karmaWaitTime', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('karmaMinPosts', '0');

+ 0 - 1
other/install_2-1_sqlite.sql

@@ -1849,7 +1849,6 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('karmaMode', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('karmaTimeRestrictAdmins', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('enablePreviousNext', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('pollMode', '1');
-INSERT INTO {$db_prefix}settings (variable, value) VALUES ('enableVBStyleLogin', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('enableCompressedOutput', '{$enableCompressedOutput}');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('karmaWaitTime', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('karmaMinPosts', '0');

+ 0 - 1
other/install_2-1_sqlite3.sql

@@ -1849,7 +1849,6 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('karmaMode', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('karmaTimeRestrictAdmins', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('enablePreviousNext', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('pollMode', '1');
-INSERT INTO {$db_prefix}settings (variable, value) VALUES ('enableVBStyleLogin', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('enableCompressedOutput', '{$enableCompressedOutput}');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('karmaWaitTime', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('karmaMinPosts', '0');

+ 1 - 1
other/upgrade_2-1_mysql.sql

@@ -777,7 +777,7 @@ WHERE variable = 'avatar_action_too_large'
 
 ---# Cleaning up old settings.
 DELETE FROM {$db_prefix}settings
-WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_registration', 'attachmentEncryptFilenames', 'hotTopicPosts', 'hotTopicVeryPosts', 'fixLongWords', 'admin_features', 'topbottomEnable', 'simpleSearch');
+WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_registration', 'attachmentEncryptFilenames', 'hotTopicPosts', 'hotTopicVeryPosts', 'fixLongWords', 'admin_features', 'topbottomEnable', 'simpleSearch', 'enableVBStyleLogin');
 ---#
 
 ---# Cleaning up old theme settings.

+ 1 - 1
other/upgrade_2-1_postgresql.sql

@@ -856,7 +856,7 @@ WHERE variable = 'avatar_action_too_large'
 
 ---# Cleaning up old settings.
 DELETE FROM {$db_prefix}settings
-WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_registration', 'attachmentEncryptFilenames', 'hotTopicPosts', 'hotTopicVeryPosts', 'fixLongWords', 'admin_features', 'topbottomEnable', 'simpleSearch');
+WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_registration', 'attachmentEncryptFilenames', 'hotTopicPosts', 'hotTopicVeryPosts', 'fixLongWords', 'admin_features', 'topbottomEnable', 'simpleSearch', 'enableVBStyleLogin');
 ---#
 
 ---# Cleaning up old theme settings.

+ 1 - 1
other/upgrade_2-1_sqlite.sql

@@ -847,7 +847,7 @@ WHERE variable = 'avatar_action_too_large'
 
 ---# Cleaning up old settings.
 DELETE FROM {$db_prefix}settings
-WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_registration', 'attachmentEncryptFilenames', 'hotTopicPosts', 'hotTopicVeryPosts', 'fixLongWords', 'admin_features', 'topbottomEnable', 'simpleSearch');
+WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_registration', 'attachmentEncryptFilenames', 'hotTopicPosts', 'hotTopicVeryPosts', 'fixLongWords', 'admin_features', 'topbottomEnable', 'simpleSearch', 'enableVBStyleLogin');
 ---#
 
 ---# Cleaning up old theme settings.