1 // Mainsoft.Web.Administration - Site administration utility
\r
2 // (C) 2006 Mainsoft Corporation (http://www.mainsoft.com)
\r
3 // Permission is hereby granted, free of charge, to any person obtaining
\r
4 // a copy of this software and associated documentation files (the
\r
5 // "Software"), to deal in the Software without restriction, including
\r
6 // without limitation the rights to use, copy, modify, merge, publish,
\r
7 // distribute, sublicense, and/or sell copies of the Software, and to
\r
8 // permit persons to whom the Software is furnished to do so, subject to
\r
9 // the following conditions:
\r
11 // The above copyright notice and this permission notice shall be
\r
12 // included in all copies or substantial portions of the Software.
\r
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
15 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
17 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
\r
18 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
\r
19 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
\r
20 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
24 using System.Configuration;
\r
25 using System.Collections;
\r
27 using System.Web.Security;
\r
28 using System.Web.UI;
\r
29 using System.Web.UI.WebControls;
\r
30 using System.Web.UI.HtmlControls;
\r
32 namespace Mainsoft.Web.Administration
\r
34 public partial class EditUser : System.Web.UI.Page
\r
37 protected void Page_Load (object sender, EventArgs e)
\r
39 user_name = Request.QueryString["User"];
\r
40 srch.User = user_name;
\r
42 FillUserData (user_name);
\r
43 name_lbl.Text = user_name;
\r
46 Button bt = Master.FindControl ("Back") as Button;
\r
48 bt.PostBackUrl = "ManageUser.aspx";
\r
52 protected override void OnPreRender (EventArgs e)
\r
55 if (MultiView1.ActiveViewIndex == 1) {
\r
56 ((Button) Master.FindControl ("Back")).Visible = false;
\r
59 ((Button) Master.FindControl ("Back")).Visible = true;
\r
62 base.OnPreRender (e);
\r
65 void FillUserData (string user_name)
\r
67 MembershipUser user = Membership.GetUser (user_name);
\r
68 userid_txb.Text = user.UserName;
\r
69 email_txb.Text = user.Email;
\r
70 active_chb.Checked = user.IsApproved;
\r
71 desc_txb.Text = user.Comment;
\r
74 protected void roles_lst_DataBound (object sender, EventArgs e)
\r
76 foreach (ListItem item in ((CheckBoxList) sender).Items) {
\r
77 item.Selected = Boolean.Parse (item.Value);
\r
81 protected void save_bt_Click (object sender, EventArgs e)
\r
83 MembershipUser user = Membership.GetUser (user_name);
\r
84 user.IsApproved = active_chb.Checked;
\r
85 user.Email = email_txb.Text;
\r
86 user.Comment = desc_txb.Text;
\r
87 Membership.UpdateUser (user);
\r
88 MultiView1.ActiveViewIndex = 1;
\r
91 protected void success_btn_Click (object sender, EventArgs e)
\r
93 Server.Transfer ("ManageUser.aspx");
\r