mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Patching #4402 into develop
This commit is contained in:
parent
487fd17ce3
commit
c26a2f8291
|
@ -1,12 +1,16 @@
|
||||||
<?php
|
<?php
|
||||||
(PHP_SAPI !== 'cli' || isset($_SERVER['HTTP_USER_AGENT'])) && die('Access denied.');
|
(PHP_SAPI !== 'cli' || isset($_SERVER['HTTP_USER_AGENT'])) && die('Access denied.');
|
||||||
|
|
||||||
|
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());
|
$pwu_data = posix_getpwuid(posix_geteuid());
|
||||||
$username = $pwu_data['name'];
|
$username = $pwu_data['name'];
|
||||||
|
|
||||||
if (($username=='root') || ($username=='admin')) {
|
if (($username=='root') || ($username=='admin')) {
|
||||||
die("\nERROR: This script should not be run as root/admin. Exiting.\n\n");
|
die("\nERROR: This script should not be run as root/admin. Exiting.\n\n");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
($argv[1]) ? $branch = $argv[1] : $branch = 'master';
|
($argv[1]) ? $branch = $argv[1] : $branch = 'master';
|
||||||
|
@ -160,4 +164,3 @@ echo "your upgraded Snipe-IT.\n";
|
||||||
echo "--------------------------------------------------------\n\n";
|
echo "--------------------------------------------------------\n\n";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue