Skip to content

Commit

Permalink
Initial attempt to add sysuuid to inventory and hostinfo on boot item…
Browse files Browse the repository at this point in the history
…, to work with #572
  • Loading branch information
mastacontrola committed Jul 29, 2024
1 parent 562c5bb commit d230cc4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
28 changes: 17 additions & 11 deletions packages/web/lib/fog/bootmenu.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,17 @@ public function __construct()
'set setmacto ${net0/mac}',
];
$sysuuid = isset($_REQUEST['sysuuid']) ? $_REQUEST['sysuuid'] : '';
if (self::$Host->isValid()
&& $sysuuid
&& self::$Host->get('inventory')->get('sysuuid') != $sysuuid
) {
if (!self::$Host->get('inventory')->get('sysuuid')) {
self::$Host
->get('inventory')
->set('sysuuid', $sysuuid)
->save();
if (self::$Host->isValid()) {
$Send['hostinfo'][] = 'set hostname ' . self::$Host->get('name');
if ($sysuuid) {
$Send['hostinfo'][] = 'set sysuuid ' . $sysuuid;
}
if (self::$Host->get('inventory')->get('sysuuid') != $sysuuid ) {
self::$Host->get('inventory')->getManager()->update(
['hostID' => self::$Host->get('id')],
'',
['sysuuid' => $sysuuid]
);
}
}
$host_field_test = 'biosexit';
Expand Down Expand Up @@ -1026,8 +1028,12 @@ public function multijoin($msid)
public function keyset()
{
if (!self::$Host->isValid()) return;
self::$Host->set('productKey', $_REQUEST['key']);
if (!self::$Host->save()) {
$update = self::$Host->getManager()->update(
['id' => self::$Host->get('id')],
'',
['productKey' => $_REQUEST['key']]
);
if (!$update) {
$Send['keychangefail'] = [
'echo Failed to change key',
'sleep 3'
Expand Down
2 changes: 1 addition & 1 deletion packages/web/lib/fog/system.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private static function _versionCompare()
public function __construct()
{
self::_versionCompare();
define('FOG_VERSION', '1.6.0-alpha.1379');
define('FOG_VERSION', '1.6.0-alpha.1380');
define('FOG_CHANNEL', 'Alpha');
define('FOG_SCHEMA', 291);
define('FOG_BCACHE_VER', 151);
Expand Down

0 comments on commit d230cc4

Please sign in to comment.