"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "packages/web/lib/fog/image.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.

image.class.php  (fogproject-1.5.5):image.class.php  (fogproject-1.5.6)
skipping to change at line 380 skipping to change at line 380
} }
/** /**
* Gets the storage group * Gets the storage group
* *
* @throws Exception * @throws Exception
* @return object * @return object
*/ */
public function getStorageGroup() public function getStorageGroup()
{ {
$groupids = $this->get('storagegroups'); $groupids = $this->get('storagegroups');
$count = count($groupids); if (is_array($groupids) && count($groupids) < 1) {
if ($count < 1) {
$groupids = self::getSubObjectIDs('StorageGroup'); $groupids = self::getSubObjectIDs('StorageGroup');
$groupids = @min($groupids); $groupids = @min($groupids);
if ($groupids < 1) { if ($groupids < 1) {
throw new Exception(_('No viable storage groups found')); throw new Exception(_('No viable storage groups found'));
} }
} }
$primaryGroup = array(); $primaryGroup = array();
foreach ((array)$groupids as &$groupid) { foreach ((array)$groupids as &$groupid) {
if (!$this->getPrimaryGroup($groupid)) { if (!$this->getPrimaryGroup($groupid)) {
continue; continue;
} }
$primaryGroup[] = $groupid; $primaryGroup[] = $groupid;
unset($groupid); unset($groupid);
} }
if (count($primaryGroup) < 1) { if (is_array($primaryGroup) && count($primaryGroup) < 1) {
$primaryGroup = @min((array) $groupids); $primaryGroup = @min((array) $groupids);
} else { } else {
$primaryGroup = array_shift($primaryGroup); $primaryGroup = array_shift($primaryGroup);
} }
return new StorageGroup($primaryGroup); return new StorageGroup($primaryGroup);
} }
/** /**
* Gets the primary storage group. * Gets the primary storage group.
* *
 End of changes. 2 change blocks. 
3 lines changed or deleted 2 lines changed or added

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