Page Index Toggle Pages: 1 [2] 
Topic Tools
Hot Topic (More than 10 Replies) Login tab from Reset password screen (Read 1,820 times)
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 #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
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,368
Location: Earth

YaBB 2.6.1
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
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,368
Location: Earth

YaBB 2.6.1
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
 
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,368
Location: Earth

YaBB 2.6.1
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
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,368
Location: Earth

YaBB 2.6.1
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
 
Page Index Toggle Pages: 1 [2] 
Topic Tools
 
  « Board Index ‹ Board  ^Top