"Fossies" - the Fresh Open Source Software Archive  

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

snapinmanagementpage.class.php  (fogproject-1.5.5):snapinmanagementpage.class.php  (fogproject-1.5.6)
skipping to change at line 771 skipping to change at line 771
$StorageGroup = new StorageGroup($storagegroup); $StorageGroup = new StorageGroup($storagegroup);
$StorageNode = $StorageGroup->getMasterStorageNode(); $StorageNode = $StorageGroup->getMasterStorageNode();
if (!$snapinfile && $_FILES['snapin']['error'] > 0) { if (!$snapinfile && $_FILES['snapin']['error'] > 0) {
throw new UploadException($_FILES['snapin']['error']); throw new UploadException($_FILES['snapin']['error']);
} }
$src = sprintf( $src = sprintf(
'%s/%s', '%s/%s',
dirname($_FILES['snapin']['tmp_name']), dirname($_FILES['snapin']['tmp_name']),
basename($_FILES['snapin']['tmp_name']) basename($_FILES['snapin']['tmp_name'])
); );
set_time_limit(0);
$hash = '';
$size = 0;
if ($uploadfile && file_exists($src)) {
$hash = hash_file('sha512', $src);
$size = self::getFilesize($src);
}
$dest = sprintf( $dest = sprintf(
'/%s/%s', '/%s/%s',
trim( trim(
$StorageNode->get('snapinpath'), $StorageNode->get('snapinpath'),
'/' '/'
), ),
$snapinfile $snapinfile
); );
self::$FOGFTP set_time_limit(0);
->set('host', $StorageNode->get('ip')) $hash = '';
->set('username', $StorageNode->get('user')) $size = 0;
->set('password', $StorageNode->get('pass')); if ($uploadfile && file_exists($src)) {
if (!self::$FOGFTP->connect()) { $hash = hash_file('sha512', $src);
throw new Exception( $size = self::getFilesize($src);
sprintf( self::$FOGFTP
'%s: %s: %s.', ->set('host', $StorageNode->get('ip'))
_('Storage Node'), ->set('username', $StorageNode->get('user'))
$StorageNode->get('ip'), ->set('password', $StorageNode->get('pass'));
_('FTP Connection has failed') if (!self::$FOGFTP->connect()) {
)
);
}
if (!self::$FOGFTP->chdir($StorageNode->get('snapinpath'))) {
if (!self::$FOGFTP->mkdir($StorageNode->get('snapinpath'))) {
throw new Exception( throw new Exception(
_('Failed to add snapin') sprintf(
'%s: %s: %s.',
_('Storage Node'),
$StorageNode->get('ip'),
_('FTP Connection has failed')
)
); );
} }
if (!self::$FOGFTP->chdir($StorageNode->get('snapinpath'))) {
if (!self::$FOGFTP->mkdir($StorageNode->get('snapinpath')))
{
throw new Exception(
_('Failed to add snapin')
);
}
}
self::$FOGFTP->delete($dest);
if (!self::$FOGFTP->put($dest, $src)) {
throw new Exception(
_('Failed to add/update snapin file')
);
}
self::$FOGFTP
->chmod(0777, $dest)
->close();
} }
self::$FOGFTP->delete($dest);
if (!self::$FOGFTP->put($dest, $src)) {
throw new Exception(
_('Failed to add/update snapin file')
);
}
self::$FOGFTP
->chmod(0777, $dest)
->close();
$Snapin = self::getClass('Snapin') $Snapin = self::getClass('Snapin')
->set('name', $name) ->set('name', $name)
->set('packtype', $packtype) ->set('packtype', $packtype)
->set('description', $desc) ->set('description', $desc)
->set('file', $snapinfile) ->set('file', $snapinfile)
->set('hash', $hash) ->set('hash', $hash)
->set('size', $size) ->set('size', $size)
->set('args', $args) ->set('args', $args)
->set('reboot', $action == 'reboot') ->set('reboot', $action == 'reboot')
->set('shutdown', $action == 'shutdown') ->set('shutdown', $action == 'shutdown')
 End of changes. 5 change blocks. 
33 lines changed or deleted 34 lines changed or added

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