Method code for $sys.create_user()

[Turn off line numbering]
  1: arg name, password, email, @type;
  2: var user;
  3: 
  4: if (!(| caller() == $login_interface |) && type((| .perms(sender(), 'system) |)) == 'error)
  5:     throw(~perm, "Caller and Sender are not allowed to call this method.");
  6: [(type ?= 'new_user_class)] = type;
  7: catch any {
  8:     user = starting[type].spawn(name);
  9:     user.set_name(name);
 10:     if (type == 'new_user_class)
 11:         user.set_password(password);
 12:     user.change_manager(user);
 13:     user.set_user_info("rl-email", $user_info, email);
 14: } with {
 15:     // Failed to initialize the child; destroy it.
 16:     (| user.destroy() |);
 17:     rethrow(error());
 18: }
 19: return user;

["// Created 26-Mar-1995 as a part of ColdCore, see: @help Credit"]

the Cold Dark