OXID Community Forum

> International Forums > Developers > How to hide frontend with password?
Login
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Thread: How to hide frontend with password?


Reply
 
Thread Tools Search this Thread Display Modes
#Top   #1  
Old 06-20-2017, 12:55 PM
Dmytro Dmytro is offline
Junior Member
Join Date: Jun 2017
Posts: 7
Dmytro is on a distinguished road
Default How to hide frontend with password?

I need frontend to be visible only for logged in admins.
How to implement it in Oxid?
I have some PHP knowledge, but do not know how It can be done with Oxid.

I have tried to check session in front end and get logged admin, but it seems like I have different sessions in back end and front end.
Reply With Quote
#Top   #2  
Old 06-20-2017, 01:06 PM
foxido.de foxido.de is offline
Senior Member
Join Date: Jul 2013
Posts: 1,129
foxido.de is on a distinguished road
Default Re: How to hide frontend with password?

Have a look at page.tpl

Maybe you can do it like this:
Code:
[{if $oxcmp_user->oxuser__oxpassword->value && $oxcmp_user->oxuser__oxrights->value == "malladmin"}]
[{*...Your Page...*}] 
[{/if}]
__________________
Grüße

http://www.foxido.de/

- Modulentwicklung, Komplette Systeme, Beratung, Service

Tel: 02841-9161670

Deep-AutoSuggest, der neue Finder 4.6x 4.10.x und 90 weitere Module
Reply With Quote
#Top   #3  
Old 06-20-2017, 04:55 PM
Dmytro Dmytro is offline
Junior Member
Join Date: Jun 2017
Posts: 7
Dmytro is on a distinguished road
Default Re: How to hide frontend with password?

Thank you for answer, I am sure this code should work, but It does not work in my situation.
I make var_dump() for $oxcmp_user and result is 'null'. It is empty, I do not know why.
And I am logged in.
Reply With Quote
#Top   #4  
Old 06-20-2017, 05:15 PM
vanilla thunder's Avatar
vanilla thunder vanilla thunder is online now
Marco's Sidekick
Join Date: Nov 2010
Posts: 6,358
vanilla thunder is on a distinguished road
Default Re: How to hide frontend with password?

Did you try [{ $oxcmp_user|@var_dump}]? It might not work the other way
Reply With Quote
#Top   #5  
Old 06-20-2017, 10:17 PM
Dmytro Dmytro is offline
Junior Member
Join Date: Jun 2017
Posts: 7
Dmytro is on a distinguished road
Default Re: How to hide frontend with password?

I have tried
Code:
[{php}]
var_dump( $oxcmp_user);
[{/php}]
You variant also does not seem to work.
Reply With Quote
#Top   #6  
Old 06-21-2017, 07:53 AM
foxido.de foxido.de is offline
Senior Member
Join Date: Jul 2013
Posts: 1,129
foxido.de is on a distinguished road
Default Re: How to hide frontend with password?

Then you have wrongly tested. It works. It must be given the possibility to log in. Accordingly it would be so to use: page.tpl line 45 seq:
Code:
<div class="col-xs-12 [{if $sidebar}]col-md-9[{/if}]">
[{if $oxcmp_user->oxuser__oxpassword->value && $oxcmp_user->oxuser__oxrights->value == "malladmin"}]
                            <div id="content">
                                [{block name="content_main"}]
                                    [{include file="message/errors.tpl"}]

                                    [{foreach from=$oxidBlock_content item="_block"}]
                                        [{$_block}]
                                    [{/foreach}]
                                [{/block}]
                            </div>
[{/if}]
                        </div>
Always remember to delete the tmp.
__________________
Grüße

http://www.foxido.de/

- Modulentwicklung, Komplette Systeme, Beratung, Service

Tel: 02841-9161670

Deep-AutoSuggest, der neue Finder 4.6x 4.10.x und 90 weitere Module
Reply With Quote
#Top   #7  
Old 06-21-2017, 01:57 PM
Dmytro Dmytro is offline
Junior Member
Join Date: Jun 2017
Posts: 7
Dmytro is on a distinguished road
Default Re: How to hide frontend with password?

It seems to work now.
I tried to check from front end admin logged in back end and it failed.
When I logged in front end too, It became to work.

Just small mistake.
Reply With Quote
Reply

Bookmarks

Tags
frontend, hide, password

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Nicht Sichtbar
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide shopping cart from search engines SwissArmyKnife Administration 1 01-12-2014 02:04 PM
Db password encryption RMIGHTY1 General 19 06-08-2013 04:59 AM
Hide article price codrut_befu Newbies 4 02-15-2013 07:10 AM
Home page promotion for multiple categories + hide price bogdand Templates and Design 2 02-18-2012 12:00 PM
Script - Hide - Show - funktioniert nicht racoon Entwickler 17 09-10-2009 03:32 PM

All times are GMT +1. The time now is 02:30 PM.