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

How To Use SilverStripe For Company Intranet ??


Go to End


5 Posts   2307 Views

Avatar
AJIT

Community Member, 4 Posts

10 April 2010 at 7:21pm

We have selected SilverStripe For Our Company Employee Intranet
We want that the site has to be secured and therefore I have added following in Page Class after studying security documents on web

parent::init();
		 if($this->URLSegment != 'Security' && !Permission::check("VIEW_SITE"))
         Security::permissionFailure(null);

This code works but there is no logout link on page

How to get log out link on page (just like admin user) for all logged in users ?

Regards ,

AJIT

Avatar
AJIT

Community Member, 4 Posts

10 April 2010 at 7:25pm

We are implimenting version 2.4.2 RC2

Avatar
Willr

Forum Moderator, 5523 Posts

11 April 2010 at 11:54am

Edited: 11/04/2010 11:55am

How to get log out link on page (just like admin user) for all logged in users ?

<% if CurrentMember %>
<a href="Security/logout">Log out</a>
<% end_if %>

That code basically says If logged in, add a link tag to logout. (Security/logout is the logout handler).

Avatar
AJIT

Community Member, 4 Posts

11 April 2010 at 1:09pm

I have done this but how to make following line work in footer template ?

<% _t('LOGGEDINAS','Logged in as') %> <strong><% if FirstName && Surname %>$FirstName $Surname<% else_if FirstName %>$FirstName<% else %>$Email<% end_if %></strong>

How to make Firstname & Lastname available when any user logs in ?

Regards

AJIT

Avatar
Willr

Forum Moderator, 5523 Posts

11 April 2010 at 2:03pm

Well if they are logged in then you have the $CurrentMember Object. So you can call any member functions on like like $CurrentMember.FirstName $CurrentMember.Email or just wrap your code in a <% control CurrentMember %>