Esempio n. 1
0
 internal static void SingleScalarFromDirectoryEntry <T>(dSPropertyCollection properties, string suggestedProperty, Principal p, string propertyName)
 {
     if (properties[suggestedProperty].Count != 0 && properties[suggestedProperty][0] != null)
     {
         p.LoadValueIntoProperty(propertyName, (T)properties[suggestedProperty][0]);
     }
 }
Esempio n. 2
0
        //
        // S.DS (LDAP or WinNT) --> PAPI conversion routines
        //
        static internal void SingleScalarFromDirectoryEntry <T>(dSPropertyCollection properties, string suggestedProperty, Principal p, string propertyName)
        {
            if (properties[suggestedProperty].Count != 0 && properties[suggestedProperty][0] != null)
            {
                // We're intended to handle single-valued scalar properties
                Debug.Assert(properties[suggestedProperty].Count == 1);
                Debug.Assert(properties[suggestedProperty][0] is T);

                p.LoadValueIntoProperty(propertyName, (T)properties[suggestedProperty][0]);
            }
        }
Esempio n. 3
0
        internal static void MultiScalarFromDirectoryEntry <T>(dSPropertyCollection properties, string suggestedProperty, Principal p, string propertyName)
        {
            dSPropertyValueCollection item = properties[suggestedProperty];
            List <T> ts = new List <T>();

            foreach (object obj in item)
            {
                ts.Add((T)obj);
            }
            p.LoadValueIntoProperty(propertyName, ts);
        }
Esempio n. 4
0
        internal static void AccountControlFromDirectoryEntry(dSPropertyCollection properties, string suggestedProperty, Principal p, string propertyName, bool testCantChangePassword)
        {
            dSPropertyValueCollection item = properties[suggestedProperty];

            if (item.Count != 0)
            {
                int  num  = (int)item[0];
                bool flag = SDSUtils.StatusFromAccountControl(num, propertyName);
                p.LoadValueIntoProperty(propertyName, flag);
            }
        }
Esempio n. 5
0
        static internal void MultiScalarFromDirectoryEntry <T>(dSPropertyCollection properties, string suggestedProperty, Principal p, string propertyName)
        {
            dSPropertyValueCollection values = properties[suggestedProperty];

            List <T> list = new List <T>();

            foreach (object value in values)
            {
                Debug.Assert(value is T);

                list.Add((T)value);
            }

            p.LoadValueIntoProperty(propertyName, list);
        }
Esempio n. 6
0
        static internal void AccountControlFromDirectoryEntry(dSPropertyCollection properties, string suggestedProperty, Principal p, string propertyName, bool testCantChangePassword)
        {
            Debug.Assert(
                (!testCantChangePassword && (String.Equals(suggestedProperty, "userAccountControl", StringComparison.OrdinalIgnoreCase))) ||
                (testCantChangePassword && (String.Equals(suggestedProperty, "UserFlags", StringComparison.OrdinalIgnoreCase)))
                );

            Debug.Assert(!String.Equals(propertyName, PropertyNames.PwdInfoCannotChangePassword, StringComparison.OrdinalIgnoreCase) || testCantChangePassword);

            dSPropertyValueCollection values = properties[suggestedProperty];

            if (values.Count != 0)
            {
                Debug.Assert(values.Count == 1);
                Debug.Assert(values[0] is int);

                int  uacValue = (int)values[0];
                bool flag;

                flag = StatusFromAccountControl(uacValue, propertyName);

                p.LoadValueIntoProperty(propertyName, flag);
            }
        }