request([ 'FROM' => $table, 'WHERE' => ['name' => 'enable_computer'], 'LIMIT' => 1, ]); $row = $iterator->current(); $values = [ 'value' => $enable_computer, 'date_mod' => $_SESSION['glpi_currenttime'] ?? date('Y-m-d H:i:s'), ]; if ($row === false) { $values['name'] = 'enable_computer'; $values['date_creation'] = $_SESSION['glpi_currenttime'] ?? date('Y-m-d H:i:s'); $DB->insert($table, $values); } else { $DB->update($table, $values, ['name' => 'enable_computer']); } Session::addMessageAfterRedirect( __('Configuration saved.', 'urbackup'), false, INFO ); Html::redirect(Config::getFormURL()); } } // Display GLPI header Html::header( __('UrBackup configuration', 'urbackup'), '', 'Config', 'PluginUrbackupConfig' ); // Show configuration form $config = new Config(); $config->showForm(1); // Display GLPI footer Html::footer();