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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

login to private part of site


Go to End


9 Posts   3417 Views

Avatar
bettsaj

Community Member, 46 Posts

7 July 2010 at 7:40pm

Simple question really. I'm in the middle of designing a new website for my client and we have decided that the best route would be to use a CMS.
Currently i've installed the site on our web server using Joomla.... boo hiss... but I'm finiding it very "clunky" and not very userfriendly at the backend.

you can see the beginnings of the site if you navigate to http://secuk.dyndns.org

my requirements for the site are that it must have functionality to login to a private part of the site that is not accessible to the public. you'll notice that the exisiting site has a login box, after you've entered your username and password it reloads the site but with extra sections, buttons etc. basically an extranet.

my question is this.... does Silverstripe have this "login" functionality "out of the box", or would i have to install a module?

I'd like to know ASAP before i get too involved with the Joomla site as I would prefer to use Silverstripe. If Silverstripe does do what I want it to do... i'll scrap the Joomla site and installn Silverstripe.

Thanks in advance

Andy

Avatar
swaiba

Forum Moderator, 1899 Posts

7 July 2010 at 7:47pm

Edited: 07/07/2010 7:53pm

Hi Andy,

It certainly does I just finished a site that used this. It has the ability to create the sign up from using Forms...

http://doc.silverstripe.org/recipes:simplesignupform?s=signup%2520form

The login form can be included on a template with $LoginForm and on each page you want to have as member only again in the template you just need to do something like...

<% if CurrentMember %>
   Content for members
<% else %>
   Please log in to view.
<% end_if %>

In total to achieve what you have asked for would be about 2/3 hours work once you know what to do (that includes installing the system). Hope this helps,

Barry

Avatar
bettsaj

Community Member, 46 Posts

7 July 2010 at 7:58pm

Edited: 07/07/2010 7:59pm

Many thanks for the reply,

There seems to be a lot of coding involved...... Not that I mind coding, but I thought it may have been a bit easier.

Are you saying that I would have to add code to EVERY page that I want the login box to appear in?

Avatar
swaiba

Forum Moderator, 1899 Posts

7 July 2010 at 8:05pm

I don't think there is much coding involved, except if you mean amount of code you need to cut/paste for a sign up form. If you want to create members yourself then the admin system means this is all point and click... Having said that I am no droopal/joomla expert so I have no idea how they compare...

>> Are you saying that I would have to add code to EVERY page that I want the login box to appear in?

no, in ss there are 3 levels of templates... Page, Layout & Include... by placing the $LoginForm in your Pages.ss it would appear in every page... or in one of the sections included by Pages.ss like Footer.ss or Navigation.ss it would appear everywhere.

Barry

Avatar
bettsaj

Community Member, 46 Posts

7 July 2010 at 8:09pm

Edited: 07/07/2010 8:11pm

I think I need to explain a bit more clearly.

It will be work collegues only so there doesn't need to be a registration form, just a login form. I would manually add the members myself through the backend. The private site would not be available to the public.

Avatar
swaiba

Forum Moderator, 1899 Posts

7 July 2010 at 8:19pm

ok, you can skip the login form placement completely if you like, just add them in the admin section ('Security'), then ask them to login at www.yoursite.com/Security/Login. Done. No Coding. People often say I make things more complicated than I need to :)

Well you still need to add the <% if CurrentMember %> on the Page.ss but as this is going to be site wide, you only need to do that once...

I assumed it would be public facing... DOH!

Barry

Avatar
Mo

Community Member, 541 Posts

13 July 2010 at 9:47am

Can't you just use the behaviour tab for you page in the CMS to restrict access to only specific users? That would seem the simplest to me...

Mo

Avatar
swaiba

Forum Moderator, 1899 Posts

13 July 2010 at 9:49am

and now to me too - everyday a new learning :)

Go to Top