davewood / mantis-basic-auth

BASIC AUTH for Mantis. (experimental)
Artistic License 2.0
2 stars 3 forks source link

Incompatibility with Source plugin? #4

Open palevi67 opened 5 years ago

palevi67 commented 5 years ago

https://github.com/mantisbt-plugins/source-integration/issues/316

dregad commented 5 years ago

I don't think it's caused by source integration. Seems to be the same issue as #3.

palevi67 commented 5 years ago

I think this is caused because $_SERVER['REMOTE_USER'] isn't set when mantisbt is called from command line, and some checking on user name is done somewhere in plugin logic. I have added the following lines at the start of the autologin() function, so nothing is done if $_SERVER['REMOTE_USER'] is missing, and now I get no errors:

    function autologin() {

        $t_remote_user = $_SERVER['REMOTE_USER'];
        if (empty($t_remote_user)) {
            return;
        }
    .....