Posted on: 02/14/06 05:19pm
By: ofey
Hi,
On one particular GL site I want only access for registered users.
Is it possible to have a static page purely devoted to login which a user must login to before they reach the homepage or any of the site?
In other words a user must login on a static page before they get to the homepage. So basically the login block would be the first and only thing a visitor sees.
I don't know where to start working on this.
Any help would be greatly appreciated. (Perhaps I should be posting in the hacks forum)
Shane
login before homepage
Posted on: 02/14/06 06:34pm
By: trip
it could be a bit of a pain in the first place, but you could turn off anonymous access to all topics and blocks except for the user functions block. That way only logged in users have access.
login before homepage
Posted on: 02/14/06 07:41pm
By: casper
Maybe
GL_Lockdown[*1] is what you need?
It gives you a login-screen and does not show anything from your site before correct u/p are entered.
login before homepage
Posted on: 02/14/06 07:47pm
By: ofey
Thanks Trip and Casper.
Just after posting I did come across GL_Lockdown. But I put off by the wording,
for advanced users
But I thiink that's the way to go.
Thanks a lot.
Shane
login before homepage
Posted on: 02/14/06 07:50pm
By: casper
Good luck, its not that "advanced"
But you need to customise some code, and remember to do so again with an upgrade
I use this on two intranets, works like a charm!
login before homepage
Posted on: 02/14/06 08:45pm
By: ofey
Hi,
I am working on it. It actually isn't too advanced for me. I'm on the last step, editing the config.php
I don't know if I'll be able to do this as I use a hosting company and don't use my own server. So in that case whats should the subnet addresses be? Do I need to check with the company?
Thanks,
Shane
login before homepage
Posted on: 02/14/06 08:57pm
By: casper
Actually I have commented out that part, it did not do anything for me since users are on both LAN and WAN. And if your server is on another net also, that function doesen help you either
This is all you need in config:
$disable_custom_login = '0' // if set to '1' the normal login process will be used
login before homepage
Posted on: 02/15/06 04:17am
By: ofey
Brilliant that's working now.
Do you think it would still be possible for people to sign up and register and get email for approval in the normail way. It's not that important, as this is a family site but I was just wondering.
Thanks you've been a massive help,
Shane
login before homepage
Posted on: 02/15/06 08:40am
By: casper
If you make an external form ie registration.html that post to users.php
this will work. Remember to have $_CONF['usersubmission'] = 1; in your config.php when using this hack.
login before homepage
Posted on: 02/16/06 03:10pm
By: Dirk
Actually, you don't need to install any add-ons to "lock down" Geeklog. Make all blocks except the login (user functions) block invisible to anoynmous users. Use the "loginrequired" options in config.php and put a static page up as a splash screen that's only visible for anonymous users explaining that it's a closed site and that's it.
For new users, you can switch on the user submission queue or disable new registrations - all in config.php.
bye, Dirk
login before homepage
Posted on: 02/21/06 12:17pm
By: ofey
Hi Dirk,
I've done all you suggested except I can't figure out how to make
[QUOTE Dirk] a static page up as a splash screen that's only visible for anonymous users[/QUOTE]
I'd like a splash screen with the login block for users and also with the link for new users to register and nothing accessible to non logged in users.
Thanks for your help and sorry it was so long since I answered your post. This site is nearly ready now, this is the only thing left to do.
Thanks,
Shane
login before homepage
Posted on: 02/21/06 02:58pm
By: Dirk
Simply create a static page as a
center block[*2] and use the normal login block.
bye, Dirk
login before homepage
Posted on: 02/21/06 11:04pm
By: ofey
Hi,
I really don't want any part of my site to be seen. I played with Dirk's suggestion for a while but then I logged in as admin and got an message saying I didn't have permission to view the stories although I could see everythign else.
So i went back to the GL_Lockdown plugin. I put a registration form on the splash page but how do I get it to use the function
function createuser ($username, $email) which is in users.php
Can I call that function from users.php or do I need to stick it in the index_alt.inc ?
Shane
login before homepage
Posted on: 02/22/06 06:55pm
By: ofey
Dirk thanks for your help.
Firstly I gave up on the external form and the GL_Lockdown and am now doing things the proper way, as Dirk originally suggested.
I tried using a story and then using a static page. With the story the forum in the center without any posts kept coming up. And with the static page the message 'There are no news stories to display.' was going up. So I thought why not change those strings in english.php to what i want, like so,
#1 => 'No News to Display',
#2 => 'There are no news stories to display. There may be no news for this topic or your user preferences may be too restrictive',
1 => '',
2 => 'You have arrived at Tenpennybags.com, which is a private family site. You can login using the form on the left or if you don\'t have an account you can sign up by clicking on \'New user\' below the form. Your registration will then be automatically emailed to the administrator of this site for approval.',
My only worry now is are those strings used somewhere else?
Next I want to try to get rid of the menu elements for anonymous. The menubar could be further reduced by using {allowed_menu_elements} instead of {menu_elements} (Dirk's idea!)
I think it looks really good.
Thanks,
Shane
login before homepage
Posted on: 02/22/06 07:21pm
By: ofey
To hide plugins in the the menu, I would have to modify their menu functions to check the global variable $_USER['uid']. If it's not set or 1, the current user is not logged in.
See here[*3] .
I tried this in /geeklog/plugins/mediagallery/functions.inc But it's not working.
function plugin_getmenuitems_mediagallery()
{
if ($_USER['uid'] = 1)
{
global $_CONF, $_USER, $LANG_MG00, $_MG_CONF;
$menulabel = $_MG_CONF['menulabel'];
$menurul = $_CONF['site_url'] . "/mediagallery/index.php"; // Menu url here
$menuitems = array();
$menuitems["$menulabel"] = $menurul;
return $menuitems;
}
}
Shane
login before homepage
Posted on: 02/23/06 04:04pm
By: Dirk
[QUOTE BY= ofey] And with the static page the message 'There are no news stories to display.' was going up.[/QUOTE]
If you make that static page take over the index page ("Position: Entire Page"), that note won't show up.
bye, Dirk