How to set HTTP environment variable from PHP for Bugzilla?

The bugzilla system (perl-based) has an automatic login feature using the http server environment variable. If you fill in the correct ID or username, you will be automatically logged in.

My server runs Joomla (based on PHP) and has all the information about who logs in. It runs bugzilla inside a subframe.

So how can I set this environment value from a PHP script?

In other words, how the following script returns my own variable elsewhere in the session from PHP:

#!/usr/bin/perl -wT
print "Content-type: text/html\n\n";
while (($key, $val) = each %ENV) {
        print "$key = $val<BR>\n";
}

      

0


source to share


2 answers


This is only a guess, but (assuming you are using Apache2) you can set environment variables using apache_setenv()

. However, this will only last for the duration of the current HTTP request, so I'm not sure how you will get it working - a request to a bugzilla page from your browser frame will be considered a completely separate Apache. You might be able to use virtual()

to invoke a subquery in Bugzilla, which should then see this environment variable. I'm not sure if you will need to do this for every Bugzilla page request, or just the one that initiates login.



Sorry if I missed this point or got this very bad

0


source


I'm not sure what you need to do to create a session in Bugzilla, but I know what is going to happen on Joomla! end: you need to create a custom plugin that responds to the onLoginUser event. For an example of this in action, take a look at the onLoginUser function in the plugins /user/joomla.php.



(Note that this is for Joomla! 1.5 only)

0


source







All Articles