Explorar o código

!Don't show anything for registered members only when you change your email and it needs validation
Fixes #1191

Signed-off-by: Suki <[email protected]>

Suki %!s(int64=10) %!d(string=hai) anos
pai
achega
fdc43a7116

+ 1 - 10
Sources/Profile-Modify.php

@@ -3451,16 +3451,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');
 }
 
 /**

+ 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 - 3
Themes/default/languages/Profile.english.php

@@ -259,9 +259,6 @@ $txt['view_ips_by'] = 'View IPs used by';
 
 $txt['avatar_will_upload'] = 'Upload an avatar';
 
-$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';

+ 2 - 1
Themes/default/languages/index.english.php

@@ -754,7 +754,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';

+ 1 - 0
index.php

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