Example #1
0
        //
        public UserArray cprsUserLookup(string sitecode, string target)
        {
            UserArray result = new UserArray();
            string msg = MdwsUtils.isAuthorizedConnection(mySession, sitecode);
            if (msg != "OK")
            {
                result.fault = new FaultTO(msg);
            }
            if (result.fault != null)
            {
                return result;
            }

            if (sitecode == null)
            {
                sitecode = mySession.ConnectionSet.BaseSiteId;
            }

            try
            {
                AbstractConnection cxn = mySession.ConnectionSet.getConnection(sitecode);
                UserApi api = new UserApi();
                User[] matches = api.providerLookup(cxn, new KeyValuePair<string,string>("NAME",target));
                result = new UserArray(matches);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            return result;
        }
Example #2
0
        // This does an administrative visit in order to get the true user's data
        internal User getVisitorData(string userSitecode, string DUZ, string appPwd)
        {
            Site site = mySession.SiteTable.getSite(userSitecode);
            AbstractCredentials credentials = getAdministrativeCredentials(site);
            credentials.AuthenticationToken = userSitecode + '_' + credentials.LocalUid;
            credentials.SecurityPhrase = appPwd;

            string context = MdwsConstants.MDWS_CONTEXT;
            if (mySession.DefaultVisitMethod == MdwsConstants.NON_BSE_CREDENTIALS)
            {
                context = MdwsConstants.CPRS_CONTEXT;
            }

            // Here we do NOT set mySession.PrimaryPermission.  This context is being set
            // solely for the Admin user to get the true user's credentials.  mySession.PrimaryPermission
            // is for the true user.
            AbstractPermission permission = new MenuOption(context);
            permission.IsPrimary = true;

            User u = doTheVisit(userSitecode, credentials, permission);

            UserApi userApi = new UserApi();
            User trueUser = userApi.getUser(myCxn, DUZ);
            myCxn.disconnect();
            return trueUser;
        }
Example #3
0
 internal TextTO isValidEsig(AbstractConnection cxn, string esig)
 {
     TextTO result = new TextTO();
     if (esig == "")
     {
         result.fault = new FaultTO("Missing esig");
     }
     if (result.fault != null)
     {
         return result;
     }
     try
     {
         UserApi api = new UserApi();
         bool f = api.isValidEsig(cxn, esig);
         result = new TextTO((f ? "TRUE" : "FALSE"));
     }
     catch (Exception e)
     {
         result.fault = new FaultTO(e.Message);
     }
     return result;
 }
Example #4
0
 internal UserTO getUser(AbstractConnection cxn, string DUZ)
 {
     UserTO result = new UserTO();
     if (DUZ == "")
     {
         result.fault = new FaultTO("Missing DUZ");
     }
     if (result.fault != null)
     {
         return result;
     }
     try
     {
         UserApi api = new UserApi();
         User u = api.getUser(cxn, DUZ);
         result = new UserTO(u);
     }
     catch (Exception e)
     {
         result.fault = new FaultTO(e.Message);
     }
     return result;
 }
Example #5
0
        public UserTO userLookup(string duz)
        {
            UserTO result = new UserTO();
            string msg = MdwsUtils.isAuthorizedConnection(mySession);

            if (String.IsNullOrEmpty(duz))
            {
                result.fault = new FaultTO("Missing DUZ param");
            }
            else if (msg != "OK")
            {
                result.fault = new FaultTO(msg);
            }
            if (result.fault != null)
            {
                return result;
            }
            try
            {
                AbstractConnection cxn = mySession.ConnectionSet.BaseConnection;
                UserApi api = new UserApi();
                User[] user = api.userLookup(cxn, new System.Collections.Generic.KeyValuePair<string, string>("DUZ", duz));
                result = new UserTO(user[0]);
            }
            catch (Exception exc)
            {
                result.fault = new FaultTO(exc);
            }
            return result;
        }
Example #6
0
        // DON'T SEE A USERLOOKUPBYNAME FUNCTION ON USERAPI
        public TaggedUserArrays lookupMS(string target, string maxRex)
        {
            TaggedUserArrays result = new TaggedUserArrays();
            string msg = MdwsUtils.isAuthorizedConnection(mySession);
            if (msg != "OK")
            {
                result.fault = new FaultTO(msg);
            }
            else if (target == "")
            {
                result.fault = new FaultTO("Missing target");
            }
            //else if (!StringUtils.isNumeric(maxRex))
            //{
            //    result.fault = new FaultTO("Non-numeric maxRex");
            //}
            if (result.fault != null)
            {
                return result;
            }

            try
            {
                KeyValuePair<string, string> kvp = new KeyValuePair<string, string>("NAME",target);
                UserApi api = new UserApi();
                IndexedHashtable t = api.userLookup(mySession.ConnectionSet, kvp, maxRex);
                result = new TaggedUserArrays(t);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            return result;
        }
Example #7
0
        public UserArray lookup(string sitecode, string target, string maxRex)
        {
            UserArray result = new UserArray();
            string msg = MdwsUtils.isAuthorizedConnection(mySession, sitecode);
            if (msg != "OK")
            {
                result.fault = new FaultTO(msg);
            }
            else if (target == "")
            {
                result.fault = new FaultTO("Missing target");
            }
            else if (!StringUtils.isNumeric(maxRex))
            {
                result.fault = new FaultTO("Non-numeric maxRex");
            }
            if (result.fault != null)
            {
                return result;
            }

            if (String.IsNullOrEmpty(sitecode))
            {
                sitecode = mySession.ConnectionSet.BaseSiteId;
            }

            try
            {
                AbstractConnection cxn = mySession.ConnectionSet.Connections[sitecode];
                UserApi api = new UserApi();
                User[] matches = api.userLookup(cxn, new KeyValuePair<string,string>("NAME", target)); //.userLookupByName(cxn, target, maxRex);
                result = new UserArray(matches);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            return result;
        }
Example #8
0
 public TaggedTextArray getUserIdBySSN(string SSN)
 {
     TaggedTextArray result = new TaggedTextArray();
     if (SSN == "")
     {
         result.fault = new FaultTO("Missing SSN");
     }
     if (result.fault != null)
     {
         return result;
     }
     try
     {
         UserApi api = new UserApi();
         IndexedHashtable t = api.getUserId(mySession.ConnectionSet, new System.Collections.Generic.KeyValuePair<string, string>("SSN", SSN));
         result = new TaggedTextArray(t);
     }
     catch (Exception e)
     {
         result.fault = new FaultTO(e.Message);
     }
     return result;
 }