private void GeneralPage_Loaded(object sender, RoutedEventArgs e)
        {
            if (config.GetLanguage() == "German")
            {
                radioGerman.IsChecked = true;
            }
            else
            {
                radioEnglish.IsChecked = true;
            }

            if (config.GetShowTrayIcon() == "true")
            {
                toggleTrayIcon.IsChecked = true;
            }

            if (config.GetUpdateCheck() == "true")
            {
                toggleUpdates.IsChecked = true;
            }

            if (config.GetSyncNotify() == "true")
            {
                toggleSyncNotify.IsChecked = true;
            }

            txtLoginLink.Text = config.GetServerLoginLink();
            txtClientId.Text  = config.GetClient();
        }
Beispiel #2
0
        /// <summary>
        /// Log in to ILIAS SOAP, returns false if not successful
        /// </summary>
        /// <param name="sUser">Username</param>
        /// <param name="sPassword">Password</param>
        /// <returns></returns>
        public bool IliasLogin(string sUser, string sPassword)
        {
            if (bLoggedIn)
            {
                return(true);
            }
            else
            {
                if (sUser != "" && sPassword != "")
                {
                    config.SetUser(sUser);

                    //connect to ILIAS SOAP
                    try
                    {
                        //get session id / log in
                        sSessionId = client.loginLDAP(config.GetClient(), sUser, sPassword);
                        iUserId    = client.getUserIdBySid(sSessionId);
                        bLoggedIn  = true;
                        return(true);
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(e.Message);

                        if (e.Message == "err_wrong_login")
                        {
                            //maybe implement own message (wrong credentials) to display in message
                        }

                        bLoggedIn = false;
                        return(false);
                    }
                }
                else
                {
                    bLoggedIn = false;
                    return(false);
                }
            }
        }