22997 Posts in 11620 Topics by 2827 members
|Go to End|
14 June 2012 at 4:55am
I use SS for 3 month by now but I still have some misunderstanding, I was looking for a topic which is talking about my issue but I don't find anything so I create mine, it's the next :
To my work I have to add a no disclosure charter that my new users have to accept to can log in.
I have already create my own MemberLoginForm and add "elseif(Member::currentUser()->NumVisit <=1)" in the dologin function to catch all news members that wanna log in.
At this point I wanna those news members are redirected to my disclosure charter and have to accept it to log in ( this charter is shown only for the first log in ).
Some co workers said to me that I can use a session variable.
Like create my own : Session::set('acceptForm, true);
and after test it on my controller : if(Session::get('acceptForm') != true) Director::redirect('confirmation-page/')
I tried to do this but i don't really know how it's works.
Another issue : I wanna that my news users have to change their password when they log in for the first time.
the best scenario is the next :
- the user come to the login page
- fill out the form with his personnal informations
- He is redirected to my disclosure charter
- Read my charter and accept it
- Again redirection to /security/changepassword to choose a new password
- if all these steps are sucessful, he is correctly log in
I hope you will understand my problem and can help me
I thank in advance who will answer me.
ps : I apologize for my bad english , isn't an excuse but i'm french ^^
14 June 2012 at 3:58pm
This is a difficult one to answer.
I would suggest extending the Member class and adding 'acceptedCharter' = "Boolean" rather than relying on the NumVisit
and on completion of the form switch this value to true. So when you are catching all new members you can check if this value is set.
To keep things simple you could have the new password form in with the accept charter form. Then in the form complete function add
$validateMember = $Member::crrentUser();
$validateMember->changePassword('users new password here');
Perhaps posting the code you have so far could help.
PS you're English is quite good
14 June 2012 at 8:16pm Last edited: 14 June 2012 8:23pm
First of all thx to have taking the time to answer me.
here is my custom MemberLoginForm ==> http://pastebin.com/embed_js.php?i=FSFc7D5v
I wanna add my charter form on line 150.
Concerning the change of the password, if I use the "$validateMember->changePassword('users new password here');"
It will call the security/changepassword page ? or I have to do by myself ? Cause I add some controls when a new password is required. I.e I use the password validator with some length, strength etc.
I guess the best way to do this is do add a redirection on the accept button of my charter form that do all work for me.
Another point, Can i create the form on the line 150 just like that or I have to add a new classe that extending the form class ?
I'm not sure what is the good way to do this
that is, if you have some others ideas i'm taking them
19 June 2012 at 5:41pm
I would extend the form class for your change password form (or any others), it will get messy if you make it on line 150.
You should be able to check length and strength of password before calling changePassword()
And here is some useful stuff on MemberLogin form if you have not found it yet http://www.ssbits.com/snippets/2010/customize-the-redirect-after-a-successful-member-login/
Sorry I can't be of more help.
|Go to Top|