Hanno Böck
Spaces between string concat (.) operator, new PER codingstyle
Hanno Böck commited 354c05a at 2023-10-31 17:49:30
<?php
/*
This file belongs to the Webinterface of schokokeks.org Hosting
Written by schokokeks.org Hosting, namely
Bernd Wurst <bernd@schokokeks.org>
Hanno Böck <hanno@schokokeks.org>
This code is published under a 0BSD license.
Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
*/
require_once('class/database.php');
require_once('inc/debug.php');
function config($key, $localonly = false)
{
global $config;
if ($key == "modules") {
// Stelle sicher, dass das "index"-Modul immer aktiv ist!
if (!in_array("index", $config['modules'])) {
$config['modules'][] = "index";
}
// Stelle sicher, dass das "about"-Modul immer aktiv ist!
if (!in_array("about", $config['modules'])) {
$config['modules'][] = "about";
}
}
if ($key == 'modules' && isset($_SESSION['restrict_modules'])) {
$modules = [];
foreach ($config['modules'] as $mod) {
if (in_array($mod, $_SESSION['restrict_modules'])) {
$modules[] = $mod;
}
}
return $modules;
}
if (array_key_exists($key, $config)) {
return $config[$key];
}
if ($localonly) {
return null;
}
/* read configuration from database */
$result = db_query("SELECT `key`, value FROM misc.config");
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX