Commit 800106dd authored by jan.koester's avatar jan.koester
Browse files

tetst

parent 5bc184a5
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -80,18 +80,24 @@ webedit::Config::Config(const std::string &path) : confplus::Config(path) {
        _language = "en";
    }

    // Parse AUTHDB sources
    // Parse AUTHDB sources (parallel arrays, same pattern as blogi server)
    try {
        auto *authKey = getKey("/WEBEDIT/AUTHDB");
        for (size_t i = 0; i < getElements(authKey); ++i) {
        auto *urlKey = getKey("/WEBEDIT/AUTHDB/URL");
        auto *nameKey = getKey("/WEBEDIT/AUTHDB/CLIENTNAME");
        auto *secretKey = getKey("/WEBEDIT/AUTHDB/CLIENTSECRET");
        size_t count = getElements(urlKey);
        for (size_t i = 0; i < count; ++i) {
            blogi::AuthSource src;
            src.url = getValue(urlKey, i);
            src.clientName = getValue(nameKey, i);
            src.clientSecret = getValue(secretKey, i);
            try {
                src.url = getValue(getKey("/WEBEDIT/AUTHDB/URL"), i);
                src.clientName = getValue(getKey("/WEBEDIT/AUTHDB/CLIENTNAME"), i);
                src.clientSecret = getValue(getKey("/WEBEDIT/AUTHDB/CLIENTSECRET"), i);
                src.domain = getValue(getKey("/WEBEDIT/AUTHDB/DOMAIN"), i);
                auto *domKey = getKey("/WEBEDIT/AUTHDB/DOMAIN");
                src.domain = getValue(domKey, i);
            } catch (...) {
                src.domain = "";
            }
            _authSources.push_back(std::move(src));
            } catch (...) {}
        }
    } catch (...) {}
}