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

fixes

parent 95491cbd
Loading
Loading
Loading
Loading
Loading
+3 −16
Changes for src/api.cpp: 3 added lines, 16 removed lines.
Original line number Diff line number Diff line
@@ -59,26 +59,13 @@ namespace authdb {
                    if(strcmp(key,"checkgpo")==0){
                        const char *id=json_object_get_string(val);

                        Gpo gpo;
                        GpoData gpdat(id);
                        size_t spos=sizeof(AuthHeader);
                        gpo.info(_Backend,gpdat,spos);

                        GpoData::Allow allow;
                        gpdat.getAlowed(allow);

                        bool alowed=gpdat.getGpoValue();

                        for(size_t ii =0; ii<allow.count; ++ii ){
                            if( _SessionData->isMemberOf(allow.uid[ii]) ){
                                    alowed = alowed ? false : true;
                            }
                        }
                        uuid gpoid;
                        gpoid.parse(id);

                        json_object *respid=json_object_new_object();
                        json_object *value=json_object_new_object();

                        json_object_object_add(value,id,json_object_new_boolean(alowed));
                        json_object_object_add(value,id,json_object_new_boolean(_SessionData->checkGPO(gpoid)));
                        json_object_object_add(respid,"gpo",value);

                        json_object_array_add(response,respid);
+3 −3
Changes for src/session.cpp: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -248,7 +248,7 @@ const authdb::SessionData *authdb::Session::addSession(AuthBackend &backend,uuid
                GpoData::Allow allow;
                gpodat.getAlowed(allow);
                for(size_t i =0; i< allow.count; ++i){
                    if(member.value==allow.uid[i]){
                    if(member==allow.uid[i]){
                        gpores->GPORes=gpores->GPORes ? false : true;
                    }
                }
@@ -344,8 +344,8 @@ const authdb::SessionData *authdb::Session::firstData() const{
    return _firstData;
}

bool authdb::SessionData::checkGPO(uuid gpoid){
    for(GPOResult *cures=&_GPOResult; cures; cures=cures->next){
bool authdb::SessionData::checkGPO(uuid gpoid) const{
    for(const GPOResult *cures=&_GPOResult; cures; cures=cures->next){
        if(cures->GPOId==gpoid){
            return cures->GPORes;
        }
+1 −1
Changes for src/session.h: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ namespace authdb {
        void clear();
        bool empty() const;

        bool checkGPO(uuid gpoid);
        bool checkGPO(uuid gpoid) const;

    private: