login before the home page

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
lolus13
Posts: 3
Joined: Thu Nov 19, 2009 8:04 pm

login before the home page

Post by lolus13 »

Would be possible to have the login access out of homepage? I'd like the people got the access to the content of homepage only after they logged in.
i know you can do it by the user administration, but it's not direct you have to click again on the button for go on the homepage and also i'd like the people don't see the admin page, just console admin login and go to the homepage
thanks and bye :)
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: login before the home page

Post by Thorsten »

Hi,

this isn't possible right now but we plan that for a future version.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
poman31
Posts: 3
Joined: Thu Jan 28, 2010 11:49 pm

Re: login before the home page

Post by poman31 »

I know this might be a little late for this reply.

I just did this today. It wasn't that bad to do.
I had to "hack" aka edit the index.php file
I edited the section
$tpl = new PMF_Template(array('index' => 'index.tpl',
'loginBox' => $login_tpl,
'rightBox' => $right_tpl,
'writeContent' => $inc_tpl),
$faqconfig->get('main.templateSet'));

to be
if (isset($auth)) {
$tpl = new PMF_Template(array('index' => 'index.tpl',
'loginBox' => $login_tpl,
'rightBox' => $right_tpl,
'writeContent' => $inc_tpl),
$faqconfig->get('main.templateSet'));
}
else {
$tpl = new PMF_Template(array('index' => 'indexmustlogin.tpl',
'loginBox' => $login_tpl,
'rightBox' => $right_tpl,
'writeContent' => $inc_tpl),
$faqconfig->get('main.templateSet'));
}

and made a new tpl file called "indexmustlogin.tpl" in our template directory.
with the below code as most of teh mainbody
<div class="columns">
<div class="leftcolumn">
<h2 class="invisible">Navigation</h2>
<div class="content">
<div id="categories">

</div>
</div>

<div class="content">
<div id="langform">
<form action="{writeLangAdress}" method="post">
<label for="language">{languageBox}</label>
{switchLanguages}
<input type="hidden" name="action" value="" />
</form>
</div>
</div>


</div>

<div class="main-content">


<div class="login">
<div id="loginform">
{loginBox}
</div>
</div>

<div class="login">
<div id="useronline">
{userOnline}
</div>
</div>

</div>
</div>
<div class="clearing"></div>
<div id="footer" class="footer">
<p id="copyrightnote">{copyright}</p>
</div>
{debugMessages}
</div>

I did this on 2.6.1 so I don't know if this will work on other versions.
lolus13
Posts: 3
Joined: Thu Nov 19, 2009 8:04 pm

Re: login before the home page

Post by lolus13 »

thanks to answer ,
but can you explain with more details what can it change index.php only ?
:D
lolus13
Posts: 3
Joined: Thu Nov 19, 2009 8:04 pm

Re: login before the home page

Post by lolus13 »

it's ok thanks a lot , i was just a little tired it works with the version 2.6.6 !!!!! :lol: :lol:
Post Reply