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

fix

parent 3a5baf4f
Loading
Loading
Loading
Loading
+8 −11
Changes for plugins/nginxfiler/filer.cpp: 8 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -177,25 +177,24 @@ namespace blogi {
                else
                    ss << "http://" << _NHost << ":" << _NPort << _NPrefix;

                std::cout << ss.str() << std::endl;

                libhttppp::HttpUrl url(ss.str());

                libhttppp::HttpRequest nreq;

                libhttppp::HttpClient client(url);

                std::vector<char> json = client.Get(nreq);

                json.push_back('\0');

				std::cerr << "json: " << json.data() << std::endl;

                struct json_object *ndir;

                enum json_tokener_error jerrno;

                ndir = json_tokener_parse_verbose(json.data(),&jerrno);

                std::cout << json.data()  << std::endl;

                if(jerrno != json_tokener_success){
                    libhttppp::HTTPException e;
                    e[libhttppp::HTTPException::Error] << "nginxfiler: counld't read json !";
@@ -203,16 +202,14 @@ namespace blogi {
                    throw e;
                }

                std::cout << "test2" << std::endl;

                libhtmlpp::HtmlString fileHtml,out;


                RenderUI(path,ndir,fileHtml);

                libhtmlpp::HtmlElement *fel=(libhtmlpp::HtmlElement*)fileHtml.parse();
                libhtmlpp::HtmlElement fel=(libhtmlpp::HtmlElement*)fileHtml.parse();

                if(page->getElementbyID("main") && fel)
                if(page->getElementbyID("main"))
                    page->getElementbyID("main")->appendChild(fel);

                Args->theme->printSite(tid,out,page,req.getRequestURL(),Args->auth->isLoggedIn(tid,req,sessionid));
@@ -226,14 +223,12 @@ namespace blogi {
                libhttppp::HttpResponse curres;
                libhtmlpp::HtmlString error,out;

                Args->theme->printSite(tid,out,page,req.getRequestURL(),Args->auth->isLoggedIn(tid,req,sessionid));

                std::string enc;
                libhtmlpp::HtmlEncode(e.what(),enc);

                error << "<div class=\"errormsg\" >" << enc << "</div>";

                libhtmlpp::HtmlElement *index=(libhtmlpp::HtmlElement*)out.parse(),*main=nullptr;
                libhtmlpp::HtmlElement *index=page,*main=nullptr;

                if(index)
                    main=index->getElementbyID("main");
@@ -248,6 +243,8 @@ namespace blogi {

                main->insertChild(error.parse());

                Args->theme->printSite(tid, out, page, req.getRequestURL(), Args->auth->isLoggedIn(tid, req, sessionid));

                curres.send(req, out.c_str(),out.size());
            }
            return true;