17488 Posts in 4473 Topics by 1978 members
Page: 1 2
|Go to End||Next >|
12 August 2007 at 8:36am
Hey everyone... I'm pretty new but have figured out some things so far... But here is what I want to do... I want to create a HomePage (Via Tutorial) but with a twist... It will include the $loginForm but depending on what group you are affiliated I want it to redirect you to that page... I am using 2.1 for the new access tab.. Can anyone give me an code example to get me started?
12 August 2007 at 12:39pm
I've written up the basic idea here:
I hope this helps!
14 August 2007 at 4:13am Last edited: 14 August 2007 12:51pm
Looks good.... I messed with it after
I got the reponse and had some issues not being able to log out and try another user... And it would not let me log out.... I was having some other issues so it could have been from it but could adding this do that too?
Edit- Nevermind figured it out... But Can you give me some help on what to do in Redirectbygroup ?
But it didn't do anything... (Do I need to instatiate the custom form anywhere or does the code just replace the current login?
trying to get the first group it gets but my PHP is on the noob level at best... I'm used to Java VB or LotusScript....
14 August 2007 at 6:37pm
I finished up the code found on this page:
It is a little limited in terms of a member being in multiple groups. However, it should work for a basic system.
Let me know how you get on.
2 September 2007 at 7:46am
Hi Sean.... I feel like an idiot but I can't seem to implement this... My question is do i need to instantiate this (ie add this to a page some how $loginform etc...) if so can you point me in the right direction... If not for some reason it's not working... I am going to www.foo.com/Security/login and logging in as a test id that is only a member of that group and it logs in just fine but no redirect... I went to the mysql admin and it shows that the group id is 3 and so that is what i put in the customlogin php file... I even put echo "<script>alert('yo')</script>" in the customlogin php file to see if it fires or not (not sure this would work or not but I don't know much about php debugging) and it doesn't seem to fire...\
Thanks for all your help and I apologize for my noob-ness...
2 September 2007 at 2:18pm Last edited: 2 September 2007 2:20pm
Have you ran ?flush=1 at the end of the URL after adding this new file? You need to do this, so that SilverStripe detects the new file and adds it to the class manifest. Also ensure you have Object::useCustomClass('LoginForm', 'CustomLoginForm'); in _config.php which will override any instantiations of LoginForm with your custom one.
Also, please double check the classname is the same as the filename. eg. CustomLoginForm.php is 'class CustomLoginForm extends LoginForm', for example.
I've tested this out and it seemed to work for me. It just might be that you simply need do ?flush=1 on your site.
You could also try adding Debug::show('here'); somewhere in the PHP for the custom login form, so you can see if it's working or not.
3 September 2007 at 2:50am Last edited: 3 September 2007 2:50am
Here is my files and I'm getting nothing.... Thanks for your help
3 September 2007 at 2:51am
Sorry here is my files
Page: 1 2
|Go to Top||Next >|