protected void BtnChangePassClick(object sender, EventArgs e) { var smp = new SnitzMembershipProvider(); bool result = smp.ChangePassword(_profileUser, tbxPassword.Text, tbxNewPass.Text); if(result) { var req = new RequiredFieldValidator { ValidationGroup = "passChange", ErrorMessage = "Password changed successfully", IsValid = false }; Page.Form.Controls.Add(req); req.Visible = false; } else { var req = new RequiredFieldValidator { ValidationGroup = "passChange", ErrorMessage = "Failed to change password", IsValid = false }; Page.Form.Controls.Add(req); req.Visible = false; } }
protected void delSel_Click(object sender, EventArgs e) { StringBuilder str = new StringBuilder(); for (int i = 0; i < GridViewMemberUser.Rows.Count; i++) { GridViewRow row = GridViewMemberUser.Rows[i]; CheckBox select = (CheckBox) row.FindControl("chkSelect"); if (select.Checked) { str.Append(select.ToolTip + ","); } } SnitzProfileProvider pro = (SnitzProfileProvider)ProfileManager.Providers["TableProfileProvider"]; string usernameList = str.ToString().TrimEnd(','); if (pro != null) pro.DeleteProfiles(usernameList.Split(',')); foreach (string user in usernameList.Split(',')) { var mp = new SnitzMembershipProvider(); mp.DeleteUser(user, true); //Membership.DeleteUser(user,true); } GridViewMemberUser.DataBind(); }
private void PopulateData() { int activemembers = new SnitzMembershipProvider().GetNumberOfUsersOnline(); int totalsessions = Convert.ToInt32(Application["SessionCount"]); int dailySessions = Convert.ToInt32(Application["DailyCount"]); var dSession = String.Format("{0} visitor(s) today", dailySessions); int anonusers = totalsessions - activemembers; GetCounts(); string newmemberlink = String.Format(PROFILE_URL, _stats.NewestMember,String.Format(webResources.lblViewProfile, _stats.NewestMember)); lblNewestMember.Text = string.Format(webResources.lblMiniStatsNewMember, newmemberlink); lblMemberStats.Text = string.Format(webResources.lblMiniStatsMembers, Common.TranslateNumerals(_memberCount), Common.TranslateNumerals(_totalPostCount), GetLastPost(), GetLastPostAuthor()); lblTopicStats.Text = string.Format(webResources.lblMiniStatsTopics, Common.TranslateNumerals(_stats.ActiveTopicCount)); lblActiveSessions.Text = extras.GuestLabel + Common.TranslateNumerals(anonusers); string[] onlineusers = new SnitzMembershipProvider().GetOnlineUsers(); var remains = onlineusers.Except(Config.AnonMembers); lblActiveUsers.Text = string.Format(webResources.lblStatsMembersOnline, String.Join(",", remains.ToArray())) + "<br/>" + dSession; }
private void PopulateData() { int activemembers = new SnitzMembershipProvider().GetNumberOfUsersOnline(); int totalsessions = Convert.ToInt32(Application["SessionCount"]); int dailySessions = Convert.ToInt32(Application["DailyCount"]); var dSession = String.Format("{0} visitor(s) today", dailySessions); int anonusers = totalsessions - activemembers; GetCounts(); if (!string.IsNullOrEmpty(HttpContext.Current.User.Identity.Name)) { lblLastVisit.Text = webResources.lblStatsLastVisit; lblLastVisit.Text += SnitzTime.TimeAgoTag(_page.LastVisitDateTime, true,_page.Member); } else { lblLastVisit.Visible = false; } string newmemberlink = String.Format(PROFILE_URL, _stats.NewestMember,String.Format(webResources.lblViewProfile, _stats.NewestMember)); lblNewestMember.Text = string.Format(webResources.lblStatsNewMember, newmemberlink); lblMemberStats.Text = string.Format(webResources.lblStatsMembers, _activeMembers, Common.TranslateNumerals(_memberCount), Common.TranslateNumerals(_totalPostCount), GetLastPost(), GetLastPostAuthor()); lblTopicStats.Text = string.Format(webResources.lblStatsTopics, Common.TranslateNumerals(_topicCount), _stats.ActiveTopicCount); lblArchiveStats.Text = string.Format(webResources.lblStatsArchive, Common.TranslateNumerals(_archiveTopicCount + _archiveReplyCount), Common.TranslateNumerals(_archiveTopicCount)); lblActiveSessions.Text = extras.GuestLabel + anonusers; string[] onlineusers = new SnitzMembershipProvider().GetOnlineUsers(); var remains = onlineusers.Except(Config.AnonMembers); lblActiveUsers.Text = string.Format(webResources.lblStatsMembersOnline, String.Join(",", remains.ToArray())) + "<br/>" + dSession; }