Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Warning when attempting to login #4140

Open
eduardomozart opened this issue Jan 11, 2024 · 0 comments
Open

PHP Warning when attempting to login #4140

eduardomozart opened this issue Jan 11, 2024 · 0 comments

Comments

@eduardomozart
Copy link
Contributor

It doesn't happen all the time, and as I doesn't have a deeper understood how local auth works on DokuWiki, I wasn't able to track the issue. I'm using DokuWiki latest stable and I have PHP 8.2 with display_errors directive set to On, and sometimes when I access the https://wiki.example.com/doku.php?id=start after login the following message is shown on page header:

Warning: Undefined array key "user" in /home/robertinho/public_html/wiki/inc/auth.php on line 249

Warning: Cannot modify header information - headers already sent by (output started at /home/robertinho/public_html/wiki/inc/auth.php:249) in /home/robertinho/public_html/wiki/inc/auth.php on line 1262

Warning: Cannot modify header information - headers already sent by (output started at /home/robertinho/public_html/wiki/inc/auth.php:249) in /home/robertinho/public_html/wiki/inc/actions.php on line 38

It did redirect me to the https://wiki.example.com/doku.php?id=start page but when I try to access any link on the wiki I'm redirected to the login page again (it's a closed Wiki), so I login again and now I can access any Wiki link as expected.

I added the following code above the https://github.com/dokuwiki/dokuwiki/blob/master/inc/auth.php#L305:

                if($session['user'] !== $user) {
                    var_dump($session);
                }

The following output is shown when the PHP warning is triggered:

array(2) { ["buid"]=> string(64) "d9165bb75835ea4a8c09f8cd5ced2035467aadde376b5b7049da460ce113329b" ["time"]=> int(1704973941) }

For me the problem
seems to be on lines https://github.com/dokuwiki/dokuwiki/blob/master/inc/auth.php#L309-L310 because on the var_dump above it seems that $session['user'] and $session['pass'] array keys isn't set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant