Beispiel #1
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            if (SQLHelper.Initialize() == false)
            {
                MessageBox.Show("Fehler beim öffnen der MySQL Verbindung!\nDies kann verschiedene Ursachen haben.\nSollte das Problem längerfristig bestehen, kontaktiere GodLesZ.", "SQL Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
                return;
            }

            frmLogin frm = new frmLogin(SQLHelper.Mysql);

            frm.ShowDialog();
            if (frm.HasAccess == false)
            {
                this.Close();
                return;
            }

            mUsername = HelperCrypt.Decrypt(Properties.Settings.Default.Username).MysqlEscape();
            LoadIcons();
            LoadTemplates();
            SetAllSockel(false);
            cmbType.SelectedIndex = 0;

            foreach (string q in QualityComboBox.Qualitys)
            {
                cmbQuality.Items.Add(q);
            }
            cmbQuality.SelectedIndex = 1;
            cmbQuality.SelectedIndex = 0;
            cmbASPD.SelectedIndex    = 3;

            cmbFraction.SelectedIndex = 0;
            cmbItemIcon.SelectedIndex = 0;
        }
Beispiel #2
0
        public frmLogin()
        {
            InitializeComponent();

            if (Properties.Settings.Default.ForumUsername != string.Empty)
            {
                txtUsername.Text = HelperCrypt.Decrypt(Properties.Settings.Default.ForumUsername);
                txtPassword.Text = HelperCrypt.Decrypt(Properties.Settings.Default.ForumPassword);
            }
        }
Beispiel #3
0
        private string GetForumPass(string Username, string Password)
        {
            ResultTable table = MySql.Query("SELECT salt FROM wcf1_user WHERE username = '******'", ForumUsername.MysqlEscape());

            if (table.Rows.Count == 0)
            {
                return(Password);
            }

            string salt       = table.Rows[0]["salt"].ToString();
            string saltedHash = HelperCrypt.SHA1(salt + HelperCrypt.SHA1(Password));

            return(HelperCrypt.SHA1(salt + saltedHash));
        }
Beispiel #4
0
 private void frmLogin_FormClosing(object sender, FormClosingEventArgs e)
 {
     Properties.Settings.Default.ForumUsername = HelperCrypt.Encrypt(txtUsername.Text);
     Properties.Settings.Default.ForumPassword = HelperCrypt.Encrypt(txtPassword.Text);
     Properties.Settings.Default.Save();
 }