git.shiar.nl
/
minimedit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nieuws: support tagged article links
[minimedit.git]
/
contact.php
diff --git
a/contact.php
b/contact.php
index c55ec0c033081af57341d891810722feb10aa547..9d0b1bcae9d16f15968dccf7621dd77237c058e4 100644
(file)
--- a/
contact.php
+++ b/
contact.php
@@
-1,6
+1,7
@@
<?php
$error = NULL;
if ($_POST) {
<?php
$error = NULL;
if ($_POST) {
+ global $User;
if (!empty($User)) {
$_REQUEST['login'] = $User['name'];
}
if (!empty($User)) {
$_REQUEST['login'] = $User['name'];
}
@@
-21,6
+22,14
@@
function mailform($input = [])
}
switch ($source) {
}
switch ($source) {
+ case 'melding':
+ if (empty($input['login'])) {
+ return "Inloggen is verplicht om een melding te plaatsen.";
+ }
+ if (empty($input['body'])) {
+ return "Geen bericht opgegeven.";
+ }
+ break;
case 'bbq':
if (empty($input['naam']) or empty($input['huis'])) {
return 'De bedoeling is juist dat je opgeeft wie er komt.';
case 'bbq':
if (empty($input['naam']) or empty($input['huis'])) {
return 'De bedoeling is juist dat je opgeeft wie er komt.';
@@
-49,7
+58,9
@@
switch ($source) {
}
$origin = $_SERVER['REMOTE_ADDR'];
}
$origin = $_SERVER['REMOTE_ADDR'];
- $origin .= sprintf(' (%s)', gethostbyaddr($origin));
+ if ($resolved = @gethostbyaddr($origin) and $resolved !== $origin) {
+ $origin .= sprintf(' (%s)', gethostbyaddr($origin));
+ }
$body = "Ingevuld vanaf $origin:\r\n\r\n";
foreach ($input as $k => $v) {
$body = "Ingevuld vanaf $origin:\r\n\r\n";
foreach ($input as $k => $v) {
@@
-67,6
+78,9
@@
switch ($source) {
case 'bbq':
print "<p>Bedankt voor je deelname. Tot ziens!</p>";
break;
case 'bbq':
print "<p>Bedankt voor je deelname. Tot ziens!</p>";
break;
+ case 'melding':
+ print "<p>Bedankt voor de melding. Na goedkeuring zal het hier geplaatst worden.</p>";
+ break;
default:
print '<p>Bedankt voor uw reactie!</p>';
}
default:
print '<p>Bedankt voor uw reactie!</p>';
}