Jump to:

23479 Posts in 18951 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » login to private part of site

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

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

Page: 1 2
Go to End
Author Topic: 2163 Views
  • bettsaj
    Avatar
    Community Member
    46 Posts

    login to private part of site Link to this post

    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

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: login to private part of site Link to this post

    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

  • bettsaj
    Avatar
    Community Member
    46 Posts

    Re: login to private part of site Link to this post

    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?

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: login to private part of site Link to this post

    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

  • bettsaj
    Avatar
    Community Member
    46 Posts

    Re: login to private part of site Link to this post

    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.

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: login to private part of site Link to this post

    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

  • Mo
    Avatar
    Community Member
    508 Posts

    Re: login to private part of site Link to this post

    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

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts

    Re: login to private part of site Link to this post

    and now to me too - everyday a new learning

    2163 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.