kendraio / kendra_home

Kendra Home
https://www.kendra.io
GNU General Public License v2.0
2 stars 2 forks source link

User Registration Form #20

Closed iAugur closed 9 years ago

iAugur commented 10 years ago

The validation of a submitted empty for shows the machine name field (not visible on the original form) This is the Safeword module field for field_user_name

BBGuy commented 9 years ago

Can't find any custom code that makes changes to the form so likely to be an issue with the module. first step will be to update from 7.x-1.4+0-dev to latest version 7.x-1.13

BBGuy commented 9 years ago

Updating the module did not solve the issue. Also nothing in the issue Q, although module is not used much so issues are not comprehensive

BBGuy commented 9 years ago

Looked at the code I suspect the module is working as it should and was simply not designed to work with the user entity, the module has case statements for nodes and taxonomy. The line tat is responsible for hiding the field is:

        '#disabled'      => (!empty($items[$delta]['machine']) && empty($field['settings']['allow_machine_changes'])),

and I suspect $items[$delta]['machine'] is not empty after submitting.

So the best way forward is to try and add a form alter to hide the field.

BBGuy commented 9 years ago

committed by mistake on issue #33 see commit

BBGuy commented 9 years ago

This is now fixed on dev see

To deploy:

BBGuy commented 9 years ago

I have pushed to live and clear caches but issue is not fixed, will investigate tomorrow

dahacouk commented 9 years ago

Now this seems to be working we're getting a few spammers registering. What would be ideal is...

BBGuy commented 9 years ago

The first one is difficult as it uses the default Drupal user registration. However using the new admin screen it should be possible to bulk delete this accounts in one go. Can probably add some custom validation for the full name if you think its needed.

BBGuy commented 9 years ago

Country is now required (easy config change)

BBGuy commented 9 years ago

check that full name is 2 words: I have made the code changes on dev. We have also enabled messages on the home page so users can see the messages.
We have also added help test for the full name. All configuration are live. To do

BBGuy commented 9 years ago

Re: Once they verify their email address then I should get a notification to activate their account. Looks like the system is set up as follows:

  1. User registers on the site - he gets a "pending admin approval" email
  2. Admin gets an email - {user} has applied for an account.
  3. Admin follows the link in the email and approves the account.
  4. user gets an email : Your account at Kendra Initiative has been activated. email also contains a one time email verification link.

@dahacouk so looks like no need for any other emails.

dahacouk commented 9 years ago

What we need is:

  1. User registers on the site - he gets a "please verify email address" link email.
  2. User follows the link - he gets a "pending admin approval" email
  3. Admin gets an email - {user} has applied for an account.
  4. Admin follows the link in the email and approves the account.
  5. user gets an email : Your account at Kendra Initiative has been activated. email also contains a one time email verification link.
BBGuy commented 9 years ago

Went over with @dahacouk and this is the new registration process: 1) We will remove the need for Admin approval. 2) Create two new roles "active" and "approved" 3) Move all permissions from "Authenticated user" to "approved" so "Authenticated user" can only set personal details. 4) When a user validates his email he will get the "active" role. 5) Send an admin email on new active users 6) build a active users waiting for approval screen 7) once a user is set to "approved" send them an email to let them know

to do Dev:

BBGuy commented 9 years ago

Options to look at for getting a trigger on the email validated:

dahacouk commented 9 years ago

In https://github.com/kendraio/kendra_home/issues/20#issuecomment-77396411 do you mean "rules" in "see if we can use roles to assign the "active" role after the user validates his email and also to send the admin email."?

BBGuy commented 9 years ago

yes thanks, updated

BBGuy commented 9 years ago

I have updated the user view to make it easier to bulk update users

BBGuy commented 9 years ago

@dahacouk We need to review permissions as some may be relevant to members that have not yet been approved. Some candidates are: "Use search" "Add org to current user: Execute rules link", "Subscribe to newsletters "Cancel own user account". I have moved all but "Cancel own user account" on the dev site.

BBGuy commented 9 years ago

I got a rule working that will assign the active role and send an admin email:

{ "rules_validated_user_email" : {
    "LABEL" : "Validated User email",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules" ],
    "ON" : [ "user_update" ],
    "IF" : [
      { "NOT user_has_role" : { "account" : [ "account" ], "roles" : { "value" : { "6" : "6" } } } }
    ],
    "DO" : [
      { "user_add_role" : { "account" : [ "account" ], "roles" : { "value" : { "6" : "6" } } } },
      { "mail" : {
          "to" : "[site:mail]",
          "subject" : "Account validated for [account:name]",
          "message" : "Account validated for [account:name] to approve the account click [account:edit-url]"
        }
      }
    ]
  }
}
BBGuy commented 9 years ago

New role for User Approved email

{ "rules_user_approved" : {
    "LABEL" : "User Approved",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules" ],
    "ON" : [ "user_update" ],
    "IF" : [
      { "user_has_role" : { "account" : [ "account" ], "roles" : { "value" : { "7" : "7" } } } },
      { "NOT user_has_role" : {
          "account" : [ "account-unchanged" ],
          "roles" : { "value" : { "7" : "7" } }
        }
      }
    ],
    "DO" : [
      { "mail" : {
          "to" : "[account:mail]",
          "subject" : "Your [site:name] account has been approved",
          "message" : "Hi [account:name] \r\nYour [site:name] account has been approved. \r\nyou are now a full member of the Kendra community.\r\n\r\nKind Regards\r\nDaniel Harris.\r\n"
        }
      }
    ]
  }
}
BBGuy commented 9 years ago

Go live plan:

Can be completed at any time

Go live

BBGuy commented 9 years ago

This is now live. I updated 2923 users The only permissions that I left with authenticated user are "Subscribe to newsletters" & "Change own username" @dahacouk to finish the process you need to should review users that have registered before the changeover and are not yet approved. to do so:

1) go to the main people view (admin/people). 2) Filter by Active = No. 3) Sort on "Member for" so the most recent accounts are at the top. 4) for ant valid accounts you find edit and add both "active" & "approved" roles.

Test & close the issue if you are happy with the new process

dahacouk commented 9 years ago

"Check that full name is 2 words" doesn't seem to be working. I have just registered a one name account and I see spammers registering happily with one name. I am very interested why this issue was passed to me without this feature working. :-/

BBGuy commented 9 years ago

Hi @dahacouk Probably my fault for not splitting this into two issues. The live stuff is to do with the new registration process The name validation is on dev and will be pushed tomorrow with module updates and if I get it in in time the new user import

BBGuy commented 9 years ago

All deployed @dahacouk close if you are happy with this

dahacouk commented 9 years ago

To update the "approved" mail message go to https://www.kendra.io/admin/config/workflow/rules/reaction/manage/rules_user_approved/edit/5