public int verify(string input)
        {
            string sysadmin = "sysadmin;109859928";
            string user     = "******";

            string[] users = SettingsWindow.ReadFromManagerAb(managerAbPath, "users");
            if (username.Equals("user") && input.Equals("user"))
            {
                foreach (string s in users)
                {
                    if (s.Equals(user))
                    {
                        return(1);
                    }
                }
            }
            else if (username.Equals("sysadmin") && input.Equals("sysadmin"))
            {
                foreach (string s in users)
                {
                    if (s.Equals(sysadmin))
                    {
                        return(1);
                    }
                }
            }
            if (username.Equals("user") && !input.Equals("user"))
            {
                return(-1);
            }
            if (username.Equals("sysadmin") && !input.Equals("sysadmin"))
            {
                return(-1);
            }
            return(0);
        }
Exemple #2
0
 /// <summary>
 /// Open settings dialog.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ButtonSettings_Click(object sender, RoutedEventArgs e)
 {
     SettingsWindow.Show();
     SettingsWindow.Activate();
 }