Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login after registration #44

Open
hypnosis opened this issue Mar 31, 2011 · 21 comments
Open

Login after registration #44

hypnosis opened this issue Mar 31, 2011 · 21 comments

Comments

@hypnosis
Copy link

Think about log in member just after frontend registration, if no activation is needed.

@nickdunn
Copy link
Contributor

Seconded. We're currently having to hack about this limitation by redirecting to a self-activation page after registration.

@nickdunn
Copy link
Contributor

Could this be an option somewhere? Or a hidden field perhaps? The ability to auto-log someone in on registration if no Activation field is present?

@TheJester12
Copy link

Agree. This would be really nice.

@brendo
Copy link
Member

brendo commented Oct 21, 2011

Agree, lets do this, either of these approaches would work:

  • Members: Auto Login filter
  • Hidden field, members[auto-login]
  • Setting in System > Preferences (maybe not)

@hypnosis makes an important distinction though, this will only happen if no activation is needed (which I think is reasonable :D)

@DavidOliver
Copy link
Member

+1

@jensscherbl
Copy link
Member

Turns out we can actually use SymphonyMember::filter_UpdatePasswordLogin() for this internally.

Added this as a filter (Members: Login), which is only available if no activation is needed. Just like @brendo suggested.

Providing a redirect for the event is highly encouraged, since the filter does none of the other stuff the global login event does (the new member will be logged in, but it only shows after a page reload).

Would be necessary to either duplicate a lot of existing code for that, or refactor the current logic, which I leave up to @brendo (or will do myself with his blessing).

brendo added a commit that referenced this issue Mar 22, 2013
Fix #222, Add Login Filter RE# #44, Remove redirects inside the filters to give all filters a chance to execute
@designermonkey
Copy link
Member

This filter should be available at all times!

You can be logged in without activation, as the default role can allow this.

@jensscherbl
Copy link
Member

Strange, I can't even remember working on this stuff...

@designermonkey
Copy link
Member

@brendo I really need some help here.

We build systems that need to lock a user to a public role, so that they can't do any of the 'activated' member functionality, yet we still allow them to log in so they can update their details and preferences. To do any more, they must activate to another member role which will allow them additional functionality.

I've sold Symphony to a very large project based on being able to do this stuff, as I was under the distinct impression that a member could indeed log in while unactivated, and that activation only promoted their role within the system.

Obviously, I am having serious problems now that I find that's not the case.

I really need help to figure out how to alter the extension to allow me to log in a user who is unactivated.

@designermonkey
Copy link
Member

Just to clarify my issue with this...

There is a checkbox on the activation field stating: Prevent unactivated members from logging in

Irrespective of whether this is checked or not, Public Role's are prevented from logging in.

@DavidOliver
Copy link
Member

This may not be of any help to you, but I'm using Members 1.3 with a Symphony 2.3.6 site, without the Activation field. When members register, I'm limiting them to the account view/edit page(s) via permissions on the Public role.

But I suppose you need the Activation functionality?

@designermonkey
Copy link
Member

Yes, as I need to promote to three possible roles after activation based on options chosen during signup. Everythign hinges on the email address you see, so they can't use the three possible functionalities until activated, as it verifies the email address.

Thanks though @DavidOliver, appreciate your input.

@DavidOliver
Copy link
Member

To expand on the above, my client either changes new members' roles or deletes them, avoiding the need for the Activation field/functionality. (Cross-posted.)

@designermonkey
Copy link
Member

If I remove the Lock Activation filter, then I can log straight in. This sounds a little odd to me as I do indeed want to lock the activation so it can't be dom hacked, and allow the user to login straight away.

Why does the Lock Activation filter prevent login? All it should do is prevent activation from happening.

@brendo
Copy link
Member

brendo commented Jun 20, 2014

AFK, but I think @DavidOliver is on the right path. Activation doesn't do what you intended, but Roles may be able to.

Can new Members go to a restricted role until they complete sign up? Once they do that, they can be upgraded to the respective role.

Activation is more or less to combat spam accounts, the double opt in if you like. Lock Activation prevents login because we want that person to go verify their account and use their activation code.

@designermonkey
Copy link
Member

But how then would I get the new members to verify they're email addresses? I am also trying to weed out spam users; Spammers are less likely to activate accounts, and therefore will be removed after a given time.

I don't understand then the reason why the Prevent unactivated members from logging in being unchecked still prevents members from logging in when the Lock Activation filter is present.

Something seems fishy here. Here's what I'm trying to achieve:

  1. A member signs up, and is sent an activation email to verify their email address, and therefore account.
  2. They are automatically logged in, and proceed to adding extra preferences, which needs the members ID to link to them. There are two separate events to do this, so I need to be logged in otherwise I have to write a load of custom code to call the member ID somehow.
  3. They complete signup, and can explore the members area, changing subscription settings, adding promotions etc.
  4. Until they activate, they cannot receive email subscriptions, and any promotions added will not be visible as 'live'.

Also, I can set an unactivated role for a user, but when they activate, they are always reverted to Public? Something is really not right here logically. Why can't I choose the default activated role? Stupid me.

  • I should be able to specify a non-activated role, and a default activated role. (doesn't work)
  • I should be able to lock the role until activated. (works)
  • I should be able to log in at any time, activated or not, but be restricted to the non-activated role. (doesn't work)
  • I should be able to activate and be promoted to the default activated role. (always reverts to Public)
  • I should be able to choose a role during activation. (not tested yet)

@brendo
Copy link
Member

brendo commented Jun 21, 2014

I'll have to verify when back in front of the code, but for the moment all
I can say is that the current setup of Members is geared towards another
use case.

@designermonkey
Copy link
Member

I'm going to move this to another issue, as it is a bug as far as I can tell from reading the code.

@designermonkey
Copy link
Member

No I'm not.

I've been sitting here for 2 days now trawling through the members code trying to ascertain why login fails with a lock activation filter.

Turns out it was not logging in because the ETM email was failing to send. I did not know that if one post save filter fails, all the other ones do.

I have learned a valuable lesson today: Symphony code is very very hard to debug.

@jonmifsud
Copy link
Member

@jensscherbl's suggestions works ( on an old members for a pretty old site ) - @nitriques not sure if you use this but feel free to chase me to add this functionality in and send a PR (can't do it on the members version I'm using right now)

@nitriques
Copy link
Member

Ok thanks for the heads up @jonmifsud . If you ever get the chance to send a PR, that would be neat.

@nitriques nitriques removed this from the 1.3 milestone Nov 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants