Welcome to Geeklog, Anonymous Wednesday, July 09 2025 @ 03:24 am EDT
Geeklog Forums
login before homepage
Status: offline
Forum User
Full Member
Registered: 03/18/05
Posts: 213

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
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
21
20
Quote
Status: offline
Forum User
Junior
Registered: 10/08/03
Posts: 25
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.
19
19
Quote
Status: offline
Forum User
Full Member
Registered: 02/11/04
Posts: 142
Maybe GL_Lockdown is what you need?
It gives you a login-screen and does not show anything from your site before correct u/p are entered.
It gives you a login-screen and does not show anything from your site before correct u/p are entered.
18
22
Quote
Status: offline
Forum User
Full Member
Registered: 03/18/05
Posts: 213
Thanks Trip and Casper.
Just after posting I did come across GL_Lockdown. But I put off by the wording,
But I thiink that's the way to go.
Thanks a lot.
Shane
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
20
21
Quote
Status: offline
Forum User
Full Member
Registered: 02/11/04
Posts: 142
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!
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!
19
20
Quote
Status: offline
Forum User
Full Member
Registered: 03/18/05
Posts: 213
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
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
24
18
Quote
Status: offline
Forum User
Full Member
Registered: 02/11/04
Posts: 142
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

This is all you need in config:
$disable_custom_login = '0' // if set to '1' the normal login process will be used
20
20
Quote
Status: offline
Forum User
Full Member
Registered: 03/18/05
Posts: 213

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

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
16
22
Quote
Status: offline
Forum User
Full Member
Registered: 02/11/04
Posts: 142
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.
this will work. Remember to have $_CONF['usersubmission'] = 1; in your config.php when using this hack.
22
16
Quote
Status: offline
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
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
For new users, you can switch on the user submission queue or disable new registrations - all in config.php.
bye, Dirk
25
23
Quote
Status: offline
Forum User
Full Member
Registered: 03/18/05
Posts: 213

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
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
18
23
Quote
Status: offline
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
17
16
Quote
Status: offline
Forum User
Full Member
Registered: 03/18/05
Posts: 213
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
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
23
18
Quote
Status: offline
Forum User
Full Member
Registered: 03/18/05
Posts: 213

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
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,
Text Formatted Code
#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
19
19
Quote
Status: offline
Forum User
Full Member
Registered: 03/18/05
Posts: 213
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.
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
I tried this in /geeklog/plugins/mediagallery/functions.inc But it's not working.
Text Formatted Code
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
18
23
Quote
Status: offline
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Quote by ofey: And with the static page the message 'There are no news stories to display.' was going up.
If you make that static page take over the index page ("Position: Entire Page"), that note won't show up.
bye, Dirk
18
17
Quote
All times are EDT. The time is now 03:24 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content