From c324749267d31498f28b170dfb3d0d3968fadc61 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 18 Dec 2017 14:25:47 +0100 Subject: [sysconfig] Fix logic by which condition the LDADPd gets (re)started --- modules-available/sysconfig/page.inc.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules-available/sysconfig/page.inc.php') diff --git a/modules-available/sysconfig/page.inc.php b/modules-available/sysconfig/page.inc.php index 043645df..8053ab43 100644 --- a/modules-available/sysconfig/page.inc.php +++ b/modules-available/sysconfig/page.inc.php @@ -343,6 +343,9 @@ class Page_SysConfig extends Page Message::addError('main.empty-field'); Util::redirect('?do=sysconfig&locationid=' . $this->currentLoc); } + // Validate that either the configid is valid (in case we override for a specific location) + // or that if the locationid is 0 (=global) that the configid exists, because it's not allowed + // to unset the global config if ($this->currentLoc === 0 || $configid !== 0) { $row = Database::queryFirst("SELECT title, filepath FROM configtgz WHERE configid = :configid LIMIT 1", array('configid' => $configid)); if ($row === false) { @@ -358,6 +361,7 @@ class Page_SysConfig extends Page Database::exec("INSERT INTO configtgz_location (locationid, configid) VALUES (:locationid, :configid)" . " ON DUPLICATE KEY UPDATE configid = :configid", compact('locationid', 'configid')); } + Event::activeConfigChanged(); Util::redirect('?do=sysconfig&locationid=' . $this->currentLoc); } -- cgit v1.2.3-55-g7522