"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "packages/web/lib/fog/fogbase.class.php" between
fogproject-1.5.5.tar.gz and fogproject-1.5.6.tar.gz

About: FOG is a Linux-based network computer cloning solution for Windows, Mac OSX and various Linux distributions that ties together a few open-source tools with a PHP-based web interface. FOG doesn’t use any boot disks, or CDs; everything is done via TFTP and PXE.

fogbase.class.php  (fogproject-1.5.5):fogbase.class.php  (fogproject-1.5.6)
skipping to change at line 1199 skipping to change at line 1199
} else { } else {
return $date >= 0 && $date <= 7; return $date >= 0 && $date <= 7;
} }
} }
if (!$date instanceof DateTime) { if (!$date instanceof DateTime) {
$date = self::niceDate($date); $date = self::niceDate($date);
} }
if (!$format) { if (!$format) {
$format = 'm/d/Y'; $format = 'm/d/Y';
} }
$tz = new DateTimeZone(self::$TimeZone); if (empty(self::$TimeZone)) {
$tz = new DateTimeZone('UTC');
} else {
$tz = new DateTimeZone(self::$TimeZone);
}
return DateTime::createFromFormat( return DateTime::createFromFormat(
$format, $format,
$date->format($format), $date->format($format),
$tz $tz
); );
} }
/** /**
* Simply returns if the item should be with an s or not. * Simply returns if the item should be with an s or not.
* *
skipping to change at line 1654 skipping to change at line 1658
$chunk = substr($data, 0, $chunkSize); $chunk = substr($data, 0, $chunkSize);
$data = substr($data, $chunkSize); $data = substr($data, $chunkSize);
$decrypt = ''; $decrypt = '';
$test = openssl_private_decrypt( $test = openssl_private_decrypt(
$chunk, $chunk,
$decrypt, $decrypt,
$priv_key, $priv_key,
$padding $padding
); );
if (!$test) { if (!$test) {
throw new Exception(_('Failed to decrypt data')); throw new Exception(_('Failed to decrypt data on server'));
} }
$dataun .= $decrypt; $dataun .= $decrypt;
} }
unset($data); unset($data);
$output[] = $dataun; $output[] = $dataun;
} }
openssl_free_key($priv_key); openssl_free_key($priv_key);
return (array) $output; return (array) $output;
} }
skipping to change at line 2238 skipping to change at line 2242
$IPs, $IPs,
$retVal $retVal
); );
if (!count($IPs)) { if (!count($IPs)) {
exec( exec(
"/sbin/ifconfig -a | awk -F'[ /:]+' '/(cast)/ {print $4}'", "/sbin/ifconfig -a | awk -F'[ /:]+' '/(cast)/ {print $4}'",
$IPs, $IPs,
$retVal $retVal
); );
} }
$test = self::$FOGURLRequests->isAvailable('http://ipinfo.io/ip');
$test = array_shift($test);
if (false !== $test) {
$res = self::$FOGURLRequests->process('http://ipinfo.io/ip');
$IPs[] = $res[0];
}
natcasesort($IPs); natcasesort($IPs);
$retIPs = function (&$IP) { $retIPs = function (&$IP) {
$IP = trim($IP); $IP = trim($IP);
if (!filter_var($IP, FILTER_VALIDATE_IP)) { if (!filter_var($IP, FILTER_VALIDATE_IP)) {
$IP = gethostbyname($IP); $IP = gethostbyname($IP);
} }
if (filter_var($IP, FILTER_VALIDATE_IP)) { if (filter_var($IP, FILTER_VALIDATE_IP)) {
return $IP; return $IP;
} }
}; };
 End of changes. 3 change blocks. 
8 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)