Exemple #1
0
        IList <WcfUser> IWcfService.GetUsers(string id, int startIndex, int count, out int overallCount)
        {
            WcfUser[] result = null;

            var users = GetUsers(id);

            var items   = users.GetUsers(accounts.DefaultAccountId, startIndex, count);
            var account = accounts.GetDefaultAccount();

            if (items != null && account != null)
            {
                result = new WcfUser[items.Count];

                for (int i = 0; i < result.Length; i++)
                {
                    result[i] = new WcfUser(items[i])
                    {
                        Availability = enhancedPresence.GetAvailability(@"sip:" + items[i].Name + @"@" + account.DomainName),
                    }
                }
                ;
            }

            overallCount = users.GetCount(accounts.DefaultAccountId);

            return(result);
        }
Exemple #2
0
        void IWcfService.UpdateUser(string usersId, WcfUser user)
        {
            var users = GetUsers(usersId);

            if (users.IsReadOnly == false)
            {
                var oldUser = users.GetByName(accounts.DefaultAccountId, user.Name);

                users.Update(accounts.DefaultAccountId, user.ToIUser((oldUser == null) ? string.Empty : oldUser.Password));
            }
        }
Exemple #3
0
 private void OnUserAddedOrUpdated(string usersId, WcfUser wcfUser)
 {
     if (callback != null)
     {
         try
         {
             callback.UserAddedOrUpdated(usersId, wcfUser);
         }
         catch
         {
             callback = null;
         }
     }
 }
Exemple #4
0
 void IWcfService.AddUser(string usersId, WcfUser user, string password)
 {
     try
     {
         var users = GetUsers(usersId);
         if (users.IsReadOnly == false)
         {
             users.Add(accounts.DefaultAccountId, user.ToIUser(password));
         }
     }
     catch (UsersException)
     {
     }
 }
Exemple #5
0
 private void OnUserAddedOrUpdated(string usersId, WcfUser wcfUser)
 {
     if (callback != null)
     {
         try
         {
             callback.UserAddedOrUpdated(usersId, wcfUser);
         }
         catch
         {
             callback = null;
         }
     }
 }
Exemple #6
0
        IList<WcfUser> IWcfService.GetUsers(string id, int startIndex, int count, out int overallCount)
        {
            WcfUser[] result = null;

            var users = GetUsers(id);

            var items = users.GetUsers(accounts.DefaultAccountId, startIndex, count);
            var account = accounts.GetDefaultAccount();
            if (items != null && account != null)
            {
                result = new WcfUser[items.Count];

                for (int i = 0; i < result.Length; i++)
                    result[i] = new WcfUser(items[i])
                    {
                        Availability = enhancedPresence.GetAvailability(@"sip:" + items[i].Name + @"@" + account.DomainName),
                    };
            }

            overallCount = users.GetCount(accounts.DefaultAccountId);

            return result;
        }
Exemple #7
0
        void IWcfService.UpdateUser(string usersId, WcfUser user)
        {
            var users = GetUsers(usersId);

            if (users.IsReadOnly == false)
            {
                var oldUser = users.GetByName(accounts.DefaultAccountId, user.Name);

                users.Update(accounts.DefaultAccountId, user.ToIUser((oldUser == null) ? string.Empty : oldUser.Password));
            }
        }
Exemple #8
0
 void IWcfService.AddUser(string usersId, WcfUser user, string password)
 {
     try
     {
         var users = GetUsers(usersId);
         if (users.IsReadOnly == false)
             users.Add(accounts.DefaultAccountId, user.ToIUser(password));
     }
     catch (UsersException)
     {
     }
 }