Example #1
0
        /// <summary>
        /// 获取指定Novell帐号的用户组
        /// </summary>
        /// <param name="CurrentAccount">Novell帐号</param>
        /// <returns></returns>
        public static string[] NovellGetGroupByAccount(string CurrentAccount)
        {
            StringBuilder sb     = new StringBuilder(CHAR_LENGTH);
            int           count  = LDAP_DLL_DelphiComplied.NovellGetGroupByAccount(CurrentAccount, sb, sb.Capacity);
            string        groups = sb.ToString();

            string[] groupList = groups.Split(new string[] { System.Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
            return(groupList);
        }
Example #2
0
 /// <summary>
 /// 获取当前登录的Novell用户
 /// </summary>
 /// <returns></returns>
 public static string NovellWhoAmI()
 {
     try
     {
         return(LDAP_DLL_DelphiComplied.NovellWhoAmI());
     }
     catch
     {
         return(string.Empty);
     }
 }
Example #3
0
 /// <summary>
 /// 获取组织单元内所有用户
 /// </summary>
 /// <param name="Country">组织单元(.com .cn 等等)</param>
 /// <param name="ReturnPath">是否包含完整路径</param>
 /// <returns></returns>
 public static DataTable NovellGetAllUsers(string Country, bool ReturnPath)
 {
     try
     {
         StringBuilder sb    = new StringBuilder(CHAR_LENGTH);
         int           count = LDAP_DLL_DelphiComplied.NovellGetAllUsers(Country, ReturnPath ? 1 : 0, sb, CHAR_LENGTH);
         return(GetStringTable(sb.ToString(), LINE_SEPERATOR_1, COLUMN_SEPERATOR, ReturnPath == false));
     }
     catch
     {
         return(GetStringTable(" \t ", LINE_SEPERATOR_1, COLUMN_SEPERATOR, true));
     }
 }
Example #4
0
 /// <summary>
 /// 获取Novell网对象
 /// </summary>
 /// <param name="NovellPath">有效路径.如: .edp.LZHBaseFrame.mo 或 .LZHBaseFrame.mo</param>
 /// <param name="ClassName">取对象类型: Organizational Unit,Group,User </param>
 /// <returns></returns>
 public static DataTable NovellGetObjects(string NovellPath, string ClassName, bool only3)
 {
     try
     {
         StringBuilder sb    = new StringBuilder(CHAR_LENGTH);
         int           count = LDAP_DLL_DelphiComplied.NovellGetObjects(NovellPath, ClassName, sb, CHAR_LENGTH, only3 ? 1 : 0);
         return(GetStringTable(sb.ToString(), LINE_SEPERATOR, COLUMN_SEPERATOR, false));
     }
     catch
     {
         return(GetStringTable(" \t ", LINE_SEPERATOR, COLUMN_SEPERATOR, false));
     }
 }
Example #5
0
        /// <summary>
        /// 是否安装Novell客户端
        /// </summary>
        /// <returns></returns>
        public static bool NovellHasClient()
        {
            string result = LDAP_DLL_DelphiComplied.NovellHasClient();

            return(result.ToLower() == "yes");
        }
Example #6
0
        /// <summary>
        /// 当前登录的用户是否属于指定的组
        /// </summary>
        /// <param name="GroupName">指定的组</param>
        /// <returns></returns>
        public static bool NovellIsMembership(string GroupName, ref string CurrentAccount)
        {
            string result = LDAP_DLL_DelphiComplied.NovellIsMembership(GroupName, ref CurrentAccount);

            return(result.ToLower() == "yes");
        }