Page Index Toggle Pages: [1] 2 
Topic Tools
Hot Topic (More than 10 Replies) Login tab from Reset password screen (Read 1,044 times)
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,170
Location: Earth

YaBB 2.6.0
Re: Login tab from Reset password screen
Reply #21 - Nov 6th, 2012 at 9:31pm
Post Tools
This Topic was moved here from YaBB 2 - Bugs [Need Verification] [move by] Dandello.
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,170
Location: Earth

YaBB 2.6.0
Re: Login tab from Reset password screen
Reply #20 - Aug 26th, 2012 at 3:42pm
Post Tools
It sometimes boggles me how interwoven everything is. Who'da thunk that putting an error catcher in shared login would break the revalidate session in Setup.pl?  Huh  Roll Eyes
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Derek Barnstorm
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline



Posts: 1,269
Location: United Kingdom

None
Re: Login tab from Reset password screen
Reply #19 - Aug 26th, 2012 at 3:09pm
Post Tools
Oops! Sorry - it should have been under the 'login' sub:

Code (Perl)
Select All
sub Login { 



And not the 'sharedLogin' sub.

I can't modify Reply #9 any more though to change it - maybe you can?

Embarrassed
  
Back to top
 
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,170
Location: Earth

YaBB 2.6.0
Re: Login tab from Reset password screen
Reply #18 - Aug 26th, 2012 at 4:45am
Post Tools
Um, I was testing Setup.pl and adding
Code
Select All
    if (!$iamguest) { &fatal_error("logged_in_already",$username); }  


beneath
Code
Select All
sub sharedLogin {  


breaks Setup.pl  Shocked
« Last Edit: Aug 26th, 2012 at 4:45am by Dandello »  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,170
Location: Earth

YaBB 2.6.0
Re: Login tab from Reset password screen
Reply #17 - Aug 24th, 2012 at 2:32pm
Post Tools
Sweet!  Smiley
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Derek Barnstorm
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline



Posts: 1,269
Location: United Kingdom

None
Re: Login tab from Reset password screen
Reply #16 - Aug 24th, 2012 at 2:19pm
Post Tools
And more...

If you don't enter any details or you enter details that don't exist, then it throws a 'Username / Password mismatch' error - obviously that doesn't make any sense.

In LogInOut.pl find:

Code (PHP)
Select All
    # generate random ID for password reset. 


And add before (needs the language edit from the above post):

Code (Perl)
Select All
    if (!$FORM{'user'}) { &fatal_error("", "$loginout_txt{'error_user_info'}"); } 


Find:

Code (Perl)
Select All
        if ($test_id) { $user = $test_id; }
        else { &fatal_error("bad_credentials"); } 


And replace with:

Code (Perl)
Select All
        if ($test_id) { $user = $test_id; }
        else { &fatal_error("", "$loginout_txt{'no_user_info_exists'}"); } 


And in Languages/English/LogInOut.lng find:

Code (Perl)
Select All
'wrong_char' => 'This character in the Password is invalid', 


And add after:

Code (Perl)
Select All
'no_user_info_exists' => 'The Username, Displayed Name or Email address which you entered does not exist on this forum.', 


« Last Edit: Aug 24th, 2012 at 2:23pm by Derek Barnstorm »  
Back to top
 
IP Logged
 
Derek Barnstorm
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline



Posts: 1,269
Location: United Kingdom

None
Re: Login tab from Reset password screen
Reply #15 - Aug 24th, 2012 at 1:37pm
Post Tools
If you want to be fussy and be consistent with other forms in YaBB, then you could also add a JS alert to the reminder page if the field is empty - save passing it it server side too.

In LogInOut.pl find:

Code (HTML)
Select All
<form action="$scripturl?action=reminder2" method="post"> 


And replace with:

Code (HTML)
Select All
<form action="$scripturl?action=reminder2" method="post" name="reminder" onsubmit="return CheckReminderField();"> 


Then find:

Code (HTML)
Select All
    <input type="submit" value="$loginout_txt{'339'}" class="button" />
    </td>
    </tr>
</table>
</form> 


And add after:

Code
Select All
<script type="text/javascript" language="JavaScript">
<!--
    document.reminder.user.focus();
   
    function CheckReminderField() {
        if (document.reminder.user.value == '') {
            alert("$loginout_txt{'error_user_info'}");
            document.reminder.user.focus();
        return false;
        }
        return true;
    }
//-->
</script> 


Then in Languages/English/LogInOut.lng find:

Code (Perl)
Select All
'wrong_char' => 'This character in the Password is invalid', 


And add after:

Code (Perl)
Select All
'error_user_info' => 'You must insert your Username, Displayed Name or Email address.', 


« Last Edit: Aug 24th, 2012 at 1:48pm by Derek Barnstorm »  
Back to top
 
IP Logged
 
Derek Barnstorm
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline



Posts: 1,269
Location: United Kingdom

None
Re: Login tab from Reset password screen
Reply #14 - Aug 24th, 2012 at 12:57pm
Post Tools
Okay. The best place to add it then would be Languages/English/Main.lng so that it can be re-used wherever.

Find:

Code (Perl)
Select All
'noscript' => 'You must enable JavaScript to get full functionality for this forum!', 


And add after:

Code (Perl)
Select All
'go_to_board' => 'Go to the Board Index', 


Then in Sources/LogInOut.pl change:

Code (HTML)
Select All
<br /><p align="center"><a href="$scripturl">$loginout_txt{'193'}</a></p><br /> 


To:

Code (HTML)
Select All
<br /><p align="center"><a href="$scripturl">$maintxt{'go_to_board'}</a></p><br /> 

  
Back to top
 
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,170
Location: Earth

YaBB 2.6.0
Re: Login tab from Reset password screen
Reply #13 - Aug 24th, 2012 at 4:57am
Post Tools
I like that solution.  Grin
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Derek Barnstorm
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline



Posts: 1,269
Location: United Kingdom

None
Re: Login tab from Reset password screen
Reply #12 - Aug 24th, 2012 at 12:06am
Post Tools
Actually, thinking about it, some users like to link directly to the reminder page from the tab menu or some other place, so using JS to go back two pages could potentially end up taking you to a page which isn't even on your own website - I think it's probably best just to leave it as it was linking to the board index - I'll remove that edit from Reply #2 now - my mistake!

The text should maybe be changed to "Go to the Board Index" though...
« Last Edit: Aug 24th, 2012 at 12:58pm by Derek Barnstorm »  
Back to top
 
IP Logged
 
Derek Barnstorm
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline



Posts: 1,269
Location: United Kingdom

None
Re: Login tab from Reset password screen
Reply #11 - Aug 23rd, 2012 at 11:52pm
Post Tools
Yep, seems good to me. Looks like I'd actually got a bit mixed up with the back link in the 'fatal_error' sub, so I'll leave it with you if you want to leave it as it was (linking to the board index) or use JS to go back. I guess it makes more sense your way though, seeing as it is a 'go back' link...
« Last Edit: Aug 23rd, 2012 at 11:54pm by Derek Barnstorm »  
Back to top
 
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,170
Location: Earth

YaBB 2.6.0
Re: Login tab from Reset password screen
Reply #10 - Aug 23rd, 2012 at 11:31pm
Post Tools
I love bug fixes.  Cheesy

But you might want to look at this:
Code (Javascript)
Select All
<a href="javascript:history.go(-1)"> 



From the password reminder confirmation screen it takes you one back - to the Reminder screen. Maybe it needs to be
Code (Javascript)
Select All
<a href="javascript:history.go(-2)"> 

to take you all the way back to where you asked for the password reminder? Just an observation.

  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Derek Barnstorm
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline



Posts: 1,269
Location: United Kingdom

None
Re: Login tab from Reset password screen
Reply #9 - Aug 23rd, 2012 at 11:09pm
Post Tools
On a related note, I don't think you should be able to access the login and reminder pages when you are logged in.

Still in Sources/LogInOut.pl find:

Code (Perl)
Select All
sub Login2 { 


And add after:

Code (Perl)
Select All
    if (!$iamguest) { &fatal_error("logged_in_already",$username); } 


Find:

Code (Perl)
Select All
sub Login { 


And add after:

Code (Perl)
Select All
    if (!$iamguest) { &fatal_error("logged_in_already",$username); } 


Find:

Code (Perl)
Select All
sub Reminder { 


And add after:

Code (Perl)
Select All
    if (!$iamguest) { &fatal_error("logged_in_already",$username); } 


Find:

Code (Perl)
Select All
sub Reminder2 { 


And add after:

Code (Perl)
Select All
    if (!$iamguest) { &fatal_error("logged_in_already",$username); } 


Edited:
Edited by Dandello to make a correction
« Last Edit: Aug 26th, 2012 at 3:38pm by Dandello »  
Back to top
 
IP Logged
 
Derek Barnstorm
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline



Posts: 1,269
Location: United Kingdom

None
Re: Login tab from Reset password screen
Reply #8 - Aug 23rd, 2012 at 10:55pm
Post Tools
Dandello wrote on Aug 23rd, 2012 at 10:51pm:
Not utterly convinced the sesredir is needed from that screen

That's the whole point in this line of code:

Code (Perl)
Select All
        $FORM{'sredir'} = '' if $FORM{'sredir'} =~ /action=(register|login2|reminder|reminder2)/; 


« Last Edit: Aug 23rd, 2012 at 10:56pm by Derek Barnstorm »  
Back to top
 
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,170
Location: Earth

YaBB 2.6.0
Re: Login tab from Reset password screen
Reply #7 - Aug 23rd, 2012 at 10:51pm
Post Tools
Not utterly convinced the sesredir is needed from that screen BUT, your solution no doubt breaks fewer things.  Wink
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: [1] 2 
Topic Tools
 
  « Board Index ‹ Board  ^Top