Commit 3c1a7b9a authored by jan.koester's avatar jan.koester
Browse files

plugin fixed

parent 14f595e3
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -432,6 +432,15 @@ namespace blogi {
                throw exp;
            }

            redisReply *reply = (redisReply*)redisCommand(_RedisCTX, "AUTH %s", Args->config->getRedisPassword());
            if (reply->type == REDIS_REPLY_ERROR) {
                libhttppp::HTTPException exp;
                exp[libhttppp::HTTPException::Warning] << "media plugin err: " << _RedisCTX->errstr;
                throw exp;
            }
            freeReplyObject(reply);


        }

        bool Controller(netplus::con *curcon,libhttppp::HttpRequest *req,libhtmlpp::HtmlElement page){
+6 −0
Original line number Diff line number Diff line
@@ -149,6 +149,12 @@ const char * blogi::Config::getRedisHost(){
    return nullptr;
}

const char * blogi::Config::getRedisPassword(){
    if(_PlsConfig->getKey("/BLOGI/REDIS/PASSWORD"))
        return _PlsConfig->getValue(_PlsConfig->getKey("/BLOGI/REDIS/PASSWORD"),0);
    return nullptr;
}

int blogi::Config::getRedisPort(){
    if(_PlsConfig->getKey("/BLOGI/REDIS/PORT"))
        return _PlsConfig->getIntValue(_PlsConfig->getKey("/BLOGI/REDIS/PORT"),0);
+1 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ namespace blogi {

        const char *getRedisHost();
        int         getRedisPort();
        const char *getRedisPassword();

    private:
        Config();