Advertisement:
Anonymous Login
12-05-2016 07:48 PM

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003950SMF 2.0Templatepublic2010-05-09 06:35
ReporterSleePy 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusresolvedResolutionfixed 
Summary0003950: Weird profile template error
DescriptionRecently I have been seeing this logged on our site from guests
http://www.simplemachines.org/community/index.php?action=profile;area=account;save
Unable to load the 'account' template.

I have absolutely no clue how to reproduce this. The IPs associated with them are assigned to members.
I tried to hit that url as a guest. Nothing
I tried to clear my cookies and then hit that url (so I have no active sesion). Nothing.
I tried to login as a user, go to the account settings, then clear my cookies and submit that page. Also nothing.
Tags2.0 final, With Fix
Attached Files
  • patch file icon bug_3950.patch (2,962 bytes) 2010-05-07 08:52 -
    --- Sources/Profile-Modify.php	Thu Jan 15 11:14:12 1970
    +++ Sources/Profile-Modify.php	Thu Jan 15 11:14:12 1970
    @@ -2949,15 +2949,15 @@
     	$context['user']['is_logged'] = false;
     	$context['user']['is_guest'] = true;
     
     	// Send them to the done-with-registration-login screen.
     	loadTemplate('Register');
    -	$context += array(
    -		'page_title' => $txt['profile'],
    -		'sub_template' => 'after',
    -		'description' => $txt['activate_changed_email']
    -	);
    +
    +	$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();
     }
     
    --- Sources/Register.php	Thu Jan 15 11:14:12 1970
    +++ Sources/Register.php	Thu Jan 15 11:14:12 1970
    @@ -509,10 +509,11 @@
     		loadTemplate('Register');
     
     		$context += array(
     			'page_title' => $txt['register'],
     			'sub_template' => 'after',
    +			'title' => $txt['registration_successful'],
     			'description' => $modSettings['registration_method'] == 2 ? $txt['approval_after_registration'] : $txt['activate_after_registration']
     		);
     	}
     	else
     	{
    --- Themes/default/languages/Profile.english.php	Thu Jan 15 11:14:12 1970
    +++ Themes/default/languages/Profile.english.php	Thu Jan 15 11:14:12 1970
    @@ -207,13 +207,14 @@
     $txt['own_profile_confirm'] = 'Are you sure you want to delete your account?';
     $txt['view_ips_by'] = 'View IPs used by';
     
     $txt['avatar_will_upload'] = 'Upload an avatar';
     
    -// Use numeric entities in the below three strings.
    -$txt['activate_changed_email'] = '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['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';
     $txt['to_ask_password'] = 'to ask for your authentication details';
     
     $txt['user_email'] = 'Username/Email';
    --- Themes/default/Register.template.php	Thu Jan 15 11:14:12 1970
    +++ Themes/default/Register.template.php	Thu Jan 15 11:14:12 1970
    @@ -366,11 +366,11 @@
     
     	// Not much to see here, just a quick... "you're now registered!" or what have you.
     	echo '
     		<div id="registration_success">
     			<div class="cat_bar">
    -				<h3 class="catbg">', $txt['registration_successful'], '</h3>
    +				<h3 class="catbg">', $context['title'], '</h3>
     			</div>
     			<div class="windowbg">
     				<span class="topslice"><span></span></span>
     				<p class="content">', $context['description'], '</p>
     				<span class="botslice"><span></span></span>
    
    patch file icon bug_3950.patch (2,962 bytes) 2010-05-07 08:52 +

-Relationships
related to 0004404resolvedNorv undefined error when changing email address 
+Relationships

-Notes

bugnote:0011230

karlbenson (SMF Friend)

is this still occuring Sleepy?

bugnote:0011277

SleePy (Developer)

Yes it is. I for the life of me can't reproduce it either. I am getting it in multiple languages now.

bugnote:0011372

Arantor_old (Viewer)

Would it be possible to get at the raw access logs and see what URL(s) that guest was at beforehand?

bugnote:0011376

karlbenson (SMF Friend)

At a guess could it be related to
- deleting account
(with our w/o admins permission)

bugnote:0011601

TE (Viewer)

SleePy, is this still an issue after the site upgrade?

bugnote:0011607

SleePy (Developer)

Yes.. Although now they have user ids in the urls.
I will include the Info in a message marked private after this reply.

bugnote:0011820

groundup (SMF Friend)

Still waiting on some information from Sleepy or whomever was working on this.

bugnote:0011883

[SiNaN] (Viewer)

Last edited: 2010-05-07 08:54

...This took a lot of time of me to find the cause. Took 10 seconds to fix though. Oh, well!

The cause is the profileSendActivation() function for email address change input validation.

    $context += array(
        'page_title' => $txt['profile'],
        'sub_template' => 'after',
        'description' => $txt['activate_changed_email']
    );

It pushes sub template with += but it fails, obviously (it's already set in ModifyProfile() function as 'account' -the function name-) and obExit() at the end of the function exists before account() function is run, which sets the sub template to 'edit_options'.

And the reason we couldn't reproduce it easily was that the option "Require reactivation after email change" should have been set and since it isn't enabled by default, it was hard to catch. I'm not going to let these things pass through though. :P

Anyway, attached a patch fixing the issue.

bugnote:0011884

Norv (SMF Friend)

Nice job!

bugnote:0011902

[SiNaN] (Viewer)

& Correct sub template was not set for email activation notice on email change (Profile-Modify.php Register.php, Register template, Profile language file) Revision 9863
+Notes
MantisBT (Modified for SMF Intergration)[^] Copyright © 2000 - 2010 Mantis Group