Skip to content

Commit

Permalink
Stable Release - 1.5.10.1615
Browse files Browse the repository at this point in the history
Stable Release PR For 1.5.10.1615 - 2024-09-15
  • Loading branch information
fog-workflows[bot] committed Sep 15, 2024
2 parents 24bb5a6 + cd89b56 commit 3527eca
Show file tree
Hide file tree
Showing 99 changed files with 466 additions and 184 deletions.
3 changes: 2 additions & 1 deletion .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
# To enable this hook, rename this file to "pre-commit" within .git\hooks
# or run git config core.hooksPath .githooks
#
# Exit on error
#set -e
Expand Down
29 changes: 19 additions & 10 deletions bin/installfog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,11 @@ usage() {
echo -e "\t-X --exitFail\t\tDo not exit if item fails"
echo -e "\t-T --no-tftpbuild\t\tDo not rebuild the tftpd config file"
echo -e "\t-F --no-vhost\t\tDo not overwrite vhost file"
echo -e "\t-A --arm-support\t\tInstall kernel and initrd for ARM platforms"
exit 0
}

shortopts="h?odEUHSCKYyXxTPFAf:c:W:D:B:s:e:b:N:"
longopts="help,uninstall,ssl-path:,oldcopy,no-vhost,no-defaults,no-upgrade,no-htmldoc,force-https,recreate-keys,recreate-CA,recreate-Ca,recreate-cA,recreate-ca,autoaccept,file:,docroot:,webroot:,backuppath:,startrange:,endrange:,bootfile:,no-exportbuild,exitFail,no-tftpbuild,arm-support"
shortopts="h?odEUHSCKYyXxTPFf:c:W:D:B:s:e:b:N:"
longopts="help,uninstall,ssl-path:,oldcopy,no-vhost,no-defaults,no-upgrade,no-htmldoc,force-https,recreate-keys,recreate-CA,recreate-Ca,recreate-cA,recreate-ca,autoaccept,file:,docroot:,webroot:,backuppath:,startrange:,endrange:,bootfile:,no-exportbuild,exitFail,no-tftpbuild"

optargs=$(getopt -o $shortopts -l $longopts -n "$0" -- "$@")
[[ $? -ne 0 ]] && usage
Expand Down Expand Up @@ -224,11 +223,7 @@ while :; do
novhost="y"
shift
;;
-A | --arm-support)
sarmsupport=1
shift
;;
--)
--)
shift
break
;;
Expand Down Expand Up @@ -263,11 +258,27 @@ if [[ ! $exitcode -eq 0 ]]; then
case $exitcode in
0)
dnf -y install redhat-lsb-core >>$error_log 2>&1
exitcode=$?
;;
*)
yum -y install redhat-lsb-core >>$error_log 2>&1
exitcode=$?
;;
esac
if [[ ! $exitcode -eq 0 ]]; then
command -v dnf >>$error_log 2>&1
exitcode=$?
case $exitcode in
0)
dnf -y install lsb-release >>$error_log 2>&1
exitcode=$?
;;
*)
yum -y install lsb-release >>$error_log 2>&1
exitcode=$?
;;
esac
fi
;;
*arch*)
pacman -Sy --noconfirm lsb-release >>$error_log 2>&1
Expand Down Expand Up @@ -298,7 +309,6 @@ echo "Done"
[[ -z $doupdate ]] && doupdate=1
[[ -z $ignorehtmldoc ]] && ignorehtmldoc=0
[[ -z $httpproto ]] && httpproto="http"
[[ -z $armsupport ]] && armsupport=0
[[ -z $mysqldbname ]] && mysqldbname="fog"
[[ -z $tftpAdvOpts ]] && tftpAdvOpts=""
[[ -z $fogpriorconfig ]] && fogpriorconfig="$fogprogramdir/.fogsettings"
Expand Down Expand Up @@ -343,7 +353,6 @@ esac
[[ -n $sbackupPath ]] && backupPath=$sbackupPath
[[ -n $sexitFail ]] && exitFail=$sexitFail
[[ -n $snoTftpBuild ]] && noTftpBuild=$snoTftpBuild
[[ -n $sarmsupport ]] && armsupport=$sarmsupport

[[ -f $fogpriorconfig ]] && grep -l webroot $fogpriorconfig >>$error_log 2>&1
case $? in
Expand Down
35 changes: 15 additions & 20 deletions lib/common/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1644,7 +1644,6 @@ writeUpdateFile() {
esctftpAdvOpts=$(echo $tftpAdvOpts | sed -e $replace)
escsslpath=$(echo $sslpath | sed -e $replace)
escbackupPath=$(echo $backupPath | sed -e $replace)
escarmsupport=$(echo $sarmsupport | sed -e $replace)
escphp_ver=$(echo $php_ver | sed -e $replace)
escsslprivkey=$(echo $sslprivkey | sed -e $replace)
[[ -z $copybackold || $copybackold -lt 1 ]] && copybackold=0
Expand Down Expand Up @@ -1767,9 +1766,6 @@ writeUpdateFile() {
grep -q "backupPath=" $fogprogramdir/.fogsettings && \
sed -i "s/backupPath=.*/backupPath='$escbackupPath'/g" $fogprogramdir/.fogsettings || \
echo "backupPath='$backupPath'" >> $fogprogramdir/.fogsettings
grep -q "armsupport=" $fogprogramdir/.fogsettings && \
sed -i "s/armsupport=.*/armsupport='$escarmsupport'/g" $fogprogramdir/.fogsettings || \
echo "armsupport='$armsupport'" >> $fogprogramdir/.fogsettings
grep -q "php_ver=" $fogprogramdir/.fogsettings && \
sed -i "s/php_ver=.*/php_ver='$php_ver'/g" $fogprogramdir/.fogsettings || \
echo "php_ver='$php_ver'" >> $fogprogramdir/.fogsettings
Expand Down Expand Up @@ -1823,7 +1819,6 @@ writeUpdateFile() {
echo "tftpAdvOpts='$tftpAdvOpts'" >> "$fogprogramdir/.fogsettings"
echo "sslpath='$sslpath'" >> "$fogprogramdir/.fogsettings"
echo "backupPath='$backupPath'" >> "$fogprogramdir/.fogsettings"
echo "armsupport='$armsupport'" >> "$fogprogramdir/.fogsettings"
echo "php_ver='$php_ver'" >> "$fogprogramdir/.fogsettings"
echo "sslprivkey='$sslprivkey'" >> $fogprogramdir/.fogsettings
echo "sendreports='$sendreports'" >> $fogprogramdir/.fogsettings
Expand Down Expand Up @@ -1871,7 +1866,6 @@ writeUpdateFile() {
echo "tftpAdvOpts='$tftpAdvOpts'" >> "$fogprogramdir/.fogsettings"
echo "sslpath='$sslpath'" >> "$fogprogramdir/.fogsettings"
echo "backupPath='$backupPath'" >> "$fogprogramdir/.fogsettings"
echo "armsupport='$armsupport'" >> "$fogprogramdir/.fogsettings"
echo "php_ver='$php_ver'" >> "$fogprogramdir/.fogsettings"
echo "sslprivkey='$sslprivkey'" >> $fogprogramdir/.fogsettings
echo "sendreports='$sendreports'" >> $fogprogramdir/.fogsettings
Expand Down Expand Up @@ -2022,15 +2016,18 @@ EOF
echo " ServerAlias $hostname" >> "$etcconf"
echo " DocumentRoot $docroot" >> "$etcconf"
echo " SSLEngine On" >> "$etcconf"
echo " SSLProtocol all -SSLv3 -SSLv2" >> "$etcconf"
echo " SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA" >> "$etcconf"
echo " SSLProtocol -all +TLSv1.2" >> "$etcconf"
echo " SSLCipherSuite HIGH:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305:!MEDIUM:!LOW" >> "$etcconf"
echo " SSLHonorCipherOrder On" >> "$etcconf"
echo " SSLSessionTickets Off" >> "$etcconf"
echo " SSLCertificateFile $webdirdest/management/other/ssl/srvpublic.crt" >> "$etcconf"
echo " SSLCertificateKeyFile $sslprivkey" >> "$etcconf"
echo " SSLCACertificateFile $webdirdest/management/other/ca.cert.pem" >> "$etcconf"
echo " <Directory $webdirdest>" >> "$etcconf"
echo " DirectoryIndex index.php index.html index.htm" >> "$etcconf"
echo " </Directory>" >> "$etcconf"
echo " Timeout 600" >> "$etcconf"
echo " ProxyTimeout 600" >> "$etcconf"
echo " RewriteEngine On" >> "$etcconf"
echo " RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)" >> "$etcconf"
echo " RewriteRule .* - [F]" >> "$etcconf"
Expand All @@ -2042,6 +2039,8 @@ EOF
echo " <Directory $webdirdest>" >> "$etcconf"
echo " DirectoryIndex index.php index.html index.htm" >> "$etcconf"
echo " </Directory>" >> "$etcconf"
echo " Timeout 600" >> "$etcconf"
echo " ProxyTimeout 600" >> "$etcconf"
echo " RewriteEngine On" >> "$etcconf"
echo " RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)" >> "$etcconf"
echo " RewriteRule .* - [F]" >> "$etcconf"
Expand Down Expand Up @@ -2444,15 +2443,9 @@ downloadfiles() {
cwd=$(pwd)
cd ../tmp/
if [[ $version =~ ^[0-9]\.[0-9]\.[0-9]+$ ]]; then
urls=( "${fosURL}/${version}/init.xz" "${fosURL}/${version}/init_32.xz" "${fosURL}/${version}/bzImage" "${fosURL}/${version}/bzImage32" "${fogclientURL}/${clientVer}/FOGService.msi" "${fogclientURL}/${clientVer}/SmartInstaller.exe" )
if [[ $armsupport == 1 ]]; then
urls+=( "${fosURL}/${version}/arm_init.cpio.gz" "${fosURL}/${version}/arm_Image" )
fi
urls=( "${fosURL}/${version}/init.xz" "${fosURL}/${version}/init_32.xz" "${fosURL}/${version}/bzImage" "${fosURL}/${version}/bzImage32" "${fosURL}/${version}/arm_init.cpio.gz" "${fosURL}/${version}/arm_Image" "${fogclientURL}/${clientVer}/FOGService.msi" "${fogclientURL}/${clientVer}/SmartInstaller.exe" )
else
urls=( "${fosLatestURL}/init.xz" "${fosLatestURL}/init_32.xz" "${fosLatestURL}/bzImage" "${fosLatestURL}/bzImage32" "${fogclientURL}/${clientVer}/FOGService.msi" "${fogclientURL}/${clientVer}/SmartInstaller.exe" )
if [[ $armsupport == 1 ]]; then
urls+=( "${fosLatestURL}/arm_init.cpio.gz" "${fosLatestURL}/arm_Image" )
fi
urls=( "${fosLatestURL}/init.xz" "${fosLatestURL}/init_32.xz" "${fosLatestURL}/bzImage" "${fosLatestURL}/bzImage32" "${fosLatestURL}/arm_init.cpio.gz" "${fosLatestURL}/arm_Image" "${fogclientURL}/${clientVer}/FOGService.msi" "${fogclientURL}/${clientVer}/SmartInstaller.exe" )
fi
for url in "${urls[@]}"; do
checksum=1
Expand Down Expand Up @@ -2486,10 +2479,8 @@ downloadfiles() {
cp -vf ${copypath}bzImage32 ${webdirdest}/service/ipxe/ >>$error_log 2>&1 || errorStat $?
cp -vf ${copypath}init.xz ${webdirdest}/service/ipxe/ >>$error_log 2>&1 || errorStat $?
cp -vf ${copypath}init_32.xz ${webdirdest}/service/ipxe/ >>$error_log 2>&1 || errorStat $?
if [[ $armsupport == 1 ]]; then
cp -vf ${copypath_arm}arm_Image ${webdirdest}/service/ipxe/ >>$error_log 2>&1 || errorStat $?
cp -vf ${copypath_arm}arm_init.cpio.gz ${webdirdest}/service/ipxe/ >>$error_log 2>&1 || errorStat $?
fi
cp -vf ${copypath_arm}arm_Image ${webdirdest}/service/ipxe/ >>$error_log 2>&1 || errorStat $?
cp -vf ${copypath_arm}arm_init.cpio.gz ${webdirdest}/service/ipxe/ >>$error_log 2>&1 || errorStat $?
cp -vf ${copypath}FOGService.msi ${copypath}SmartInstaller.exe ${webdirdest}/client/ >>$error_log 2>&1
errorStat $?
cd $cwd
Expand Down Expand Up @@ -2582,6 +2573,10 @@ configureDHCP() {
echo " match if substring(option vendor-class-identifier, 0, 20) = \"PXEClient:Arch:00009\";" >> "$dhcptouse"
echo " filename \"snponly.efi\";" >> "$dhcptouse"
echo "}" >> "$dhcptouse"
echo "class \"UEFI-ARM64\" {" >> "$dhcptouse"
echo " match if substring(option vendor-class-identifier, 0, 20) = \"PXEClient:Arch:00011\";" >> "$dhcptouse"
echo " filename \"arm64-efi/snponly.efi\";" >> "$dhcptouse"
echo "}" >> "$dhcptouse"
echo "class \"SURFACE-PRO-4\" {" >> "$dhcptouse"
echo " match if substring(option vendor-class-identifier, 0, 32) = \"PXEClient:Arch:00007:UNDI:003016\";" >> "$dhcptouse"
echo " filename \"snponly.efi\";" >> "$dhcptouse"
Expand Down
Binary file modified packages/tftp/10secdelay/arm64-efi/intel.efi
Binary file not shown.
Binary file modified packages/tftp/10secdelay/arm64-efi/ipxe.efi
Binary file not shown.
Binary file modified packages/tftp/10secdelay/arm64-efi/ncm--ecm--axge.efi
Binary file not shown.
Binary file modified packages/tftp/10secdelay/arm64-efi/realtek.efi
Binary file not shown.
Binary file modified packages/tftp/10secdelay/arm64-efi/snp.efi
Binary file not shown.
Binary file modified packages/tftp/10secdelay/arm64-efi/snponly.efi
Binary file not shown.
Binary file modified packages/tftp/10secdelay/i386-efi/intel.efi
Binary file not shown.
Binary file modified packages/tftp/10secdelay/i386-efi/ipxe.efi
Binary file not shown.
Binary file modified packages/tftp/10secdelay/i386-efi/ncm--ecm--axge.efi
Binary file not shown.
Binary file modified packages/tftp/10secdelay/i386-efi/realtek.efi
Binary file not shown.
Binary file modified packages/tftp/10secdelay/i386-efi/snp.efi
Binary file not shown.
Binary file modified packages/tftp/10secdelay/i386-efi/snponly.efi
Binary file not shown.
Binary file modified packages/tftp/10secdelay/intel.efi
Binary file not shown.
Binary file modified packages/tftp/10secdelay/intel.kkpxe
Binary file not shown.
Binary file modified packages/tftp/10secdelay/intel.kpxe
Binary file not shown.
Binary file modified packages/tftp/10secdelay/intel.pxe
Binary file not shown.
Binary file modified packages/tftp/10secdelay/ipxe.efi
Binary file not shown.
Binary file modified packages/tftp/10secdelay/ipxe.iso
Binary file not shown.
Binary file modified packages/tftp/10secdelay/ipxe.kkpxe
Binary file not shown.
Binary file modified packages/tftp/10secdelay/ipxe.kpxe
Binary file not shown.
Binary file modified packages/tftp/10secdelay/ipxe.krn
Binary file not shown.
Binary file modified packages/tftp/10secdelay/ipxe.lkrn
Binary file not shown.
Binary file modified packages/tftp/10secdelay/ipxe.pxe
Binary file not shown.
Binary file modified packages/tftp/10secdelay/ipxe.usb
Binary file not shown.
Binary file modified packages/tftp/10secdelay/ncm--ecm--axge.efi
Binary file not shown.
Binary file modified packages/tftp/10secdelay/realtek.efi
Binary file not shown.
Binary file modified packages/tftp/10secdelay/realtek.kkpxe
Binary file not shown.
Binary file modified packages/tftp/10secdelay/realtek.kpxe
Binary file not shown.
Binary file modified packages/tftp/10secdelay/realtek.pxe
Binary file not shown.
Binary file modified packages/tftp/10secdelay/snp.efi
Binary file not shown.
Binary file modified packages/tftp/10secdelay/snponly.efi
Binary file not shown.
Binary file modified packages/tftp/10secdelay/undionly.kkpxe
Binary file not shown.
Binary file modified packages/tftp/10secdelay/undionly.kpxe
Binary file not shown.
Binary file modified packages/tftp/10secdelay/undionly.pxe
Binary file not shown.
Binary file modified packages/tftp/arm64-efi/intel.efi
Binary file not shown.
Binary file modified packages/tftp/arm64-efi/ipxe.efi
Binary file not shown.
Binary file modified packages/tftp/arm64-efi/ncm--ecm--axge.efi
Binary file not shown.
Binary file modified packages/tftp/arm64-efi/realtek.efi
Binary file not shown.
Binary file modified packages/tftp/arm64-efi/snp.efi
Binary file not shown.
Binary file modified packages/tftp/arm64-efi/snponly.efi
Binary file not shown.
Binary file modified packages/tftp/i386-efi/intel.efi
Binary file not shown.
Binary file modified packages/tftp/i386-efi/ipxe.efi
Binary file not shown.
Binary file modified packages/tftp/i386-efi/ncm--ecm--axge.efi
Binary file not shown.
Binary file modified packages/tftp/i386-efi/realtek.efi
Binary file not shown.
Binary file modified packages/tftp/i386-efi/snp.efi
Binary file not shown.
Binary file modified packages/tftp/i386-efi/snponly.efi
Binary file not shown.
Binary file modified packages/tftp/intel.efi
Binary file not shown.
Binary file modified packages/tftp/intel.kkpxe
Binary file not shown.
Binary file modified packages/tftp/intel.kpxe
Binary file not shown.
Binary file modified packages/tftp/intel.pxe
Binary file not shown.
Binary file modified packages/tftp/ipxe.efi
Binary file not shown.
Binary file modified packages/tftp/ipxe.iso
Binary file not shown.
Binary file modified packages/tftp/ipxe.kkpxe
Binary file not shown.
Binary file modified packages/tftp/ipxe.kpxe
Binary file not shown.
Binary file modified packages/tftp/ipxe.krn
Binary file not shown.
Binary file modified packages/tftp/ipxe.lkrn
Binary file not shown.
Binary file modified packages/tftp/ipxe.pxe
Binary file not shown.
Binary file modified packages/tftp/ipxe.usb
Binary file not shown.
Binary file modified packages/tftp/ncm--ecm--axge.efi
Binary file not shown.
Binary file modified packages/tftp/realtek.efi
Binary file not shown.
Binary file modified packages/tftp/realtek.kkpxe
Binary file not shown.
Binary file modified packages/tftp/realtek.kpxe
Binary file not shown.
Binary file modified packages/tftp/realtek.pxe
Binary file not shown.
Binary file modified packages/tftp/snp.efi
Binary file not shown.
Binary file modified packages/tftp/snponly.efi
Binary file not shown.
Binary file modified packages/tftp/undionly.kkpxe
Binary file not shown.
Binary file modified packages/tftp/undionly.kpxe
Binary file not shown.
Binary file modified packages/tftp/undionly.pxe
Binary file not shown.
16 changes: 16 additions & 0 deletions packages/web/commons/schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -3763,3 +3763,19 @@
"ALTER TABLE `hosts` ADD COLUMN `hostInfoKey` VARCHAR(255)",
"ALTER TABLE `hosts` ADD COLUMN `hostInfoLock` BOOLEAN DEFAULT 0"
);
// 272
$this->schema[] = array(
"ALTER TABLE `inventory` ADD COLUMN `iGpuvendors` VARCHAR(255) NOT NULL",
"ALTER TABLE `inventory` ADD COLUMN `iGpuproducts` VARCHAR(255) NOT NULL"
);
// 273
$this->schema[] = array(
"INSERT IGNORE INTO `globalSettings` "
. "(`settingKey`,`settingDesc`,`settingValue`,`settingCategory`) "
. "VALUES "
. "('FOG_TFTP_PXE_KERNEL_ARM','Location of the ARM kernel file on "
. "the PXE server, this should point to the kernel itself.',"
. "'arm_Image','TFTP Server'),"
. "('FOG_PXE_BOOT_IMAGE_ARM','The settings defines where the ARM "
. "fog boot file system image is located.','arm_init.cpio.gz','TFTP Server')",
);
11 changes: 9 additions & 2 deletions packages/web/lib/fog/bootmenu.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,13 @@ public function __construct()
'FOG_MEMTEST_KERNEL',
'FOG_PXE_BOOT_IMAGE',
'FOG_PXE_BOOT_IMAGE_32',
'FOG_PXE_BOOT_IMAGE_ARM',
'FOG_PXE_HIDDENMENU_TIMEOUT',
'FOG_PXE_MENU_HIDDEN',
'FOG_PXE_MENU_TIMEOUT',
'FOG_TFTP_PXE_KERNEL',
'FOG_TFTP_PXE_KERNEL_32',
'FOG_TFTP_PXE_KERNEL_ARM',
);
list(
$exit,
Expand All @@ -259,11 +261,13 @@ public function __construct()
$memtest,
$imagefile,
$init_32,
$init_arm,
$hiddenTimeout,
$hiddenmenu,
$menuTimeout,
$bzImage,
$bzImage32
$bzImage32,
$bzImageArm
) = self::getSubObjectIDs(
'Service',
array(
Expand All @@ -289,9 +293,12 @@ public function __construct()
$keySequence :
''
);
if ($_REQUEST['arch'] != 'x86_64') {
if (($_REQUEST['arch'] ?? '') == 'i386') {
$bzImage = $bzImage32;
$imagefile = $init_32;
} elseif (($_REQUEST['arch'] ?? '') == 'arm') {
$bzImage = $bzImageArm;
$imagefile = $init_arm;
}
$kernel = $bzImage;
if (self::$Host->get('kernel')) {
Expand Down
9 changes: 7 additions & 2 deletions packages/web/lib/fog/fogbase.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1107,8 +1107,13 @@ public static function niceDate($date = 'now', $utc = false)
} else {
$tz = new DateTimeZone(self::$TimeZone);
}

return new DateTime($date, $tz);
try {
$niceDate = new DateTime($date, $tz);
} catch (Exception $e) {
throw new Exception("Given date of '$date' is invalid! Can't create nicedate!");
$niceDate = $date;
}
return $niceDate;
}
/**
* Do formatting things.
Expand Down
2 changes: 2 additions & 0 deletions packages/web/lib/fog/fogpage.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ public function __construct($name = '')
_('Chassis Version') => 'casever',
_('Chassis Serial') => 'caseserial',
_('Chassis Asset') => 'caseasset',
_('GPU Vendors') => 'gpuvendors',
_('GPU Products') => 'gpuproducts',
);
$exportMenu = sprintf('Export%s', $this->childClass);
$importMenu = sprintf('Import%s', $this->childClass);
Expand Down
2 changes: 2 additions & 0 deletions packages/web/lib/fog/inventory.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ class Inventory extends FOGController
'casever' => 'iCasever',
'caseserial' => 'iCaseserial',
'caseasset' => 'iCaseasset',
'gpuvendors' => 'iGpuvendors',
'gpuproducts' => 'iGpuproducts',
);
/**
* The required fields.
Expand Down
4 changes: 2 additions & 2 deletions packages/web/lib/fog/system.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ private static function _versionCompare()
public function __construct()
{
self::_versionCompare();
define('FOG_VERSION', '1.5.10.1593');
define('FOG_SCHEMA', 271);
define('FOG_VERSION', '1.5.10.1615');
define('FOG_SCHEMA', 273);
define('FOG_BCACHE_VER', 141);
define('FOG_CLIENT_VERSION', '0.13.0');
}
Expand Down
25 changes: 15 additions & 10 deletions packages/web/lib/fog/task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,23 @@ public function getInFrontOfHostCount()
foreach ((array)$this->getManager()
->find($find) as &$Task
) {
$TaskCheckinTime = self::niceDate($Task->get('checkInTime'));
$timeOfLastCheckin = $curTime
try {
$TaskCheckinTime = self::niceDate($Task->get('checkInTime'));
$timeOfLastCheckin = $curTime
->getTimestamp() - $TaskCheckinTime
->getTimestamp();
if ($timeOfLastCheckin >= $checkTime) {
$Task->set(
'checkInTime',
$curTime->format('Y-m-d H:i:s')
)->save();
}
if ($MyCheckinTime > $TaskCheckinTime) {
++$count;
if ($timeOfLastCheckin >= $checkTime) {
$Task->set(
'checkInTime',
$curTime->format('Y-m-d H:i:s')
)->save();
}
if ($MyCheckinTime > $TaskCheckinTime) {
++$count;
}
} catch (Exception $e) {
// FOGCORE::var_dump_log('nice date is invalid for checkInTime');
//don't increment count for tasks with a 'No Data' check in time
}
unset($Task);
}
Expand Down
Loading

0 comments on commit 3527eca

Please sign in to comment.