mirror of
https://github.com/snipe/snipe-it.git
synced 2026-02-05 01:15:51 +00:00
Patching #4402 into develop
This commit is contained in:
13
upgrade.php
13
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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -160,4 +164,3 @@ echo "your upgraded Snipe-IT.\n";
|
||||
echo "--------------------------------------------------------\n\n";
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user