public static void Evaluate(State.Linked.LinkedAccount account)
        {
            var action = new ModifyDirectoryData();

            if (account.Directory.Account.CN != account.Directory.Account.DesiredCN())
            {
                action.List.Add(Fields.CommonName);
            }

            if (action.List.Count > 0)
            {
                account.Directory.FlagWarning();
                account.Actions.Add(action);
                account.OK = false;
            }
        }
Esempio n. 2
0
        public static void AddActions(State.Linked.LinkedAccount account)
        {
            if (account is null)
            {
                return;
            }

            account.OK = true;
            account.SetBasicFlags();

            if (!account.Wisa.Exists || !account.Directory.Exists || !account.Smartschool.Exists)
            {
                RemoveFromGoogle.Evaluate(account);
                RemoveFromDirectory.Evaluate(account);
                UnregisterSmartschool.Evaluate(account);
                DeleteFromSmartschool.Evaluate(account);
                AddToDirectoryAndSmartschool.Evaluate(account);
                AddToDirectory.Evaluate(account);
                RemoveFromDirectoryAndSmartschool.Evaluate(account);
                account.OK = false;
            }
            else
            {
                ModifySmartschoolStudentAddress.Evaluate(account);
                AddToADStudentGroup.Evaluate(account);
                //ModifyStudentHomeDir.Evaluate(account);
                ModifyAccountID.Evaluate(account);
                ModifySmartschoolStemID.Evaluate(account);
                ModifySmartschoolBirthPlace.Evaluate(account);
                //CreateHomeDir.Evaluate(account);
                MoveDirectoryClassGroup.Evaluate(account);
                MoveToSmartschoolClassGroup.Evaluate(account);
                ModifyDirectoryData.Evaluate(account);
                PrincipalNameMustEqualMail.Evaluate(account);
                AddToADClassGroup.Evaluate(account);
                ModifySmartschoolStudentEmail.Evaluate(account);
            }
        }