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

test

parent 144625c7
Loading
Loading
Loading
Loading
+3 −3
Changes for src/blogi.cpp: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -177,8 +177,7 @@ blogi::Blogi::Blogi(std::vector<netplus::socket*> serversocket,bool debug) : Htt

    cban.init();

    std::string _lang = getLang(*initdb);
    cban.addRule(id,tr(_lang,"Technical Required").c_str(),tr(_lang,"This Cookie is Required for Authentication and some Basic Funtions of this Blog").c_str(),true);
    cban.addRule(id,"Technical Required","This Cookie is Required for Authentication and some Basic Funtions of this Blog",true);

    BlogiPlg = std::make_unique<Plugin>();

@@ -1628,7 +1627,8 @@ RETRY_REQUEST:
            }

            if(!found){
                blogi::print(*PlgArgs->database[tid],curreq.getRequestURL(),index,CookieEl);
                std::string _clang = getLang(*PlgArgs->database[tid]);
                blogi::print(*PlgArgs->database[tid],_clang,curreq.getRequestURL(),index,CookieEl);
            }else{
                std::string buf;

+4 −3
Changes for src/cookie.cpp: 4 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <algorithm>

#include "cookie.h"
#include "i18n.h"

void blogi::CookieBanner::init(){
    dbpp::SQL sql;
@@ -78,7 +79,7 @@ void blogi::CookieBanner::addRule(uuid::uuid id,const char* cookname, const char
    }
}

void blogi::print(dbpp::Database &db,const std::string &curl,libhtmlpp::HtmlElement& page,libhtmlpp::HtmlElement cookietpl){
void blogi::print(dbpp::Database &db,const std::string &lang,const std::string &curl,libhtmlpp::HtmlElement& page,libhtmlpp::HtmlElement cookietpl){
    dbpp::DBResult res;
    dbpp::SQL sql;

@@ -92,13 +93,13 @@ void blogi::print(dbpp::Database &db,const std::string &curl,libhtmlpp::HtmlElem
    libhtmlpp::HtmlString input;

    for(int i=0; i<ret; ++i ){
        input << "<label for=\"" << res[i][0] << "\">"<< res[i][1] << "</label>"
        input << "<label for=\"" << res[i][0] << "\">"<< tr(lang,res[i][1]).c_str() << "</label>"
                 << "<input id=\"" << res[i][0] << "\" name=\""<< res[i][0] << "\" ";
        if(strcmp(res[i][3],"t")==0){
             input << "onclick=\"return false;\"";
        }
        input << " checked=\"\" type=\"checkbox\">";
        ctable << (libhtmlpp::HtmlTable::Row() << input << res[i][2]);
        ctable << (libhtmlpp::HtmlTable::Row() << input << tr(lang,res[i][2]).c_str());
        input.clear();
   }

+1 −1
Changes for src/cookie.h: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -57,5 +57,5 @@ namespace blogi {
    Session                          session;
  };

  void print(dbpp::Database &db,const std::string &curl,libhtmlpp::HtmlElement &page,libhtmlpp::HtmlElement cookietpl);
  void print(dbpp::Database &db,const std::string &lang,const std::string &curl,libhtmlpp::HtmlElement &page,libhtmlpp::HtmlElement cookietpl);
};