Trouble designing a new login page - fatal_lang_error

Started by PrimalPrime, June 22, 2023, 03:45:06 AM

Previous topic - Next topic

PrimalPrime

We get site can't be reached on login from our new custom landing page/login page when it redirects to /login2/. Can anyone help, please?

[22-Jun-2023 02:10:01 America/New_York] PHP Fatal error:  Uncaught Error: Call to undefined function fatal_lang_error() in /home/xxxxxx/public_html/Sources/Security.php:733
Stack trace:
#0 /home/xxxxxx/public_html/Sources/LogInOut.php(224): checkSession()
#1 /home/xxxxxx/public_html/index.php(170): Login2()
#2 {main}
  thrown in /home/xxxxxx/public_html/Sources/Security.php on line 733
[22-Jun-2023 02:10:02 America/New_York] PHP Warning:  Undefined array key "token" in /home/xxxxxx/public_html/index.php on line 333
[22-Jun-2023 02:10:02 America/New_York] PHP Warning:  Trying to access array offset on value of type null in /home/xxxxxx/public_html/index.php on line 333
[22-Jun-2023 02:10:02 America/New_York] PHP Warning:  Trying to access array offset on value of type null in /home/xxxxxx/public_html/index.php on line 333
[22-Jun-2023 02:10:02 America/New_York] PHP Warning:  Undefined array key "token" in /home/xxxxxx/public_html/index.php on line 333
[22-Jun-2023 02:10:02 America/New_York] PHP Warning:  Trying to access array offset on value of type null in /home/xxxxxx/public_html/index.php on line 333
[22-Jun-2023 02:10:02 America/New_York] PHP Warning:  Trying to access array offset on value of type null in /home/xxxxxx/public_html/index.php on line 333


// A session error occurred, show the error.
    elseif ($is_fatal)
    {
        if (isset($_GET['xml']))
        {
            ob_end_clean();
            send_http_status(403, 'Forbidden - Session timeout');
            die;
        }
        else
            fatal_lang_error($error, isset($log_error) ? 'user' : false);

Line 331-337 of our page:

echo '
                    <input type="hidden" name="', $_SESSION['session_var'], '" value="', $_SESSION['session_value'], '">
                    <input type="hidden" name="', $_SESSION['token']['post-login']
[o], '" value="', $_SESSION['token']['post-login'][3], '">
                    <script>
                        setTimeout(function() {
                            document.getElementById("', !empty($context['from_ajax']) ? 'ajax_' : '', isset($context['default_username']) && $context['default_username'] != '' ? 'loginpass' : 'loginuser', '").focus();
                        }, 150);';


Kindred

that error is not the real problem, it's triggering because of another problem.

We'd need the code of your "custom login page" and possibly your forum url...

I suspect that you did not properly load the SMF stuff that needs to be present in your custom page in order to work.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

PrimalPrime

I think we've made some headway. Everything seems to be working except for one link from the new page, the current home page. I believe this is because I wanted the forum to go to that page on login so my developer made it so. The site therefore defaults from index.php to index.php?room=main. So when you try to go to that room now on login the link is malformed,with an extra index.php?. Thus the link is https://mysite.com/index.phpindexphp?room=main instead of the proper link https://mysite.com/index.php?room=main

Could this line in .htcacess be the culprit? What would be my solution if so, pretty please?

RewriteRule ^(.*)$ index.php?seomod=$1 [L,QSA]

PrimalPrime

Well, I solved this issue but now when the page is made live, the forums load without the theme/stylesheet apparently. Another issue also. It's over my head.

Diego Andrés

Could load them manually like SSI and other pages:
<link rel="stylesheet" href="', $settings['default_theme_url'], '/css/index.css">
...
Or if you included Load.php
loadCSSFile('index.css', array( 'order_pos' => 1), 'smf_index');
...

SMF Tricks - Free & Premium Responsive Themes for SMF.

PrimalPrime

I'm not using the default theme but I tried adjusting your code for the path and filename to no avail. It fails to load the theme for the forums and attachments for the site as a whole. It seems to works fine until its made index.php. I will pay $100 an hour to solve it. I have more work too, if you want it.

Steve

As you have requested help in the Help Wanted - Not For Support board I'm closing this one down.

https://www.simplemachines.org/community/index.php?topic=586264.0
DO NOT pm me for support!

Advertisement: