     @unblock()
 
     existingUser = Meteor.users.findOne(selector)
-    if existingUser? && !options.allowUpdate
+
+    if existingUser? and !options.allowUpdate
       throw new Meteor.Error(500, 'User already exists.')
-    else if !isAdmin && existingUser? && existingUser._id != @userId
+    else if !isAdmin and existingUser? and existingUser._id != @userId
       throw new Meteor.Error(403, 'Not authorized to update other users.')
-    unless existingUser
-      modifier['profile.signUp.date'] = new Date()
+    else if !isAdmin and !existingUser? and !signUpAllowed
+      throw new Meteor.Error(403, 'SignUp not permitted.')
+    
+    unless existingUser then modifier['profile.signUp.date'] = new Date()
 
     enabled = modifier.enabled
-    if enabled? && !isAdmin
+    if enabled? and !isAdmin
       throw new Meteor.Error(403, 'Only admins can enable/disable users.')
     else if existingUser? and AccountsUtil.isAdmin(existingUser) and enabled?
       throw new Meteor.Error(403, 'Admins cannot be enabled/disabled')
     unless existingUser
       # For users without the `enabled` field, enable them if we don't require sign-up approval
       # or the admin user is creating the new user.
-      enabled ?= config.signUp.requireApproval == false || isAdmin
+      enabled ?= config.signUp.requireApproval == false or isAdmin
       modifier.enabled = enabled
 
     Meteor.users.upsert selector, $set: modifier

  user = attempt.user
  config = AccountsUi.config()
  signUp = config.signUp
  if (config.account.enabledByDefault && user.enabled != false) ||
      AccountsUtil.isAdmin(user) ||
      user.enabled == true
    return true
  else

      
        Logger.info('Sent sign-up email to new user')
    
    if existingUser? and existingUser.enabled != enabled
      action = if enabled then 'enabled' else 'disabled'
      Logger.info('User ' + action, user._id)
      AccountsUi.sendEmailToAdmin
        subject: 'User ' + Strings.toTitleCase(action)
        html: '<p>User has been ' + action + '</p>' + userTable
      if enabled and !user.profile.activation?.date?
        Meteor.users.upsert selector, $set:
          'profile.activation.date': new Date()
        user = Meteor.users.findOne(selector)
