summaryrefslogtreecommitdiffstats
path: root/modules-available
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available')
-rw-r--r--modules-available/baseconfig/inc/validator.inc.php2
-rw-r--r--modules-available/dozmod/api.inc.php2
-rw-r--r--modules-available/dozmod/page.inc.php2
-rw-r--r--modules-available/dozmod/pages/actionlog.inc.php2
-rw-r--r--modules-available/exams/page.inc.php4
-rw-r--r--modules-available/locationinfo/page.inc.php2
-rw-r--r--modules-available/locations/inc/location.inc.php4
-rw-r--r--modules-available/rebootcontrol/pages/task.inc.php2
-rw-r--r--modules-available/statistics/inc/statistics.inc.php2
-rw-r--r--modules-available/statistics/inc/statisticsfilter.inc.php4
-rw-r--r--modules-available/statistics/pages/projectors.inc.php2
-rw-r--r--modules-available/sysconfig/addconfig.inc.php8
-rw-r--r--modules-available/sysconfig/addmodule.inc.php10
-rw-r--r--modules-available/sysconfig/inc/configmodule.inc.php24
-rw-r--r--modules-available/sysconfig/inc/configmodulebaseldap.inc.php2
-rw-r--r--modules-available/sysconfig/inc/configtgz.inc.php12
16 files changed, 42 insertions, 42 deletions
diff --git a/modules-available/baseconfig/inc/validator.inc.php b/modules-available/baseconfig/inc/validator.inc.php
index f7bbc861..38c595c4 100644
--- a/modules-available/baseconfig/inc/validator.inc.php
+++ b/modules-available/baseconfig/inc/validator.inc.php
@@ -34,7 +34,7 @@ class Validator
case 'multiinput':
return self::validateMultiInput($data[1] ?? [], $displayValue);
default:
- Util::traceError('Unknown validation method: ' . $data[0]);
+ ErrorHandler::traceError('Unknown validation method: ' . $data[0]);
}
return false; // make code inspector happy - doesn't know traceError doesn't return
}
diff --git a/modules-available/dozmod/api.inc.php b/modules-available/dozmod/api.inc.php
index c2dc1cfa..c71ea946 100644
--- a/modules-available/dozmod/api.inc.php
+++ b/modules-available/dozmod/api.inc.php
@@ -291,7 +291,7 @@ function readImageParam()
$resource = Request::get('resource', false, 'string');
if ($resource === false) {
- Util::traceError("you have to specify the 'resource' parameter");
+ ErrorHandler::traceError("you have to specify the 'resource' parameter");
}
if (!in_array($resource, $availableRessources)) {
diff --git a/modules-available/dozmod/page.inc.php b/modules-available/dozmod/page.inc.php
index cf6e4857..a38c9d9d 100644
--- a/modules-available/dozmod/page.inc.php
+++ b/modules-available/dozmod/page.inc.php
@@ -22,7 +22,7 @@ class Page_DozMod extends Page
break;
}
} elseif (!in_array($this->section, $this->validSections)) {
- Util::traceError('Invalid section: ' . $this->section);
+ ErrorHandler::traceError('Invalid section: ' . $this->section);
}
// Check permissions
User::assertPermission($this->section . '.*');
diff --git a/modules-available/dozmod/pages/actionlog.inc.php b/modules-available/dozmod/pages/actionlog.inc.php
index 51fccb4f..0b6feb6f 100644
--- a/modules-available/dozmod/pages/actionlog.inc.php
+++ b/modules-available/dozmod/pages/actionlog.inc.php
@@ -11,7 +11,7 @@ class SubPage
User::assertPermission("actionlog.view");
self::$action = Request::get('action', '', 'string');
if (self::$action !== '' && self::$action !== 'showtarget' && self::$action !== 'showuser') {
- Util::traceError('Invalid action for actionlog: "' . self::$action . '"');
+ ErrorHandler::traceError('Invalid action for actionlog: "' . self::$action . '"');
}
self::$uuid = Request::get('uuid', '', 'string');
}
diff --git a/modules-available/exams/page.inc.php b/modules-available/exams/page.inc.php
index 317e56c0..458ae5b1 100644
--- a/modules-available/exams/page.inc.php
+++ b/modules-available/exams/page.inc.php
@@ -296,7 +296,7 @@ class Page_Exams extends Page
private function saveExam()
{
if (!Request::isPost()) {
- Util::traceError('Is not post');
+ ErrorHandler::traceError('Is not post');
}
/* process form-data */
$locationids = Request::post('locations', [], "ARRAY");
@@ -453,7 +453,7 @@ class Page_Exams extends Page
} elseif ($this->action === false) {
- Util::traceError("action not implemented");
+ ErrorHandler::traceError("action not implemented");
}
}
diff --git a/modules-available/locationinfo/page.inc.php b/modules-available/locationinfo/page.inc.php
index d4fa50ac..440a115d 100644
--- a/modules-available/locationinfo/page.inc.php
+++ b/modules-available/locationinfo/page.inc.php
@@ -425,7 +425,7 @@ class Page_LocationInfo extends Page
private function checkConnection($serverid = 0)
{
if ($serverid === 0) {
- Util::traceError('checkConnection called with no server id');
+ ErrorHandler::traceError('checkConnection called with no server id');
}
User::assertPermission('backend.check');
diff --git a/modules-available/locations/inc/location.inc.php b/modules-available/locations/inc/location.inc.php
index 718d32e3..65ea06f5 100644
--- a/modules-available/locations/inc/location.inc.php
+++ b/modules-available/locations/inc/location.inc.php
@@ -87,7 +87,7 @@ class Location
private static function flattenTreeAssoc($tree, $parents = array(), $depth = 0)
{
if ($depth > 20) {
- Util::traceError('Recursive location definition detected at ' . print_r($tree, true));
+ ErrorHandler::traceError('Recursive location definition detected at ' . print_r($tree, true));
}
$output = array();
foreach ($tree as $node) {
@@ -230,7 +230,7 @@ class Location
private static function flattenTree($tree, $depth = 0)
{
if ($depth > 20) {
- Util::traceError('Recursive location definition detected at ' . print_r($tree, true));
+ ErrorHandler::traceError('Recursive location definition detected at ' . print_r($tree, true));
}
$output = array();
foreach ($tree as $node) {
diff --git a/modules-available/rebootcontrol/pages/task.inc.php b/modules-available/rebootcontrol/pages/task.inc.php
index 322b1ea9..0e770618 100644
--- a/modules-available/rebootcontrol/pages/task.inc.php
+++ b/modules-available/rebootcontrol/pages/task.inc.php
@@ -93,7 +93,7 @@ class SubPage
} elseif ($type === RebootControl::TASK_WOL) {
// Nothing (yet)
} else {
- Util::traceError('oopsie');
+ ErrorHandler::traceError('oopsie');
}
$job['timestamp_s'] = Util::prettyTime($job['timestamp']);
Render::addTemplate('status-' . $template, $job);
diff --git a/modules-available/statistics/inc/statistics.inc.php b/modules-available/statistics/inc/statistics.inc.php
index e3eaccc0..d27c1a6a 100644
--- a/modules-available/statistics/inc/statistics.inc.php
+++ b/modules-available/statistics/inc/statistics.inc.php
@@ -19,7 +19,7 @@ class Statistics
} elseif ($returnData === Machine::RAW_DATA) {
self::$machineFields['data'] = true;
} else {
- Util::traceError('Invalid $returnData option passed');
+ ErrorHandler::traceError('Invalid $returnData option passed');
}
return implode(',', array_keys(self::$machineFields));
}
diff --git a/modules-available/statistics/inc/statisticsfilter.inc.php b/modules-available/statistics/inc/statisticsfilter.inc.php
index f33c423f..a53ef4d1 100644
--- a/modules-available/statistics/inc/statisticsfilter.inc.php
+++ b/modules-available/statistics/inc/statisticsfilter.inc.php
@@ -107,7 +107,7 @@ abstract class StatisticsFilter
if (empty($this->ops))
return;
if (!in_array($operator, $this->ops)) {
- Util::traceError("Invalid op '$operator' for " . get_class($this) . '::' . $this->column);
+ ErrorHandler::traceError("Invalid op '$operator' for " . get_class($this) . '::' . $this->column);
}
}
@@ -574,7 +574,7 @@ class LocationStatisticsFilter extends EnumStatisticsFilter
$operator = str_replace('~', '=', $operator);
if ($recursive && is_array($argument)) {
- Util::traceError('Cannot use ~ operator for location with array');
+ ErrorHandler::traceError('Cannot use ~ operator for location with array');
}
if ($recursive) {
$argument = array_keys(Location::getRecursiveFlat($argument));
diff --git a/modules-available/statistics/pages/projectors.inc.php b/modules-available/statistics/pages/projectors.inc.php
index 91abfe9c..01be2971 100644
--- a/modules-available/statistics/pages/projectors.inc.php
+++ b/modules-available/statistics/pages/projectors.inc.php
@@ -16,7 +16,7 @@ class SubPage
User::assertPermission('hardware.projectors.edit');
$hwid = Request::post('hwid', false, 'int');
if ($hwid === false) {
- Util::traceError('Param hwid missing');
+ ErrorHandler::traceError('Param hwid missing');
}
if ($action === 'addprojector') {
Database::exec('INSERT IGNORE INTO statistic_hw_prop (hwid, prop, value)'
diff --git a/modules-available/sysconfig/addconfig.inc.php b/modules-available/sysconfig/addconfig.inc.php
index af8aab37..8df700f9 100644
--- a/modules-available/sysconfig/addconfig.inc.php
+++ b/modules-available/sysconfig/addconfig.inc.php
@@ -33,7 +33,7 @@ abstract class AddConfig_Base
if (($editId = Request::any('edit', 0, 'int')) !== 0) {
self::$instance->edit = ConfigTgz::get($editId);
if (self::$instance->edit === false)
- Util::traceError('Invalid config id for editing');
+ ErrorHandler::traceError('Invalid config id for editing');
Util::addRedirectParam('edit', self::$instance->edit->id());
}
}
@@ -74,7 +74,7 @@ abstract class AddConfig_Base
public static function preprocess()
{
if (self::$instance === false) {
- Util::traceError('No step instance yet');
+ ErrorHandler::traceError('No step instance yet');
}
self::$instance->preprocessInternal();
}
@@ -82,7 +82,7 @@ abstract class AddConfig_Base
public static function render()
{
if (self::$instance === false)
- Util::traceError('No step instance yet');
+ ErrorHandler::traceError('No step instance yet');
if (self::$instance->edit !== false)
Message::addInfo('replacing-config', self::$instance->edit->title());
self::$instance->renderInternal();
@@ -91,7 +91,7 @@ abstract class AddConfig_Base
public static function ajax()
{
if (self::$instance === false) {
- Util::traceError('No step instance yet');
+ ErrorHandler::traceError('No step instance yet');
}
self::$instance->ajaxInternal();
}
diff --git a/modules-available/sysconfig/addmodule.inc.php b/modules-available/sysconfig/addmodule.inc.php
index 91fee45d..477326b8 100644
--- a/modules-available/sysconfig/addmodule.inc.php
+++ b/modules-available/sysconfig/addmodule.inc.php
@@ -34,9 +34,9 @@ abstract class AddModule_Base
if ($editId = $editId ? $editId : Request::any('edit')) {
self::$instance->edit = ConfigModule::get($editId);
if (self::$instance->edit === false)
- Util::traceError('Invalid module id for editing');
+ ErrorHandler::traceError('Invalid module id for editing');
if ($step !== 'AddModule_Assign' && !preg_match('/^' . self::$instance->edit->moduleType() . '_/', $step))
- Util::traceError('Module to edit is of different type!');
+ ErrorHandler::traceError('Module to edit is of different type!');
Util::addRedirectParam('edit', self::$instance->edit->id());
}
}
@@ -90,7 +90,7 @@ abstract class AddModule_Base
public static function preprocess()
{
if (self::$instance === false) {
- Util::traceError('No step instance yet');
+ ErrorHandler::traceError('No step instance yet');
}
self::$instance->preprocessInternal();
}
@@ -98,7 +98,7 @@ abstract class AddModule_Base
public static function render()
{
if (self::$instance === false) {
- Util::traceError('No step instance yet');
+ ErrorHandler::traceError('No step instance yet');
}
if (get_class(self::$instance) !== 'AddModule_Assign' && self::$instance->edit !== false) {
Message::addInfo('replacing-module', self::$instance->edit->title());
@@ -109,7 +109,7 @@ abstract class AddModule_Base
public static function ajax()
{
if (self::$instance === false) {
- Util::traceError('No step instance yet');
+ ErrorHandler::traceError('No step instance yet');
}
self::$instance->ajaxInternal();
}
diff --git a/modules-available/sysconfig/inc/configmodule.inc.php b/modules-available/sysconfig/inc/configmodule.inc.php
index fadc649a..269146d3 100644
--- a/modules-available/sysconfig/inc/configmodule.inc.php
+++ b/modules-available/sysconfig/inc/configmodule.inc.php
@@ -68,15 +68,15 @@ abstract class ConfigModule
public static function registerModule($id, $title, $description, $group, $unique, $sortOrder = 0)
{
if (isset(self::$moduleTypes[$id])) {
- Util::traceError("Config Module $id already registered!");
+ ErrorHandler::traceError("Config Module $id already registered!");
}
$moduleClass = 'ConfigModule_' . $id;
$wizardClass = $id . '_Start';
if (!class_exists($moduleClass)) {
- Util::traceError("Class $moduleClass does not exist!");
+ ErrorHandler::traceError("Class $moduleClass does not exist!");
}
if (!is_subclass_of($moduleClass, 'ConfigModule')) {
- Util::traceError("$moduleClass does not have ConfigModule as its parent!");
+ ErrorHandler::traceError("$moduleClass does not have ConfigModule as its parent!");
}
self::$moduleTypes[$id] = array(
'title' => $title,
@@ -277,10 +277,10 @@ abstract class ConfigModule
{
$name = get_class($this);
if ($name === false)
- Util::traceError('ConfigModule::moduleType: get_class($this) returned false!');
+ ErrorHandler::traceError('ConfigModule::moduleType: get_class($this) returned false!');
// ConfigModule_*
if (!preg_match('/^ConfigModule_(\w+)$/', $name, $out))
- Util::traceError('ConfigModule::moduleType: get_class($this) returned "' . $name . '"');
+ ErrorHandler::traceError('ConfigModule::moduleType: get_class($this) returned "' . $name . '"');
return $out[1];
}
@@ -295,7 +295,7 @@ abstract class ConfigModule
public final function insert($title)
{
if ($this->moduleId !== 0)
- Util::traceError('ConfigModule::insert called when moduleId != 0');
+ ErrorHandler::traceError('ConfigModule::insert called when moduleId != 0');
if (!$this->validateConfig())
return false;
$this->moduleTitle = $title;
@@ -311,7 +311,7 @@ abstract class ConfigModule
));
$this->moduleId = Database::lastInsertId();
if (!is_numeric($this->moduleId))
- Util::traceError('Inserting new config module into DB did not yield a numeric insert id');
+ ErrorHandler::traceError('Inserting new config module into DB did not yield a numeric insert id');
$this->moduleArchive = $this->createFileName();
Database::exec("UPDATE configtgz_module SET filepath = :path WHERE moduleid = :moduleid LIMIT 1", array(
'path' => $this->moduleArchive,
@@ -329,7 +329,7 @@ abstract class ConfigModule
public final function update($title = '')
{
if ($this->moduleId === 0)
- Util::traceError('ConfigModule::update called when moduleId == 0');
+ ErrorHandler::traceError('ConfigModule::update called when moduleId == 0');
if (!empty($title)) {
$this->moduleTitle = $title;
}
@@ -362,7 +362,7 @@ abstract class ConfigModule
public final function generate($deleteOnError, $parent = NULL, $timeoutMs = 0)
{
if ($this->moduleId === 0 || $this->moduleTitle === false)
- Util::traceError('ConfigModule::generateAsync called on uninitialized/uninserted module!');
+ ErrorHandler::traceError('ConfigModule::generateAsync called on uninitialized/uninserted module!');
$tmpTgz = '/tmp/bwlp-id-' . $this->moduleId . '_' . mt_rand() . '_' . time() . '.tgz';
$ret = $this->generateInternal($tmpTgz, $parent);
// Wait for generation if requested
@@ -398,7 +398,7 @@ abstract class ConfigModule
public final function delete()
{
if ($this->moduleId === 0)
- Util::traceError('ConfigModule::delete called with invalid module id!');
+ ErrorHandler::traceError('ConfigModule::delete called with invalid module id!');
$ret = Database::exec("DELETE FROM configtgz_module WHERE moduleid = :moduleid LIMIT 1", array(
'moduleid' => $this->moduleId
), true) !== false;
@@ -416,7 +416,7 @@ abstract class ConfigModule
private final function markUpdated($tmpTgz)
{
if ($this->moduleId === 0)
- Util::traceError('ConfigModule::markUpdated called with invalid module id!');
+ ErrorHandler::traceError('ConfigModule::markUpdated called with invalid module id!');
if ($this->moduleArchive === false)
$this->moduleArchive = $this->createFileName();
// Move file
@@ -463,7 +463,7 @@ abstract class ConfigModule
private final function markFailed()
{
if ($this->moduleId === 0)
- Util::traceError('ConfigModule::markFailed called with invalid module id!');
+ ErrorHandler::traceError('ConfigModule::markFailed called with invalid module id!');
if ($this->moduleArchive === false)
$this->moduleArchive = $this->createFileName();
if (!file_exists($this->moduleArchive))
diff --git a/modules-available/sysconfig/inc/configmodulebaseldap.inc.php b/modules-available/sysconfig/inc/configmodulebaseldap.inc.php
index 54e0febf..e3d99025 100644
--- a/modules-available/sysconfig/inc/configmodulebaseldap.inc.php
+++ b/modules-available/sysconfig/inc/configmodulebaseldap.inc.php
@@ -126,7 +126,7 @@ abstract class ConfigModuleBaseLdap extends ConfigModule
protected function validateConfig()
{
// Check if required fields are filled
- return Util::hasAllKeys($this->moduleData, self::$REQUIRED_FIELDS);
+ return ArrayUtil::hasAllKeys($this->moduleData, self::$REQUIRED_FIELDS);
}
public function setData($key, $value)
diff --git a/modules-available/sysconfig/inc/configtgz.inc.php b/modules-available/sysconfig/inc/configtgz.inc.php
index 015b5ccf..67e02503 100644
--- a/modules-available/sysconfig/inc/configtgz.inc.php
+++ b/modules-available/sysconfig/inc/configtgz.inc.php
@@ -26,7 +26,7 @@ class ConfigTgz
public function areAllModulesUpToDate()
{
if (!$this->configId > 0)
- Util::traceError('ConfigTgz::areAllModulesUpToDate called on un-inserted config.tgz!');
+ ErrorHandler::traceError('ConfigTgz::areAllModulesUpToDate called on un-inserted config.tgz!');
foreach ($this->modules as $module) {
if (!empty($module['filepath']) && file_exists($module['filepath'])) {
if ($module['status'] !== 'OK')
@@ -96,7 +96,7 @@ class ConfigTgz
public function generate($deleteOnError = false, $timeoutMs = 0, $parentTask = null)
{
if (!($this->configId > 0) || !is_array($this->modules) || $this->file === false)
- Util::traceError ('configId <= 0 or modules not array in ConfigTgz::rebuild()');
+ ErrorHandler::traceError('configId <= 0 or modules not array in ConfigTgz::rebuild()');
$files = array();
// Get all config modules for system config
foreach ($this->modules as $module) {
@@ -137,7 +137,7 @@ class ConfigTgz
public function delete()
{
if ($this->configId === 0)
- Util::traceError('ConfigTgz::delete called with invalid config id!');
+ ErrorHandler::traceError('ConfigTgz::delete called with invalid config id!');
$ret = Database::exec("DELETE FROM configtgz WHERE configid = :configid LIMIT 1",
['configid' => $this->configId], true);
if ($ret !== false) {
@@ -153,14 +153,14 @@ class ConfigTgz
public function markOutdated()
{
if ($this->configId === 0)
- Util::traceError('ConfigTgz::markOutdated called with invalid config id!');
+ ErrorHandler::traceError('ConfigTgz::markOutdated called with invalid config id!');
return $this->mark('OUTDATED');
}
private function markUpdated($task)
{
if ($this->configId === 0)
- Util::traceError('ConfigTgz::markUpdated called with invalid config id!');
+ ErrorHandler::traceError('ConfigTgz::markUpdated called with invalid config id!');
if ($this->areAllModulesUpToDate()) {
if (empty($task['data']['warnings'])) {
$warnings = '';
@@ -194,7 +194,7 @@ class ConfigTgz
private function markFailed()
{
if ($this->configId === 0)
- Util::traceError('ConfigTgz::markFailed called with invalid config id!');
+ ErrorHandler::traceError('ConfigTgz::markFailed called with invalid config id!');
if ($this->file === false || !file_exists($this->file))
return $this->mark('MISSING');
return $this->mark('OUTDATED');