I got a problem using the .net Membership Provider.
I'm developing a user control to give a friendly ui (in the website, not in backend) to manage users.
When I list the website members, the LastLogin and the LastLookout, LastActivity and LastPasswordChange date fields are always set to DateTime.Now() for all the users (even users that never logged in).
Here's the page code
foreach (MembershipUser m in Membership.GetAllUsers()) { DefaultMemberProfile mp = (DefaultMemberProfile)ProfileBase.Create(m.UserName);
I'm not sure about all variables you mention, but may need to check on the membership configuration in web.config. An overview of all (extra) attributes on the umbraco membership provider can be found in the wiki.
Membership issue
Hello,
I got a problem using the .net Membership Provider.
I'm developing a user control to give a friendly ui (in the website, not in backend) to manage users.
When I list the website members, the LastLogin and the LastLookout, LastActivity and LastPasswordChange date fields are always set to DateTime.Now() for all the users (even users that never logged in).
Here's the page code
foreach (MembershipUser m in Membership.GetAllUsers())
{
DefaultMemberProfile mp = (DefaultMemberProfile)ProfileBase.Create(m.UserName);
tr = new TableRow();
tc = new TableCell();
tc.Text = "<input type=\"radio\" id=\"" + m.ProviderUserKey.ToString() + "\" name=\"users\" value=\"" + m.ProviderUserKey.ToString() + "\">";
tr.Cells.Add(tc);
tc = new TableCell();
tc.Text = m.UserName;
tr.Cells.Add(tc);
tc = new TableCell();
tc.Text = m.Email;
tr.Cells.Add(tc);
tc = new TableCell();
tc.Text = mp.FirstName + " " + mp.LastName;
tr.Cells.Add(tc);
tc = new TableCell();
tc.Text = m.LastLoginDate.ToString("dd/MM/yyyy - hh:mm:ss") + "////" + m.CreationDate.ToString("dd/MM/yyyy - hh:mm");
tr.Cells.Add(tc);
tc = new TableCell();
tc.Text = (m.IsApproved ? "Si" : "No");
tr.Cells.Add(tc);
tc = new TableCell();
string[] roles = Roles.GetRolesForUser(m.UserName);
for (int i = 0; i < roles.Length; i++)
tc.Text += roles[i] + " ";
tr.Cells.Add(tc);
t.Rows.Add(tr);
}
Any idea?
thanks in advance
Hi Alex,
Quite a shot in the dark here, but have you tried to DateTime.Parse() your date values? :-)
- Bo
I'm not sure about all variables you mention, but may need to check on the membership configuration in web.config. An overview of all (extra) attributes on the umbraco membership provider can be found in the wiki.
Cheers,
/Dirk
is working on a reply...