Environment variable availability within post-install script
Environment variable availability within post-install script
- Subject: Environment variable availability within post-install script
- From: Tim Streater <email@hidden>
- Date: 09 May 2010 19:10 +0100
My post-install script (written in PHP) must write a file on the user's desktop, and so needs the user's shortname in order to construct the path. The script also modifies the apache config file and so needs admin priv. I appear to be able to give it that by ticking "Require admin authentication".
In my PHP, I appear to be able to do:
$user = getenv ("USER");
to have the logged-in user's name. This seems unexpected to me, I would have thought that I would get "root", if anything at all. It also seems at variance with the documentation that lists the environment variables available to the scripts. Can I rely on what I've done or is there a better way of getting the user's shortname?
Thanks,
Tim Streater
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden