Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmark cache #955

Open
wants to merge 56 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
323b113
changed database structure for benchmarks. Added a Benchmark table an…
Apr 27, 2023
2f5cd16
Added the models for benchmark caching
Apr 27, 2023
d5885e6
Changed getchunk, sendbenchmark and updateclientinformation API to ma…
Apr 27, 2023
174e791
Added benchmarkUtils and HardwareGroupUtils
Apr 27, 2023
57483af
Changed Agent templates to use hardwareGroups
Apr 27, 2023
6f53747
Added frontend to view the cached benchmarks
Apr 27, 2023
75cedf4
fixed bug in benchmarkUtils
May 3, 2023
a5cf430
fixed bug in registerAgent, wasnt updated to hardwaregroup
May 8, 2023
0c3f561
updated install/hashtopolis.sql for benchmark cache
Jul 5, 2023
0c2509b
Added update script for database update
Jul 5, 2023
e06fb1f
Fixed errors in hashtopolis.sql file
Jul 5, 2023
f01d790
fixed bug in hashtopolis.sql
Jul 7, 2023
3a2d0db
fixed bug in hashtopolis.sql again
Jul 7, 2023
588e1ea
fixed bug in hashtopolis.sql, again
Jul 7, 2023
6049f50
fixed another bug in hashtopolis.sql, again
Jul 7, 2023
468a50b
added hashmode and benchmarktype to Benchmark object in hashtopolis.sql
Jul 7, 2023
bd7043e
fixed bug in hashtopolis.sql, creat table benchmark didnt work
Jul 9, 2023
a1e8b7b
updated the update script
Jul 9, 2023
df1f34c
fixed bug in hashtopolis.sql, defined hardwareGroup primary key twice
Jul 9, 2023
99d9aec
fixed typo in hashtopolis.sql
Jul 9, 2023
31991fd
Made hardwareGroupId in agent table nullable
Jul 10, 2023
19c9f4c
updated cache code to latest version
Jul 10, 2023
8f64838
Updated benchmark.utils
Jul 10, 2023
9b23f5b
removed foreignkey from agent to hardwareGroup becasue of bug
Jul 10, 2023
d173c1c
updated frontend
Jul 10, 2023
4194533
uncommented the ttl
Jul 10, 2023
17c8956
Removed foreignkey from agent to hardwareGroup in updatescript becaus…
Jul 10, 2023
cf390fd
Added crackerBinary to cached benchmarks
Jul 14, 2023
579c8f9
Formatted the hardware of the benchmark prettier in the frontend
Jul 15, 2023
164bc95
Added the crackerbinary to the benchmark frontend
Jul 15, 2023
dec578c
Fixed bug in commandline parameters parsing where arguments in format…
Jul 15, 2023
a99be7d
made small changes to hardwareGroupUtils
Jul 17, 2023
a835fd0
Added tests for the benchmarks
Jul 18, 2023
8be58e5
Fixed bug where hardware wasnt properly shown in agent detail page
Jul 18, 2023
91330df
Added the needed utils to the run.php test file
Jul 18, 2023
929350b
Added the benchmark cache to the menu
Jul 20, 2023
973d64d
Removed accidently created files
Jul 25, 2023
741a901
Removed more accidently created files
Jul 25, 2023
a4ec3fc
Merge branch 'master' into master
jessevz Jul 25, 2023
85ade75
Removed old comments
Jul 27, 2023
d15498c
Updated codestyle in benchmarkUtils
Aug 11, 2023
ecff047
Added docStrings in benchmarkUtils
Aug 11, 2023
502dbe1
Made the update script working
Aug 11, 2023
a1b04d6
removed comments from install script and renamed update script to cor…
Aug 11, 2023
2d13640
Made benchmarkcache ttl conifgurable by using the configs
Aug 16, 2023
5b769de
Added efault hardwaregroup so that foreignkey constraint wouldnt fail…
Aug 21, 2023
7b31337
Added default hardwaregroup so that foreignkey constraint wouldnt fai…
Aug 21, 2023
864693e
Added the option to disable caching by setting ttl to 0
Aug 21, 2023
580a08d
Added the changes to the changelog
Aug 23, 2023
3849695
cleaned up benchmark handler
Aug 23, 2023
cdcecc3
Updated code based on code review
Aug 25, 2023
4798414
Added accidently removed code
Aug 25, 2023
5cca11a
Made the benchmark cache also use the agent specific CMD parameters
Aug 26, 2023
5d30ad2
Fixed benchmarktests
Aug 26, 2023
18dbd90
Fixed agent API
Aug 26, 2023
dd03d7d
Added code to make benchmark working with new ui and API v2
Aug 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,444 changes: 1,444 additions & 0 deletions ci/files/db_0.13.0.sql

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions ci/run.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@
require_once(dirname(__FILE__) . "/../src/inc/Util.class.php");
require_once(dirname(__FILE__) . "/../src/inc/Encryption.class.php");
require_once(dirname(__FILE__) . "/../src/inc/utils/AccessUtils.class.php");
require_once(dirname(__FILE__) . "/../src/inc/utils/BenchmarkUtils.class.php");
require_once(dirname(__FILE__) . "/../src/inc/utils/HardwareGroupUtils.class.php");
require_once(dirname(__FILE__) . "/../src/inc/SConfig.class.php");
require_once(dirname(__FILE__) . "/../src/inc/Dataset.class.php");

require_once(dirname(__FILE__) . "/HashtopolisTest.class.php");
require_once(dirname(__FILE__) . "/HashtopolisTestFramework.class.php");
require_once(dirname(__FILE__) . "/../src/inc/HTException.class.php");

$dir = scandir(dirname(__FILE__) . "/tests/");
foreach ($dir as $entry) {
Expand Down
120 changes: 120 additions & 0 deletions ci/tests/BenchmarkTest.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<?php

use DBA\Agent;
use DBA\Benchmark;
use DBA\CrackerBinary;
use DBA\Factory;

class BenchmarkTest extends HashtopolisTest {
protected $minVersion = "0.13.0";
protected $maxVersion = "master";
protected $runType = HashtopolisTest::RUN_FAST;

private $agent = null;
private $crackerBinary = null;

public function init($version) {
HashtopolisTestFramework::log(HashtopolisTestFramework::LOG_INFO, "Initializing " . $this->getTestName() . "...");
parent::init($version);
}

public function run() {
HashtopolisTestFramework::log(HashtopolisTestFramework::LOG_INFO, "Running " . $this->getTestName() . "...");
$this->createAgentWithHardwareGroup();
$this->testAddToCache();
$this->testGetFromCache();
$this->testDeleteCache();
$this->testTtl();
HashtopolisTestFramework::log(HashtopolisTestFramework::LOG_INFO, $this->getTestName() . " completed");
}

public function getTestName() {
return "Benchmark Test";
}

private function createAgentWithHardwareGroup() {
$agent = new Agent(100, "testAgent", "ebfc57ec-2d6f-4a60-932d-60f127dbb2a8",0, null, "", 0, 1, 0, "TeStToKeN0", "sendProgress",
1683904809, "127.0.0.1", 1, 0, "s3-python-0.7.1");
$agentSameHardware = new Agent(101, "testAgent2", "ebfc57ec-2d6f-4a60-932d-60f127dbb2a9",0, null, "", 0, 1, 0, "TeStToKeN1", "sendProgress",
1683904809, "127.0.0.2", 1, 0, "s3-python-0.7.1");
$agentDifferentHardware = new Agent(102, "testAgent3", "ebfc57ec-2d6f-4a60-932d-60f127dbb2b8",0, null, "", 0, 1, 0, "TeStToKeN2", "sendProgress",
1683904809, "127.0.0.3", 1, 0, "s3-python-0.7.1");

Factory::getAgentFactory()->save($agent);
Factory::getAgentFactory()->save($agentSameHardware);
Factory::getAgentFactory()->save($agentDifferentHardware);

$agent = HardwareGroupUtils::updateHardwareOfAgent("11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz", $agent);
$agentSameHardware = HardwareGroupUtils::updateHardwareOfAgent("11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz", $agentSameHardware);
$agentDifferentHardware = HardwareGroupUtils::updateHardwareOfAgent("10th Gen Intel(R) Core(TM) i6-1165G7 @ 2.80GHz", $agentDifferentHardware);

if ($agent->getHardwareGroupId() != $agentSameHardware->getHardwareGroupId()) {
$this->testFailed("BenchmarkTest:createAgentWithHardwareGroup", "Agents with the same hardware are not added to the same hardwareGroup!
Agent1 hardwaregroup id: " . $agent->getHardwareGroupId() . "Agent2 hardwareGroupId: " . $agentSameHardware->getHardwareGroupId());
}
if ($agent->getHardwareGroupId() == $agentDifferentHardware->getHardwareGroupId()) {
$this->testFailed("BenchmarkTest:createAgentWithHardwareGroup", "Agents with different hardware are added to the same hardwareGroup!
Agent1 hardwaregroup id: " . $agent->getHardwareGroupId() . "Agent2 hardwareGroupId: " . $agentDifferentHardware->getHardwareGroupId());
}

$this->agent = $agent; //save agent for future tests
$this->testSuccess("BenchmarkTest:createAgentWithHardwareGroup");
}

private function testAddToCache(){
$crackerBinary = new CrackerBinary(3036, 1, "6.2.6", "https://hashcat.net/files/hashcat-6.2.6.7z", "hashcat");
Factory::getCrackerBinaryFactory()->save($crackerBinary);
$benchmark = BenchmarkUtils::saveBenchmarkInCache("#HL# -a 3 ?l?l?l?l -d 1 --force", $this->agent->getHardwareGroupId(), "676:1.78", 1000, "speed", $crackerBinary->getId());

if(!isset($benchmark)) {
$this->testFailed("BenchmarkTest:testAddToCache", "Cannot add benchmark to cache");
} else {
$this->testSuccess("BenchmarkTest:testAddToCache");
}

$this->crackerBinary = $crackerBinary; //save crackerbinary for future tests
}

private function testGetFromCache(){
$benchmark = BenchmarkUtils::getBenchmarkByValue("#HL# -a 3 ?l?l?l?l -d 1 --force", $this->agent->getHardwareGroupId(), 1000, 1, $this->crackerBinary->getId());

if(!isset($benchmark)) {
$this->testFailed("BenchmarkTest:testGetFromCache", "Cannot get benchmark from cache in normal situation");
} else {
$this->testSuccess("BenchmarkTest:testGetFromCache");
}

$benchmark2 = BenchmarkUtils::getBenchmarkByValue("#HL# -a3 ?l?l?l?l -d 1 --force", $this->agent->getHardwareGroupId(),1000, 1, $this->crackerBinary->getId());
$benchmark3 = BenchmarkUtils::getBenchmarkByValue("#HL# -d 1 --attack-mode 3 ?l?l?l?l --force", $this->agent->getHardwareGroupId(),1000, 1, $this->crackerBinary->getId());
$benchmark4 = BenchmarkUtils::getBenchmarkByValue("#HL# --force -a3 ?l?l?l?l -d 1", $this->agent->getHardwareGroupId(), 1000, 1, $this->crackerBinary->getId());

if(!isset($benchmark2) || !isset($benchmark3) || !isset($benchmark4)) {
$this->testFailed("BenchmarkTest:testGetFromCache", "Cannot get benchmark from cache with parsing commandline in different formats");
} else {
$this->testSuccess("BenchmarkTest:testGetFromCache");
}
}

private function testDeleteCache() {
BenchmarkUtils::deleteCache();
$benchmark = BenchmarkUtils::getBenchmarkByValue("#HL# -a 3 ?l?l?l?l -d 1 --force", $this->agent->getHardwareGroupId(), 1000, "1", $this->crackerBinary->getId());
if(isset($benchmark)) {
$this->testFailed("BenchmarkTest:testDeleteCache", "There is still a value in the cache!");
} else {
$this->testSuccess("BenchmarkTest:testDeleteCache");
}
}

private function testTtl() {
$benchmark = new Benchmark(3, "speed", "1234:88","#HL# -a 3 ?u?u?u", 200, $this->agent->getHardwareGroupId(), time() - 10, $this->crackerBinary->getId()); //ttl in the past to test invalid ttl
Factory::getBenchmarkFactory()->save($benchmark);
$found = BenchmarkUtils::getBenchmarkByValue("#HL# -a 3 ?u?u?u", $this->agent->getHardwareGroupId(), 200, 1, $this->crackerBinary->getId());
if($found != null) {
$this->testFailed("BenchmarkTest:testTtl", "benchmark with ttl in the past should not be valid!");
} else {
$this->testSuccess("BenchmarkTest:testTtl");
}
}
}

HashtopolisTestFramework::register(new BenchmarkTest());
8 changes: 8 additions & 0 deletions doc/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
## Bugfixes
- Clicking pretask in Supertask create screen now directs correctly to the pretask and not a task with the same id (#945)

## Benchmark cache system
A cache for the benchmarks so that benchmarks can be reused and the benchmark process can be skipped when the benchmark has already been cached.
Key components:

- Added a benchmark model. The benchmark model got a field for all the dependencies of the benchmark output. These are the benchmark type (speed or runtime), the cracker binary, the hardware that is used, the attack parameters and the hashmode.
- Agents are split up into hardware groups, so that benchmark can be linked to a hardwaregroup and not a single agent.
- Benchmarks get invalidated by a time to live.
- frontend for the benchmarks in /benchmark.php to show what has been cached and to manually remove values.

# v0.13.1 -> v0.14.0

Expand Down
11 changes: 7 additions & 4 deletions src/agents.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
//show agent detail
Template::loadInstance("agents/detail");
$agent = Factory::getAgentFactory()->get($_GET['id']);
$hardwareGroup = Factory::getHardwareGroupFactory()->get($agent->getHardwareGroupId());
if (!$agent) {
UI::printError("ERROR", "Agent not found!");
}
Expand All @@ -64,12 +65,12 @@
}
else {
// uniq devices lines and prepend with count
$tmp_devices_tuple = array_count_values(explode("\n", $agent->getDevices()));
$tmp_devices_tuple = array_count_values(explode("\n", $hardwareGroup->getDevices()));
$devices_tuple = array();
foreach ($tmp_devices_tuple as $key => $value) {
$devices_tuple[] = str_replace("*", "&nbsp;&nbsp", sprintf("%'*2d&times ", $value) . $key);
}
$agent->setDevices(implode("\n", $devices_tuple));
$agent->setHardwareGroupId(implode("\n", $devices_tuple));

UI::add('agent', $agent);
UI::add('users', Factory::getUserFactory()->filter([]));
Expand Down Expand Up @@ -158,12 +159,14 @@
$joined = Factory::getAccessGroupFactory()->filter([Factory::FILTER => $qF, Factory::JOIN => $jF]);
$accessGroupAgents->addValue($agent->getId(), $joined[Factory::getAccessGroupFactory()->getModelName()]);
// uniq devices lines and prepend with count
$tmp_devices_tuple = array_count_values(explode("\n", $agent->getDevices()));
$hardwareGroup = Factory::getHardwareGroupFactory()->get($agent->getHardwareGroupId());

$tmp_devices_tuple = array_count_values(explode("\n", $hardwareGroup->getDevices()));
$devices_tuple = array();
foreach ($tmp_devices_tuple as $key => $value) {
$devices_tuple[] = str_replace("*", "&nbsp;&nbsp", sprintf("%'*2d&times ", $value) . $key);
}
$agent->setDevices(implode("\n", $devices_tuple));
$agent->setHardwareGroupId(implode("\n", $devices_tuple));
}

UI::add('accessGroupAgents', $accessGroupAgents);
Expand Down
2 changes: 2 additions & 0 deletions src/api/v2/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ public function process(Request $request, RequestHandler $handler): Response {
require __DIR__ . "/../../inc/apiv2/users.routes.php";
require __DIR__ . "/../../inc/apiv2/vouchers.routes.php";
require __DIR__ . "/../../inc/apiv2/taskwrappers.routes.php";
require __DIR__ . "/../../inc/apiv2/benchmark.routes.php";
require __DIR__ . "/../../inc/apiv2/hardwaregroup.routes.php";


$errorMiddleware = $app->addErrorMiddleware(true, true, true);
Expand Down
58 changes: 58 additions & 0 deletions src/benchmark.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php
use DBA\QueryFilter;
use DBA\Factory;
use DBA\OrderFilter;
use DBA\CrackerBinary;

require_once(dirname(__FILE__) . "/inc/load.php");

if (!Login::getInstance()->isLoggedin()) {
header("Location: index.php?err=4" . time() . "&fw=" . urlencode($_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING']));
die();
}

Template::loadInstance("benchmarks/index");

s3inlc marked this conversation as resolved.
Show resolved Hide resolved
AccessControl::getInstance()->checkPermission(DViewControl::AGENTS_VIEW_PERM);

Menu::get()->setActive("benchmark_cache");

if (isset($_POST['action']) && CSRF::check($_POST['csrf'])) {
$benchmarkHandler = new BenchmarkHandler();
$benchmarkHandler->handle($_POST['action']);
if (UI::getNumMessages() == 0) {
Util::refresh();
}
}

$benchmarks = Factory::getBenchmarkFactory()->filter([]);

$oF = new OrderFilter(CrackerBinary::CRACKER_BINARY_ID, "DESC");
$versions = Factory::getCrackerBinaryFactory()->filter([Factory::ORDER => $oF]);
usort($versions, ["Util", "versionComparisonBinary"]);

foreach ($benchmarks as $benchmark) {
//format the devices pretty
$devices = HardwareGroupUtils::getDevicesFromBenchmark($benchmark);

$tmp_devices_tuple = array_count_values(explode("\n", $devices));
$devices_tuple = array();
foreach ($tmp_devices_tuple as $key => $value) {
$devices_tuple[] = str_replace("*", "&nbsp;&nbsp", sprintf("%'*2d&times ", $value) . $key);
}
$benchmark->setHardwareGroupId(implode("\n", $devices_tuple));

//get the correct cracker binary for the benchmarks
foreach ($versions as $version) {
if ($benchmark->getCrackerBinaryId() == $version->getId()) {

$benchmark->setCrackerBinaryId($version->getBinaryName() . " " . $version->getVersion());
break;
}
}
}

UI::add('benchmarks', $benchmarks);
UI::add('numBenchmarks', sizeof($benchmarks));

echo Template::getInstance()->render(UI::getObjects());
23 changes: 23 additions & 0 deletions src/dba/Factory.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class Factory {
private static $fileFactory = null;
private static $hashFactory = null;
private static $hashBinaryFactory = null;
private static $benchmarkFactory = null;
private static $hardwareGroupFactory = null;
private static $hashlistFactory = null;
private static $hashTypeFactory = null;
private static $logEntryFactory = null;
Expand Down Expand Up @@ -137,6 +139,27 @@ public static function getConfigFactory() {
return self::$configFactory;
}
}

public static function getBenchmarkFactory() {
if (self::$benchmarkFactory == null) {
$f = new BenchmarkFactory();
self::$benchmarkFactory = $f;
return $f;
} else {
return self::$benchmarkFactory;
}
}

public static function getHardwareGroupFactory() {
if (self::$hardwareGroupFactory == null) {
$f = new HardwareGroupFactory();
self::$hardwareGroupFactory = $f;
return $f;
} else {
return self::$hardwareGroupFactory;
}
}


public static function getConfigSectionFactory() {
if (self::$configSectionFactory == null) {
Expand Down
20 changes: 10 additions & 10 deletions src/dba/models/Agent.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Agent extends AbstractModel {
private $agentName;
private $uid;
private $os;
private $devices;
private $hardwareGroupId;
private $cmdPars;
private $ignoreErrors;
private $isActive;
Expand All @@ -20,12 +20,12 @@ class Agent extends AbstractModel {
private $cpuOnly;
private $clientSignature;

function __construct($agentId, $agentName, $uid, $os, $devices, $cmdPars, $ignoreErrors, $isActive, $isTrusted, $token, $lastAct, $lastTime, $lastIp, $userId, $cpuOnly, $clientSignature) {
function __construct($agentId, $agentName, $uid, $os, $hardwareGroupId, $cmdPars, $ignoreErrors, $isActive, $isTrusted, $token, $lastAct, $lastTime, $lastIp, $userId, $cpuOnly, $clientSignature) {
$this->agentId = $agentId;
$this->agentName = $agentName;
$this->uid = $uid;
$this->os = $os;
$this->devices = $devices;
$this->hardwareGroupId = $hardwareGroupId;
$this->cmdPars = $cmdPars;
$this->ignoreErrors = $ignoreErrors;
$this->isActive = $isActive;
Expand All @@ -45,7 +45,7 @@ function getKeyValueDict() {
$dict['agentName'] = $this->agentName;
$dict['uid'] = $this->uid;
$dict['os'] = $this->os;
$dict['devices'] = $this->devices;
$dict['hardwareGroupId'] = $this->hardwareGroupId;
$dict['cmdPars'] = $this->cmdPars;
$dict['ignoreErrors'] = $this->ignoreErrors;
$dict['isActive'] = $this->isActive;
Expand All @@ -67,7 +67,7 @@ static function getFeatures() {
$dict['agentName'] = ['read_only' => False, "type" => "str(100)", "subtype" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "agentName"];
$dict['uid'] = ['read_only' => False, "type" => "str(100)", "subtype" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "uid"];
$dict['os'] = ['read_only' => False, "type" => "int", "subtype" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "os"];
$dict['devices'] = ['read_only' => False, "type" => "str(65535)", "subtype" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "devices"];
$dict['hardwareGroupId'] = ['read_only' => False, "type" => "int", "subtype" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "hardwareGroupId"];
$dict['cmdPars'] = ['read_only' => False, "type" => "str(256)", "subtype" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "cmdPars"];
$dict['ignoreErrors'] = ['read_only' => False, "type" => "bool", "subtype" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "ignoreErrors"];
$dict['isActive'] = ['read_only' => False, "type" => "bool", "subtype" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "isActive"];
Expand Down Expand Up @@ -131,12 +131,12 @@ function setOs($os) {
$this->os = $os;
}

function getDevices() {
return $this->devices;
function getHardwareGroupId() {
return $this->hardwareGroupId;
}

function setDevices($devices) {
$this->devices = $devices;
function setHardwareGroupId($hardwareGroupId) {
$this->hardwareGroupId = $hardwareGroupId;
}

function getCmdPars() {
Expand Down Expand Up @@ -231,7 +231,7 @@ function setClientSignature($clientSignature) {
const AGENT_NAME = "agentName";
const UID = "uid";
const OS = "os";
const DEVICES = "devices";
const HARDWARE_GROUP_ID = "hardwareGroupId";
const CMD_PARS = "cmdPars";
const IGNORE_ERRORS = "ignoreErrors";
const IS_ACTIVE = "isActive";
Expand Down
2 changes: 1 addition & 1 deletion src/dba/models/AgentFactory.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function getNullObject() {
* @return Agent
*/
function createObjectFromDict($pk, $dict) {
$o = new Agent($dict['agentId'], $dict['agentName'], $dict['uid'], $dict['os'], $dict['devices'], $dict['cmdPars'], $dict['ignoreErrors'], $dict['isActive'], $dict['isTrusted'], $dict['token'], $dict['lastAct'], $dict['lastTime'], $dict['lastIp'], $dict['userId'], $dict['cpuOnly'], $dict['clientSignature']);
$o = new Agent($dict['agentId'], $dict['agentName'], $dict['uid'], $dict['os'], $dict['hardwareGroupId'], $dict['cmdPars'], $dict['ignoreErrors'], $dict['isActive'], $dict['isTrusted'], $dict['token'], $dict['lastAct'], $dict['lastTime'], $dict['lastIp'], $dict['userId'], $dict['cpuOnly'], $dict['clientSignature']);
return $o;
}

Expand Down
Loading