Started integrating external systems

This commit is contained in:
2026-07-23 14:48:30 +02:00
parent 8e218fd4ba
commit 4abb94b88c
21 changed files with 485 additions and 33 deletions
+25 -9
View File
@@ -2,7 +2,7 @@
/*****************************************************************************
IP Reg, a PHP/MySQL IPAM tool
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
Copyright (C) 2011-2023 Thomas Hooge
Copyright (C) 2011-2026 Thomas Hooge
SPDX-License-Identifier: GPL-3.0-or-later
*****************************************************************************/
@@ -30,14 +30,14 @@ define ('ACT_PASSWORD', 14);
// ========== GLOBAL PAGE START CODE ==========================================
// global version string
$config_version = 'v0.9.1';
$config_version = 'v0.10';
// available languages
$config_lang = array('de', 'en');
include("lib/functions.php");
require_once('smarty3/Smarty.class.php');
require_once('smarty4/Smarty.class.php');
$smarty = new Smarty();
$smarty->template_dir = 'tpl';
$smarty->compile_dir = 'tpl_c';
@@ -205,7 +205,7 @@ function submit_error($action) {
return sprintf('The action "%s" is unknown. It is probably a program error.<br> Please inform your administrator of the exact circumstances of how this situation came about.', strtoupper($action));
}
// ========== DATABASE FUCTIONS ===============================================
// ========== DATABASE FUNCTIONS ==============================================
function db_load_enum($table, $column) {
// returns array of enum-values as defined in database
@@ -305,7 +305,13 @@ function db_get_options_zone($default = NULL) {
return $options;
}
// ========== MISC FUCTIONS ===================================================
// ========== MISC FUNCTIONS ==================================================
function header_location($location) {
// redirect page
header('location:' . $location);
exit;
}
function strip_mac($mac, $caps=true) {
// strip mac address to 12 char string
@@ -347,8 +353,18 @@ function write_mac($mac, $user_mac='xx:xx:xx:xx:xx:xx') {
return $user_mac;
}
function header_location($location) {
// redirect page
header('location:' . $location);
exit;
function extlink_enabled() {
// check if any link to external system is enabled
global $config_ext;
foreach ($config_ext as $xcfg) {
if (!array_key_exists('enabled', $xcfg)) {
// invalid configuration
// TODO Throw warning!
continue;
}
if ($xcfg['enabled']) {
return true;
}
}
return false;
}