Using the admin page, I set an option to allow users to skip login if they already had a session running on our main site. At least, that was my understanding of the setting. Unfortunately, I can no longer access the admin page to check the exact name of the setting.
I entered in the text field:
$_SESSION['username']
I did that because that is the name of the session variable used on our main site for the email address.
There was also a dropdown box to choose whether to use, Env, CGI or both types of login. I chose both, just to be safe until I knew that 'Env' was configured correctly.
After saving the settings, I logged into our main site and then leaving that open, went directly to Bugzilla, which produced the following error:
Bugzilla has suffered an internal error. Please save this page and send it to [email protected] with details of what you were doing at the time this message appeared.
URL: http://bugs.XXXXXXXXXX.com/admin.cgi Bugzilla did not receive an email address from the environment. This means that the '$_SESSION['username']' environment variable was empty or did not exist.
I then tried to go to the standard login page, but encountered the same error.
Next I attempted to locate the string '$_SESSION['username']' in both the file system and in the database, but can't find it.
I checked my localconfig file and it just contains the database access credentials. There is some talk about a 'data' directory online, but I don't seem to have that. Does anyone have any suggestions how I can recover from this please?
I resolved this by editing the file which for me was at "/usr/share/bugzilla/Bugzilla/Auth/Login/Env.pm".
I added the line below:
my $env_email = '[email protected]';
immediately after the line which says:
my $env_realname = $ENV{Bugzilla->params->{"auth_env_realname"}} || '';
(use your own email address which is registered in Bugzilla)
I then saved the file and was automatically logged in when I refreshed the bugzilla page. Then I corrected the setting before reverting the file I changed back to it's original state.