示例#1
0
        public JsonResult GetLDAPContainers(string idStr, string node, bool subtree, string username, string password)
        {
            var ldapSvc = SvcBldr.LDAPV2();
            var pkg     = new LDAPGetQuery {
                ConnectionId = new Guid(idStr), Node = node, Subtree = subtree, Username = username, Password = password
            };
            var sr = ldapSvc.GetContainers(pkg);

            if (sr.Error != null)
            {
                return(Result(null, sr.Error));
            }
            var treeData = JSTreeFormat.ConvertToJSTreeFormat(sr.Result.ToList());

            return(Result(treeData, sr.Error));
        }
示例#2
0
        /// <summary>
        /// fetches all groups and users
        /// </summary>
        /// <returns></returns>
        public JsonResult GetAllRoleData()
        {
            var client = SvcBldr.SecurityV2();

            var srRoles = client.GetAllRoles();

            if (srRoles.Error != null)
            {
                return(Result(null, srRoles.Error));
            }

            var ldapClient = SvcBldr.LDAPV2();
            var srldaps    = ldapClient.GetSlim();

            if (srldaps.Error != null)
            {
                return(Result(null, srldaps.Error));
            }
            return(Result(new { r = srRoles.Result, l = srldaps.Result }, srldaps.Error, JsonRequestBehavior.AllowGet));
        }