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

add defaults gpo

parent fe397a1c
Loading
Loading
Loading
Loading
Loading
+22 −0
Changes for src/authdb.cpp: 22 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -53,6 +53,8 @@
#include "api.h"
#include "client.h"
#include "session.h"
#include "gpo.h"
#include "gpo_default.h"

namespace authdb {

@@ -139,6 +141,26 @@ namespace authdb {

                    group.create(_AdminBackend,&gdat);

                    class Gpo gpo;
                    GpoData::Allow gallow;
                    gallow.uid=new uuid_t[1];
                    uuid_copy(gallow.uid[0],admingid);
                    gallow.count=1;
                    size_t i=0;
                    while(gpo_default[i]){
                        GpoData gpodat(gpo_default[i][0]);
                        gpodat.setName(gpo_default[i][1]);
                        gpodat.setDesc(gpo_default[i][2]);
                        if(strcmp(gpo_default[i][3],"true"))
                            gpodat.setGpoValue(true);
                        else
                            gpodat.setGpoValue(false);
                        gpodat.setAllowed(gallow);
                        gpo.create(_AdminBackend,&gpodat);
                    }

                    delete[] gallow.uid;

                    libhttppp::HTTPException exp;
                    exp[999] << "wizzard finished";
                    throw exp;