Commit d8b18c82 authored by jan.koester's avatar jan.koester
Browse files

fixed contact response

parent d487e3a2
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -73,24 +73,24 @@ namespace blogi {
            }

            message.push_back('\0');
            libhtmlpp::HtmlString cform,out;

            if(!mail.empty() && !name.empty() && !message.empty() && sessionid){

                std::string subject="Message from Blogi(";

                subject+=name;
                subject+=") ";
                subject+=mail;
                sendMail(Args->smtp,_Receiver.c_str(),subject.c_str(),message);

            }
            libhtmlpp::HtmlString cform,out;

                cform << "<div id=\"contactform\" ><span>Mail versand!</span></div>";
            }else{
                cform << "<div id=\"contactform\" ><form method=\"post\" action=\"" << Args->config->buildurl("contact",buf,512)
                <<"\" ><p><label>Name: <input type=\"text\" id=\"name\" name=\"name\" ></label><label>Email:"
                << " <input id=\"mail\" name=\"mail\" type=\"text\"></label></p><p><label>Nachricht: <p><textarea id=\"message\""
                << " name=\"message\" ></textarea></p></label></p><p><input type=\"submit\" value=\"Senden\"></p></form></div>";

            }

            libhtmlpp::HtmlElement *hmain;
            if( (hmain=page->getElementbyID("main")) )
                    hmain->appendChild(cform.parse());
@@ -103,6 +103,7 @@ namespace blogi {
            curres.setState(HTTP200);
            curres.send(req, out.c_str(),out.size());
            return true;

        };

        const char *getName(){