X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/5ee0e5fcab7c55065de6603833ea6f5e86ac2d32..e6a16fe920961e805c1b6a901692229e33006e3e:/widget/contact.php?ds=sidebyside diff --git a/widget/contact.php b/widget/contact.php index ed0a082..6ccb79a 100644 --- a/widget/contact.php +++ b/widget/contact.php @@ -2,24 +2,25 @@ $error = NULL; if ($_POST) { global $User; - if ($User) { + if ($User->login) { $_REQUEST['login'] = $User->login; $_REQUEST['email'] = $_REQUEST['email'] ?: $User->email; } else { unset($_REQUEST['login']); } - $error = mailform($_REQUEST); + $error = mailform($_REQUEST, $Page->place); if (!empty($error)) { print "
$error
\n\n"; } } -function mailform($input = []) +function mailform($input = [], $config = []) { - $source = empty($input['subject']) ? 'reactie' : $input['subject']; + $source = $config['subject'] ?? + (empty($input['subject']) ? 'reactie' : $input['subject']); $domain = preg_replace('/^www\./', '', $_SERVER['HTTP_HOST']); - $rcpt = "info@$domain"; + $rcpt = $config['rcpt'] ?? "info@$domain"; $subject = "Formulier {$_SERVER['HTTP_HOST']}: $source"; if (!$input) { @@ -39,7 +40,6 @@ switch ($source) { if (empty($input['naam']) or empty($input['huis'])) { return 'De bedoeling is juist dat je opgeeft wie er komt.'; } - $rcpt .= ', Heleen