protected void getAdmins_SelectedIndexChanged(object sender, EventArgs e) { string keydir = serverpath + "Handlers\\bf.kez"; if (File.Exists(keydir)) { StreamReader streamReader = new StreamReader(keydir, true); file_string = streamReader.ReadToEnd(); streamReader.Close(); if (file_string != null) { string bitStrengthString = file_string.Substring(0, file_string.IndexOf("</BitStrength>") + 14); file_string = file_string.Replace(bitStrengthString, ""); } } /////////////////////////////////////////////////////////////////////////////////////////////////////////////// Odyssey.Odyssey ody = new Odyssey.Odyssey(); this.ad = this.z.getAdminDetails(this.getAdmins.SelectedValue); this.edit_xname.Text = this.ad.xname; this.edit_xpass.Text = ody.DecryptString(this.ad.xpass, file_len, file_string); this.edit_xemail.Text = ody.DecryptString(this.ad.xemail, file_len, file_string); this.edit_telephone1.Text = this.ad.xtelephone1; this.edit_telephone2.Text = this.ad.xtelephone2; this.edit_xrole.SelectedIndex = Convert.ToInt16(this.ad.xroleID) - 1; this.edit_status.SelectedIndex = Convert.ToInt16(this.ad.xvisible); this.enable_EditTbl = "1"; }
protected void Page_Load(object sender, EventArgs e) { this.serverpath = base.Server.MapPath("~/"); string keydir = serverpath + "Handlers\\bf.kez"; if (File.Exists(keydir)) { StreamReader streamReader = new StreamReader(keydir, true); file_string = streamReader.ReadToEnd(); streamReader.Close(); if (file_string != null) { string bitStrengthString = file_string.Substring(0, file_string.IndexOf("</BitStrength>") + 14); file_string = file_string.Replace(bitStrengthString, ""); } } /////////////////////////////////////////////////////////////////////////////////////////////////////////////// Odyssey.Odyssey ody = new Odyssey.Odyssey(); if (this.Session["pwalletID"] != null) { if (this.Session["pwalletID"].ToString() != "") { this.admin = this.Session["pwalletID"].ToString(); } else { base.Response.Redirect("./xcontrol.aspx"); } } else { base.Response.Redirect("./xcontrol.aspx"); } if (!base.IsPostBack) { this.ad = this.z.getTopAdminDetails2(); this.edit_xname.Text = this.ad.xname; this.edit_xpass.Text = ody.DecryptString(this.ad.xpass, file_len, file_string); this.edit_xemail.Text = ody.DecryptString(this.ad.xemail, file_len, file_string); this.edit_telephone1.Text = this.ad.xtelephone1; this.edit_telephone2.Text = this.ad.xtelephone2; this.edit_xrole.SelectedIndex = Convert.ToInt16(this.ad.xroleID) - 1; this.edit_status.SelectedIndex = Convert.ToInt16(this.ad.xvisible); } }
protected void Verify_Click(object sender, EventArgs e) { this.succ = this.z.a_tm_office(this.c_mark.log_staff, this.admin_status, this.rbValid.SelectedValue, this.comment.Text, "", "", "", this.admin); if (comment.Text != "") { Classes.Email em = new Email(); // this.succ = this.z.a_tm_office(this.c_mark.log_staff, this.admin_status, this.rbValid.SelectedValue, this.comment.Text, "", "", "", this.admin); //if (this.succ != "0") //{ // base.Response.Write("<script language=JavaScript>alert('Data updated successfully')</script>"); // base.Response.Redirect("./acceptance_kiv.aspx"); //} //else //{ // base.Response.Write("<script language=JavaScript>alert('Data not verified, Please try again later')</script>"); //} zues.Adminz x_admin = z.getAdminDetails(admin); string d_email = ody.DecryptString(x_admin.xemail, file_len, file_string); string sub = "Message from " + z.getRoleNameByID(admin) + " concerning application: " + t.ValidationIDByPwalletID(c_mark.log_staff); string send_succ = em.sendMail(z.getRoleNameByID(admin).ToUpper(), c_rep_addy.email1, d_email, sub, this.comment.Text, ""); if (send_succ == "sent") { Int32 update_succ = z.e_PwalletStatus(this.c_mark.log_staff, admin_status, "kiv"); if (update_succ > 0) { base.Response.Write("<script language=JavaScript>alert('Message sent successfully')</script>"); base.Response.Redirect("./acceptance_kiv.aspx"); } else { base.Response.Write("<script language=JavaScript>alert('The form could not be updated, Please check your internet connection or try again later')</script>"); base.Response.Redirect("./acceptance_kiv.aspx"); } } else { base.Response.Write("<script language=JavaScript>alert('The E-mail could not be sent, Please check your internet connection or try again later')</script>"); base.Response.Redirect("./acceptance_kiv.aspx"); } } else { Response.Write("<script language=JavaScript>alert('Please enter a valid message to send!!')</script>"); Verify.Visible = false; Confirm.Visible = true; } }
public string a_xadminz(string uname, string xpass, string serverpath) { List<Adminz> list = new List<Adminz>(); string xmlString = "Xavier"; int dwKeySize = 0x400; string path = serverpath + @"\Handlers\bf.kez"; if (File.Exists(path)) { StreamReader reader = new StreamReader(path, true); xmlString = reader.ReadToEnd(); reader.Close(); if (xmlString != null) { string oldValue = xmlString.Substring(0, xmlString.IndexOf("</BitStrength>") + 14); xmlString = xmlString.Replace(oldValue, ""); } } Odyssey odyssey = new Odyssey(); string str4 = this.Connect(); string str5 = ""; SqlConnection connection = new SqlConnection(this.Connect()); SqlCommand command = new SqlCommand("select xID,xemail,xpass from xadminz_tm where xvisible='1' ", connection); connection.Open(); SqlDataReader reader2 = command.ExecuteReader(CommandBehavior.CloseConnection); while (reader2.Read()) { Adminz item = new Adminz { xID = reader2["xID"].ToString(), xemail = reader2["xemail"].ToString(), xpass = reader2["xpass"].ToString() }; list.Add(item); } reader2.Close(); string str6 = ""; string str7 = ""; for (int i = 0; i < list.Count; i++) { str7 = odyssey.DecryptString(list[i].xemail, dwKeySize, xmlString); str6 = odyssey.DecryptString(list[i].xpass, dwKeySize, xmlString); if ((uname == str7) && (xpass == str6)) { str5 = list[i].xID.ToString(); } } return str5; }