示例#1
0
 /// <summary>
 /// Refreshes the current user with data from the security provider.
 /// </summary>
 /// <param name="source">A source <see cref="CPUser"/> object to refresh the current user with.</param>
 public void Refresh(CPUser source = null)
 {
     if ((source = source ?? CPSecurity.Provider.GetUser(_username)) == null)
     {
         return;
     }
     this.Cid                     = source.Cid;
     this.CreationDate            = source.CreationDate;
     this.DisplayName             = source.DisplayName;
     this.Email                   = source.Email;
     this.Enabled                 = source.Enabled;
     this.LastActivityDate        = source.LastActivityDate;
     this.LastLockoutDate         = source.LastLockoutDate;
     this.LastLoginDate           = source.LastLoginDate;
     this.LastPasswordChangedDate = source.LastPasswordChangedDate;
     this.LockedOut               = source.LockedOut;
     this.PasswordExpired         = source.PasswordExpired;
     this.SourceCommitteeID       = source.SourceCommitteeID;
     this.SourceElectionCycle     = source.SourceElectionCycle;
     this.SourceLiaisonID         = source.SourceLiaisonID;
     this.SourceType              = source.SourceType;
     this.UserRights              = source.UserRights;
     this.ImplicitElectionCycles  = source.ImplicitElectionCycles;
     _applications.Clear();
     _applications.AddRange(source._applications);
     _electionCycles.Clear();
     _electionCycles.AddRange(source._electionCycles);
 }
示例#2
0
 /// <summary>
 /// Creates a new <see cref="UpdateResult"/> structure that contains the specified results of a user update operation.
 /// </summary>
 /// <param name="user">The updated user.</param>
 /// <param name="state">The result state of the update.</param>
 public UpdateResult(CPUser user, UpdateResultState state)
 {
     _user  = user;
     _state = state;
 }