public bool IsValidForUser(User user)
 {
     return true;
 }
Exemple #2
0
 public static User Create(string username, string firstname, string lastname, string password,string email, Extension extension,UserRight[] rights)
 {
     Log.Trace("Creating new user with username " + username);
     if (LoadByUsername(username)!=null)
         throw new Exception("Unable to create user, one already exists with that username.");
     User ret = new User();
     ret.UserName = username;
     ret.FirstName = firstname;
     ret.LastName = lastname;
     ret.SetPassword(password, Constants.HTTP_AUTH_REALM);
     ret.UserExtension = extension;
     ret.Rights = rights;
     ret.Email = email;
     Connection conn = ConnectionPoolManager.GetConnection(typeof(User));
     ret = (User)conn.Save(ret);
     conn.CloseConnection();
     return ret;
 }