Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Creating a Website Login and how to register members into the database


Go to End
Reply

11 Posts   5349 Views

Avatar
PassePartout

26 June 2008 at 7:14am (Last edited: 8 July 2008 2:06am), Community Member, 21 Posts

Hello,

I have wishing to have my website be private, and thus this would require a login page, a page for the user to register and a page for sending/retrieving lost passwords.

I am unsure as of how to do this and have had advice ranging from using canView() to riping the forum module's code. I am new to SS and either of these methods is a little over my head right now.

Could I please get some help, thanks

Avatar
PassePartout

26 June 2008 at 8:53am Community Member, 21 Posts

Ok so I worked out a couple noob issues. I'm not sure why I could never find the access tab (yes I did try and find it before, I guess I got confused reading and thought it was supposed to be on the security tab for some reason). I am now on my way (aka going to do this tomorrow) to making a registration form (any tips anyone? any problems that people know I might encounter?).


One question I still have is how to create a simple login for users that could be a box for user/pw and a button rather than have the whole security/login page (aka I want to make the login for users cleaner and smaller).


Cheers

Avatar
dio5

26 June 2008 at 9:12am Community Member, 501 Posts

Re login box: you can just have $LoginForm in the template, which will render a simple loginform with email/pw and a submitbutton...

Avatar
gkinane

27 June 2008 at 4:21am Community Member, 22 Posts

Hi Dio5

When you talk about :
Re login box: you can just have $LoginForm in the template, which will render a simple loginform with email/pw and a submitbutton...

Where is $loginForm to be added , which template.

Totally new to Silverstripe so excuse the ignorance.

Gerry

Avatar
PassePartout

27 June 2008 at 8:35am Community Member, 21 Posts

Hey Gerry,

you include the $LoginForm in whichever template you wish to have it in (e.g. "..tutorial/theme/template/"). Personally, I put it in my include folder under something like Login.ss which really only has the [url=http://pastebin.com/m2eea99f5]$LoginForm and some code which keeps it fiting in my theme[/url]. I had to fool around with the css to get it looking better and ended up using ID tags (in css that is "#idname{}") and messed with the padding and so forth to get it all looking tidy. If you don't have it already, make sure to get Firebug (firefox addon, press F12 to bring it up and "Inspect" objects).


So I hope that helps you out with the "just put it in templates". Basically, it's treated like $Content and all of those things, so you just need to put the code in any template and it does the rest. I just [url=http://pastebin.com/m2a16ec4c]included my login when needed[/url] and left it out of my templates.

Avatar
PassePartout

27 June 2008 at 8:39am Community Member, 21 Posts

As for the $LoginForm, are there other things like this that are indexed? e.g. is there a $RegisterForm or anything like that? If so, where would I look? I know I could browse http://api.silverstripe.com/ but I'm just wondering if there's anything else or if I hold the answer to my question already :)

Avatar
Willr

27 June 2008 at 9:19am Forum Moderator, 5511 Posts

There is a list of methods you can call in templates on the Page Controls page

http://doc.silverstripe.com/doku.php?id=built-in-page-controls

http://doc.silverstripe.com/doku.php?id=built-in-page-controls#quick_reference

Avatar
dospuntocero

7 July 2008 at 9:36am (Last edited: 7 July 2008 9:38am), Community Member, 54 Posts

well it seems not to exist a $RegisterForm variable, but a $LoginForm... this loginForm is for the CMS, not for a custom made private section

Go to Top