diff --git a/contact.php b/contact.php new file mode 100644 index 0000000..ef73e00 --- /dev/null +++ b/contact.php @@ -0,0 +1,75 @@ +iUserId); + +/* Restrict error to logged-in users */ +if(!$oUser->isLoggedIn()) + util_show_error_page_and_exit("You need to be logged in."); + + +$oRecipient = new User($aClean['iRecipientId']); + +if(!User::exists($oRecipient->sEmail)) + util_show_error_page_and_exit("User not found"); + +/* Check for errors */ +if((!$aClean['sMessage'] || !$aClean['sSubject']) && $aClean['sSubmit']) +{ + $error = "Please enter both a subject and a ". + "message."; + $aClean['sSubmit'] = ""; +} + +/* Display the feedback form if nothing else is specified */ +if(!$aClean['sSubmit']) +{ + apidb_header("E-mail $oRecipient->sRealname"); + echo html_frame_start("Send us your suggestions",400,"",0); + + echo $error; + echo "
"; + echo "

E-mail $oRecipient->sRealname.

"; + echo html_table_begin("width\"100%\" border=\"0\" cellpadding=\"2\"". + "cellspacing=\"2\""); + echo html_tr(array( + array("Subject", ""), + ""), + "color4"); + echo html_tr(array( + array("Message", "valign=\"top\""), + ""), + "color4"); + echo html_tr(array( + "", + "") + ); + + echo "iUserId\" />"; + + echo html_table_end(); + echo "
\n"; + + echo html_frame_end(" "); + +} else if ($aClean['sSubject'] && $aClean['sMessage']) +{ + $sMsg = "The following message was sent to you from $oUser->sRealname "; + $sMsg .= "through the Wine AppDB contact form.\nTo Reply, visit "; + $sMsg .= APPDB_ROOT."contact.php?iRecipientId=$oUser->iUserId\n\n"; + $sMsg .= $aClean['sMessage']; + + mail_appdb($oRecipient->sEmail, $aClean['sSubject'], $sMsg); + + util_redirect_and_exit(BASE."index.php"); +} + +?> diff --git a/include/application.php b/include/application.php index 949ffe7..53a6423 100644 --- a/include/application.php +++ b/include/application.php @@ -662,7 +662,9 @@ class Application { while(list($index, $userIdValue) = each($other_maintainers)) { $oUser = new User($userIdValue); - echo "
  • ".$oUser->sRealname."
  • \n"; + echo "
  • $oUser->sRealname (iUserId\">". + "e-mail)
  • \n"; } echo "\n"; } else diff --git a/include/version.php b/include/version.php index b31e4c1..1152710 100644 --- a/include/version.php +++ b/include/version.php @@ -680,7 +680,8 @@ class Version { while(list($index, $userIdValue) = each($aAllMaintainers)) { $oUser = new User($userIdValue); - echo "
  • ".$oUser->sRealname."
  • "; + echo "
  • $oUser->sRealname (iUserId\">e-mail)
  • "; } echo "\n"; } else