17488 Posts in 4473 Topics by 1978 members
| Go to End | Next > | |
| Author | Topic: | 3045 Views |
-
Login / Member option

26 April 2008 at 3:51pm Last edited: 26 April 2008 3:51pm
Hi,
I want to add a member state (active, inactive, banned) which gets checked on login. The value is only set by the admin in the cms and is never visible to public. I have got this bit happening no worries.
So if the member tries to login it checks the account to see which state it is in and acts appropriately.
Where should i start to look for this?
thanks.
-
Re: Login / Member option

28 April 2008 at 9:45pm Last edited: 28 April 2008 9:46pm
I would implement a DataObjectDecorator.
Then add it as a role to Member
http://doc.silverstripe.com/doku.php?id=dataobjectdecorator&s=decorator
then implement
updateCMSFields
so that this 'member state' is only shown if a 'administor' is logged in...g
Helmut -
Re: Login / Member option

28 April 2008 at 10:28pm
thanks Helmut,
I have already decorated the member to include the member state.
I now need to workout how to extend the authenticator classes to get it to check the member state.
-
Re: Login / Member option

29 April 2008 at 12:05am Last edited: 29 April 2008 12:10am
i'm not sure why there's a need for a special authenticator?
DataObjectDecorator can define default for field-values
fe: 'active' for your 'member state'.
then someone could fe. 'special implement'
SiteTree::canEdit() for pages,
if these Memers are canCMS Members.
Additionally you could generate getCMSFields on your classes, depending on member state...And only for restrictions about frontend users (members)
i could do things specially while frontend rendering, depending on your member state.
what is the missing part, so where's the need for an authenticator?g
helmut -
Re: Login / Member option

29 April 2008 at 12:12am
Because, won't that still log them in and just block them from seeing certain content?
I want them to be blocked from logging in but not have to remove them as members.
-
Re: Login / Member option

29 April 2008 at 12:28am
ok,
i thought about
'why not let him log in, if then, there's nothing he can do?'which means i'ld throw
Security::permissionFailure(null);
in any controller, if he's not 'active'.so it wouldn't matter that he is logged in...
i could additionally show him 'you're blocked' in his member profile...g
helmut -
Re: Login / Member option

29 April 2008 at 11:16am Last edited: 29 April 2008 11:18am
Actually that is a good idea Helmut, that would make customising the message that they get much easier.
It would also allow them to take the right steps to have the ban removed but delivering custom messages through to them in their profile page.
| 3045 Views | ||
| Go to Top | Next > |


