Example #1
0
        public User(string username)
        {
            this._id = Guid.NewGuid ();
            this._createtimestamp = Date.CurrentDateTimeToTimestamp ();
            this._updatetimestamp = Date.CurrentDateTimeToTimestamp ();
            this._usergroups = new List<Usergroup> ();
            this._username = username;
            this._password = string.Empty;
            this._realname = string.Empty;
            this._email = string.Empty;
            this._status = Enums.UserStatus.Disabled;
            this._scope = string.Empty;

            // Check if specified username is available.
            if (User.IsUsernameInUse (username))
            {
                // EXCEPTION: Exception.UserCreateUsername
                throw new Exception (string.Format (SorentoLib.Strings.Exception.UserCreateUsername, username));
            }

            // Add default usergroup.
            try
            {
                this._usergroups.Add (Usergroup.Load (Services.Config.Get<Guid> (Enums.ConfigKey.core_defaultusergroupid)));
            }
            catch
            {
                // LOG: LogError.UserCreateDefaultUsergroup
                //				Services.Logging.LogError (string.Format (Strings.LogError.UserCreateDefaultUsergroup, Services.Config.Get<Guid> (Enums.ConfigKey.core_defaultusergroupid)));
                Services.Logging.LogError (Strings.LogError.UserCreateDefaultUsergroup);
            }
        }
Example #2
0
 /// <summary>
 /// Update user entry in connected user list
 /// </summary>
 /// <param name="UserID"></param>
 /// <param name="ConnecttionID"></param>
 /// <param name="BroadCastType"></param>
 /// <param name="Status"></param>
 /// <returns></returns>
 public bool UpdateUserStatus(long UserID, string ConnecttionID, Enums.BroadCastType BroadCastType, Enums.UserStatus Status)
 {
     return(_dr.UpdateUserStatus(UserID, ConnecttionID, BroadCastType, Status));
 }
Example #3
0
 private User()
 {
     this._id = Guid.Empty;
     this._createtimestamp = 0;
     this._updatetimestamp = 0;
     this._usergroups = new List<Usergroup> ();
     this._username = string.Empty;
     this._password = string.Empty;
     this._realname = string.Empty;
     this._email = string.Empty;
     this._status = Enums.UserStatus.Disabled;
     this._scope = string.Empty;
 }