Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 01:30 pm EDT

Geeklog Forums

login before homepage


Status: offline

ofey

Forum User
Full Member
Registered: 03/18/05
Posts: 213
Location:Dublin, Ireland
hopeful
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. Question

Any help would be greatly appreciated. (Perhaps I should be posting in the hacks forum)

Shane
Those who say it can't be done, are usually interrupted by others doing it.
 Quote

Status: offline

trip

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.
 Quote

Status: offline

casper

Forum User
Full Member
Registered: 02/11/04
Posts: 142
Location:Skien, Norway
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.
 Quote

Status: offline

ofey

Forum User
Full Member
Registered: 03/18/05
Posts: 213
Location:Dublin, Ireland
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
Those who say it can't be done, are usually interrupted by others doing it.
 Quote

Status: offline

casper

Forum User
Full Member
Registered: 02/11/04
Posts: 142
Location:Skien, Norway
Good luck, its not that "advanced"
But you need to customise some code, and remember to do so again with an upgrade Wink
I use this on two intranets, works like a charm!
 Quote

Status: offline

ofey

Forum User
Full Member
Registered: 03/18/05
Posts: 213
Location:Dublin, Ireland
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

Those who say it can't be done, are usually interrupted by others doing it.
 Quote

Status: offline

casper

Forum User
Full Member
Registered: 02/11/04
Posts: 142
Location:Skien, Norway
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 Smile

This is all you need in config:
$disable_custom_login = '0' // if set to '1' the normal login process will be used
 Quote

Status: offline

ofey

Forum User
Full Member
Registered: 03/18/05
Posts: 213
Location:Dublin, Ireland
happy
Brilliant that's working now. Big Celebration

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
Those who say it can't be done, are usually interrupted by others doing it.
 Quote

Status: offline

casper

Forum User
Full Member
Registered: 02/11/04
Posts: 142
Location:Skien, Norway
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.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
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
 Quote

Status: offline

ofey

Forum User
Full Member
Registered: 03/18/05
Posts: 213
Location:Dublin, Ireland
hopeful
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
Those who say it can't be done, are usually interrupted by others doing it.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Simply create a static page as a center block and use the normal login block.

bye, Dirk
 Quote

Status: offline

ofey

Forum User
Full Member
Registered: 03/18/05
Posts: 213
Location:Dublin, Ireland
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
Those who say it can't be done, are usually interrupted by others doing it.
 Quote

Status: offline

ofey

Forum User
Full Member
Registered: 03/18/05
Posts: 213
Location:Dublin, Ireland
happy
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,

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. Big Celebration

Thanks,

Shane
Those who say it can't be done, are usually interrupted by others doing it.
 Quote

Status: offline

ofey

Forum User
Full Member
Registered: 03/18/05
Posts: 213
Location:Dublin, Ireland
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.
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
Those who say it can't be done, are usually interrupted by others doing it.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
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
 Quote

All times are EDT. The time is now 01:30 pm.

  • 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