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()
|
public static function getTempFolderUsername()
|
||||||
{
|
{
|
||||||
|
$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');
|
$user = Environment::getEnv('APACHE_RUN_USER');
|
||||||
|
}
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
$user = Environment::getEnv('USER');
|
$user = Environment::getEnv('USER');
|
||||||
}
|
}
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
$user = Environment::getEnv('USERNAME');
|
$user = Environment::getEnv('USERNAME');
|
||||||
}
|
}
|
||||||
if (!$user && function_exists('posix_getpwuid') && function_exists('posix_getuid')) {
|
|
||||||
$userDetails = posix_getpwuid(posix_getuid());
|
|
||||||
$user = $userDetails['name'];
|
|
||||||
}
|
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
$user = 'unknown';
|
$user = 'unknown';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user