mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 15:44:11 -08:00
Update upgrade.php (#4402)
posix_* are not supported on Windows platform
This commit is contained in:
parent
8dceacc2b4
commit
a994e54726
12
upgrade.php
12
upgrade.php
|
@ -1,11 +1,15 @@
|
|||
<?php
|
||||
(PHP_SAPI !== 'cli' || isset($_SERVER['HTTP_USER_AGENT'])) && die('Access denied.');
|
||||
|
||||
$pwu_data = posix_getpwuid(posix_geteuid());
|
||||
$username = $pwu_data['name'];
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||
echo "Skipping user check as it is not supported on Windows\n";
|
||||
} else {
|
||||
$pwu_data = posix_getpwuid(posix_geteuid());
|
||||
$username = $pwu_data['name'];
|
||||
|
||||
if (($username=='root') || ($username=='admin')) {
|
||||
die("\nERROR: This script should not be run as root/admin. Exiting.\n\n");
|
||||
if (($username=='root') || ($username=='admin')) {
|
||||
die("\nERROR: This script should not be run as root/admin. Exiting.\n\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue