Hi all,
I'm trying to get details about users in a database but I can't seem to get some of the most basic information. I started of buy attempting to get everyone's email address as seen in the code below. But I'm getting the following error:
-R-E- DXL: <Line:8> User/Group directory error: User record has been deleted. It is not possible to save your changes -I- DXL: execution halted
I've searched for the error I got but I couldn't find anything that helps me. Anyone have any idea where I'm going wrong? The code seems to work if I go with u.name instead of u.email. So I think it has something to do with the missing data if a user doesn't have an email address but how can I check for that?
pragma(runLim, 0);
User u = null();
string strEmail;
Skip skpEmails = create();
int iKey = 1;
for u in userList do {
strEmail = u.email;
put(skpEmails, iKey, strEmail "");
iKey++;
}
for strEmail in skpEmails do {
print strEmail "\n";
}
Thanks for you time. Mr 4D - Tue Apr 24 06:37:34 EDT 2018 |
Re: Getting details of users Try adding "loadUserRecord(u)" before accessing the user record details |
Re: Getting details of users Thanks for the quick response @PekkaMakinen 2c62fe98-76da-481f-be77-55155704a095. I had tried "loadUserRecord(u)" and got the same issue. I did however find the cause of the issue to be with a single user in the whole database (took me a while to figure this out). When I try to edit this user by going to [Tools -> Manage Users...] and finding that particular user and then clicking edit, I get the pop-up seen in the picture below. I have no idea why this is the case. Anyone have any idea?
|
Re: Getting details of users Mr 4D - Tue Apr 24 07:17:01 EDT 2018 Thanks for the quick response @PekkaMakinen 2c62fe98-76da-481f-be77-55155704a095. I had tried "loadUserRecord(u)" and got the same issue. I did however find the cause of the issue to be with a single user in the whole database (took me a while to figure this out). When I try to edit this user by going to [Tools -> Manage Users...] and finding that particular user and then clicking edit, I get the pop-up seen in the picture below. I have no idea why this is the case. Anyone have any idea?
Never seen that error, but I think that the reason might be some kind of corruption in the user list. Maybe you should contact IBM Support? |
Re: Getting details of users Hi, it seems to be that the user data files inside of the server data are corrupted. Did you try to edit the user if you are locked in as Administrator?
Did you try to delete the user in the "Manage Users" dialog? Maybe the following modification of your code can solve your initial problem:
pragma(runLim, 0);
User u = null();
string strEmail;
Skip skpEmails = create();
int iKey = 1;
loadDirectory() // to update the user and group list of the client by the lists of the database.
for u in userList do {
strEmail = u.email;
put(skpEmails, iKey, strEmail "");
iKey++;
}
for strEmail in skpEmails do {
print strEmail "\n";
}
|
Re: Getting details of users This is my version of: get all users with email.
// User Mail CSV File
/*
* Created by: sturm
* Creation date: 23.03.2011
*
* DXL Editor is provided by SODIUS (www.dxleditor.com)
*/
pragma encoding, "UTF-8"
User u
string usrProf = getenv("USERPROFILE")
string dbName = goodFileName getDatabaseName
string dbFile = usrProf "\\Desktop\\" dbName ".csv"
Stream csv = write(dbFile, CP_UTF8)
for u in userList do {
bool disabled = u.disabled
string uname = u.name
string email = u.email
string lmail = lower email
if (disabled) csv << "#"
//csv << uname ";" lmail ";" dbName "\n"
csv << lmail ";" uname ";" dbName "\n"
}
close csv
infoBox "Writing to '" dbFile "'\n"
|