fixed typo and added instance creation to modpol.lua
This commit is contained in:
parent
bc3aba4ff0
commit
4ccdb443e2
@ -77,9 +77,10 @@ dofile (topdir .. "/api.lua")
|
|||||||
-- Final checks
|
-- Final checks
|
||||||
|
|
||||||
-- create instance if not present
|
-- create instance if not present
|
||||||
-- if not modpol.get_org_id_by_name('instance') then
|
if not modpol.orgs.get_org('instance') then
|
||||||
-- modpol.add_org("instance", modpol.list_users())
|
modpol.orgs.init_instance()
|
||||||
-- end
|
modpol.instance = modpol.orgs.get_org('instance')
|
||||||
|
end
|
||||||
|
|
||||||
modpol.ocutil.log ("modpol loaded")
|
modpol.ocutil.log ("modpol loaded")
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ function modpol.orgs.get_org(id)
|
|||||||
end
|
end
|
||||||
elseif type(id) == 'number' then
|
elseif type(id) == 'number' then
|
||||||
return modpol.orgs.array[id]
|
return modpol.orgs.array[id]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- ===============================================
|
-- ===============================================
|
||||||
@ -39,9 +40,9 @@ end
|
|||||||
-- ===========================================
|
-- ===========================================
|
||||||
-- deletes all orgs except for the instance
|
-- deletes all orgs except for the instance
|
||||||
function modpol.orgs.reset()
|
function modpol.orgs.reset()
|
||||||
for k, v in ipairs(modpol.orgs.array) do
|
for id, org in ipairs(modpol.orgs.array) do
|
||||||
if k > 1 then
|
if id > 1 then
|
||||||
modpol.orgs.array[k] = nil
|
modpol.orgs.array[id] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user