mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge branch '4.9' into 4
This commit is contained in:
commit
d2cbf5bc2a
@ -36,17 +36,20 @@ class TempFolder
|
||||
*/
|
||||
public static function getTempFolderUsername()
|
||||
{
|
||||
$user = Environment::getEnv('APACHE_RUN_USER');
|
||||
$user = '';
|
||||
if (function_exists('posix_getpwuid') && function_exists('posix_getuid')) {
|
||||
$userDetails = posix_getpwuid(posix_getuid());
|
||||
$user = $userDetails['name'];
|
||||
}
|
||||
if (!$user) {
|
||||
$user = Environment::getEnv('APACHE_RUN_USER');
|
||||
}
|
||||
if (!$user) {
|
||||
$user = Environment::getEnv('USER');
|
||||
}
|
||||
if (!$user) {
|
||||
$user = Environment::getEnv('USERNAME');
|
||||
}
|
||||
if (!$user && function_exists('posix_getpwuid') && function_exists('posix_getuid')) {
|
||||
$userDetails = posix_getpwuid(posix_getuid());
|
||||
$user = $userDetails['name'];
|
||||
}
|
||||
if (!$user) {
|
||||
$user = 'unknown';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user