Пример #1
0
Файл: exec.php Проект: nubix/cms
/**
* Wrapperfunktion
*/
function contact()
{
    if (!$_POST['submit']) {
        return showContactForm();
    } else {
        return validateContactForm();
    }
}
Пример #2
0
function executeSend($request)
{
    $errors = array();
    if (!$request->hasParameter("mootact")) {
        $errors["general"] = "Invalid submission";
        return $errors;
    }
    $mootact = $request->getParameter("mootact");
    if (!is_array($request->getParameter("mootact"))) {
        $errors["general"] = "Malformed submission";
        return $errors;
    }
    $errors = validateContactForm($mootact);
    if (count($errors)) {
        return $errors;
    }
    try {
        sendMessage($mootact);
    } catch (Exception $e) {
        $errors["general"] = 'Failed to send message. Please contact us directly at: <a href="mailto:' . mtConfig::get("send_to") . '">' . mtConfig::get("send_to") . '</a>';
    }
    return $errors;
}