-- Author: Luke
-- Date: 2010-06-08
Code: Select all
local oldDomain = "domainA"
local newDomain = "domainB"
local records,pages = c_GetUserPageCount(oldDomain)
if pages == 0 then pages = 1 end
for i=1,pages do
local userlist = Split(c_GetUserListPage(oldDomain, i), "\n")
for _,username in pairs(userlist) do
local dbuserIndex = string.find(username, "|")
if dbuserIndex then
username = string.sub(username, 1, dbuserIndex-1)
end
local myuser = c_GetUser(oldDomain, username)
if myuser ~= nil then
myuser.oldpassword = myuser.password
for k,v in pairs(myuser) do
if type(v) == "boolean" then
if v == true then
myuser[k] = 1
else
myuser[k] = 0
end
end
end
AddUser(newDomain, myuser)
end
end
end