Exemplo n.º 1
0
        /// <summary>
        /// Display the Login Dialog, and get the permissions of the user that just has logged in
        /// </summary>
        /// <returns>void</returns>
        public static void PerformLogin()
        {
            try
            {
                TLoginForm AConnectDialog;

                // TODO: close current connection if it is open
                FLoginSuccessful = false;

                // Need to show and hide Connect Dialog before closing the Splash Screen so that it can receive input focus!
                AConnectDialog = new TLoginForm();

                // this causes a bug on Mono. see bug #590. inactive login screen
                // and it is not needed because the splashscreen is disabled for the moment anyway
                // AConnectDialog.Show();
                // AConnectDialog.Visible = false;

                // Close Splash Screen
                FSplashScreen.Close();
                FSplashScreen = null;

                // Show the Connect Dialog
                if (AConnectDialog.ShowDialog() == System.Windows.Forms.DialogResult.Cancel)
                {
                    FLoginSuccessful = false;
                }
                else
                {
                    // TODO reset any caches
                    // TODO AConnectDialog.GetReturnedParameters(out FProcessID, out FWelcomeMessage, out FSystemEnabled);

                    // get Connection Dialog out of memory
                    AConnectDialog.Dispose();

                    FLoginSuccessful = true;

                    Ict.Petra.Client.MSysMan.Gui.TUC_GeneralPreferences.InitLanguageAndCulture();
                }
            }
            catch (Exception exp)
            {
                if (FSplashScreen == null)
                {
                    MessageBox.Show("Exception caught in Method PerformLogin: "******"Exception caught in Method PerformLogin: " + exp.ToString());
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// change the password of the current user
        /// </summary>
        public static void SetUserPassword(Form AParentForm)
        {
            string username = Ict.Petra.Shared.UserInfo.GUserInfo.UserID;

            // TODO: use old password as well, to make sure the password is changed by its owner
            PetraInputBox input = new PetraInputBox(
                Catalog.GetString("Change your password"),
                Catalog.GetString("Please enter the old password:"******"", true);

            if (input.ShowDialog() == DialogResult.OK)
            {
                TLoginForm.CreateNewPassword(username, input.GetAnswer(), false);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// change the password of the current user
        /// </summary>
        public static void SetUserPassword(Form AParentForm)
        {
            string username = Ict.Petra.Shared.UserInfo.GUserInfo.UserID;

            TLoginForm.CreateNewPassword(AParentForm, username, string.Empty, false);
        }