Hi,
You can check if some document created by user exists or not. You could add this functionality into file
~/CMSSiteManager/Administration/Users/User_List.aspx.cs and modify method
protected void gridElem_OnAction(string actionName, object actionArgument). In
else if (actionName == "delete") part you could add following code:
// It is not possible to delete user whose documents exists in CMS.Document table
DataSet ds = null;
// Tree provider
UserInfo ui = UserInfoProvider.GetUserInfo("administrator");
CMS.TreeEngine.TreeProvider tree = new CMS.TreeEngine.TreeProvider(ui);
tree.MergeResults = true;
ds = CMS.WorkflowEngine.DocumentHelper.GetDocuments(TreeProvider.ALL_SITES, TreeProvider.ALL_DOCUMENTS, TreeProvider.ALL_CULTURES, false, "", "DocumentCreatedByUserID="+ delUser.UserID, "", TreeProvider.ALL_LEVELS, false, tree);
if (ds.Tables[0].Rows.Count > 0)
{
lblError.Visible = true;
lblError.Text = "ds is not null";
return;
}
With above modification you cannot delete user in Site Manager - Administration - Users in case some document created by appropriate user exists.
Best regards,
Ivana Tomanickova