Announcement

#1 2021-07-08 03:48:54

elguavas
Member
2012-06-24
18

Login box only, _before_ site appears. Howto?

Hi there, I am evaluating piwigo (it looks great on my test setup!) for a family website that will be ONLY for logged in users.

What I would like to be able to do is have a stand-alone login box appear first on the site, with progression to the home screen only after, and only if, login is authenticated.

I can't find a built-in or plugin method to easily achieve this, so I'd like some advice on how to implement it in a future-proof way for my site. (future-proof probably rules out plugins anyway as they can become unsupported.)

I am well versed in html and css aspects of website coding. I am also a developer (but i do not use php) so I could handle a minimal amount of php coding if required.

I realise I could implement this in a rough and ready way by using an apache mod_auth login in front of the site but I'd much prefer to do it all using piwigo's built-in authentication and accounts.

Thanks in advance for any replies!

Offline

 

#2 2021-07-08 09:34:07

Zentalquabula
Member
2014-05-10
217

Re: Login box only, _before_ site appears. Howto?

Set private permissions on albums, and you're done.

If you want a nice wrapper to Piwigo, you need to write your own plugin or come up with an external program.

Offline

 

#3 2021-07-08 17:23:44

erAck
Only trying to help
2015-09-06
1998

Re: Login box only, _before_ site appears. Howto?

With [extension by Piwigo Team] LocalFiles Editor add

Code:

$conf['guest_access'] = false;

to your local config.

Top level album names and keywords are still visible though, unless you make albums private (and assign groups and/or users who should have access).


Running Piwigo at https://erack.net/gallery/

Offline

 

#4 2021-07-10 03:12:43

elguavas
Member
2012-06-24
18

Re: Login box only, _before_ site appears. Howto?

Thanks for the replies. Especially erAck that config variable was a definite step in the right direction! However I'm still not all the way to what I want.

The key parts of my topic title are the "only" and "_before_". Combining both the steps given above gives me the login form by default, but it displays embedded in the body of a regular site page. I want _just_ the login box with no other site page elements.

For both the default theme and the bootstrap_darkroom theme (which is the one I am using) the site menubar and footer are still displayed above and below the login form. Sure, the "Albums" menu is empty because of all private albums, but you still see it is a gallery site. I don't want this information leakage on the login screen. Think of a wordpress login box, if you know it (or many other sites).

So as I said in my topic I want a standalone login box ONLY to be presented before proceeding to the site. No menubar, no footer, nothing but a login box.

I've been looking at override templates and have made a couple of changes to a custom identification.tpl that make the login form look how I want, but I can't display a standalone login box this way, still the headers/menu and footer are displayed.

Maybe I need to make a custom index.tpl that does not show the header/menu and footer when calling identification.tpl, but I can't see how to do that.

Perhaps I need some custom php code attached to a piwigo hook that will display a standalone login form only, but I need some pointers on how to do that.

Thanks again for your time and help to anyone who replies! :)

Last edited by elguavas (2021-07-10 03:14:26)

Offline

 

#5 2021-07-23 08:02:20

elguavas
Member
2012-06-24
18

Re: Login box only, _before_ site appears. Howto?

just bumping here as my last message (just above) got no replies. is there someone who could point me in the right direction here?

@erAck you got me part of the way there, is there anything more you can add?

@plg i'm sure you are very busy with version 12 but can you give me a pointer how to proceed?

anyone? i know what i'm trying to do must be possible! ;)

many thanks again for any help! :)

Offline

 

#6 2021-07-23 10:23:30

erAck
Only trying to help
2015-09-06
1998

Re: Login box only, _before_ site appears. Howto?

I think it was somewhere in this forum, but don't remember. Might have been some extension and/or fiddling with CSS. Search.


Running Piwigo at https://erack.net/gallery/

Offline

 

#7 2021-07-23 13:24:10

drmaemo
Member
2013-07-11
47

Re: Login box only, _before_ site appears. Howto?

Recommend applying Zentalquabula advice combined with the plugin called 'Advanced User Manager'. In other words, do the following:

Step 1. Configure permission of all albums to 'private'.

Step 2. Install 'Advanced Menu Manager' and delete 'Guest' from access to the site menu.

Just a login page should appear.

Hope it helps.

Note: Thanks goes to elguavas for spotting my plugin error in my original post.

Last edited by drmaemo (2021-07-25 02:08:34)


Piwigo 14.0.0 on Linux since 7 March 2020
PHP: 8.1.26 and MySQL: 10.11.6-MariaDB
Graphics Library: ImageMagick 6.9.10-68

Offline

 

#8 2021-07-24 03:17:26

elguavas
Member
2012-06-24
18

Re: Login box only, _before_ site appears. Howto?

@erAck thanks, i did search before i even posted my question and i found a few topics relating to logins but nothing that specifically went that extra mile i'm looking for. your tip about the 'guest_access' config variable was very helpful though.

@drmaemo thankyou! that took me a step further again and now things work almost how i want them to. i'm a bit cautious about relying on plugins for the long term but i guess since that 'Advanced User Manager' says it is authored by the 'Piwigo team' it may be ok to rely on. the grumm plugin classes it uses are also used by meany other plugins so i guess that's there for the long term too.

the last 2 things i'd like to solve are that the page header (with no menus) and page footer still display. since i had no luck removing them from login by using custom templates i guess it might be some custom css i should use instead. i'm not sure how to customise header and footer css ONLY when the login form is displayed though?

well, i'm nearly there, and i guess i can live with what is now possible with the excellent pointers people have given me here, if i absolutely can't figure out how to remove the login page header and footer completely...

the help available from the community on this forum certainly makes piwigo an even more excellent choice for my project.

Offline

 

#9 2021-07-24 04:21:59

elguavas
Member
2012-06-24
18

Re: Login box only, _before_ site appears. Howto?

@drmaemo oops i used the plugin name 'Advanced User Manager' in my reply above, which i pasted from your post above, but i assume you meant 'Advanced Menu Manager' which is what i am now using. there is no plugin called 'Advanced User Manager'.

Offline

 

#10 2021-07-25 02:10:06

drmaemo
Member
2013-07-11
47

Re: Login box only, _before_ site appears. Howto?

elguavas wrote:

@drmaemo oops i used the plugin name 'Advanced User Manager' in my reply above, which i pasted from your post above, but i assume you meant 'Advanced Menu Manager' which is what i am now using. there is no plugin called 'Advanced User Manager'.

Yes, you are correct. My goof for using Advanced User Manager. Thanks for spotting it! :-)


Piwigo 14.0.0 on Linux since 7 March 2020
PHP: 8.1.26 and MySQL: 10.11.6-MariaDB
Graphics Library: ImageMagick 6.9.10-68

Offline

 

#11 2021-07-25 02:20:15

drmaemo
Member
2013-07-11
47

Re: Login box only, _before_ site appears. Howto?

elguavas wrote:

@erAck thanks, i did search before i even posted my question and i found a few topics relating to logins but nothing that specifically went that extra mile i'm looking for. your tip about the 'guest_access' config variable was very helpful though.

@drmaemo thankyou! that took me a step further again and now things work almost how i want them to. i'm a bit cautious about relying on plugins for the long term but i guess since that 'Advanced User Manager' says it is authored by the 'Piwigo team' it may be ok to rely on. the grumm plugin classes it uses are also used by meany other plugins so i guess that's there for the long term too.

the last 2 things i'd like to solve are that the page header (with no menus) and page footer still display. since i had no luck removing them from login by using custom templates i guess it might be some custom css i should use instead. i'm not sure how to customise header and footer css ONLY when the login form is displayed though?

well, i'm nearly there, and i guess i can live with what is now possible with the excellent pointers people have given me here, if i absolutely can't figure out how to remove the login page header and footer completely...

the help available from the community on this forum certainly makes piwigo an even more excellent choice for my project.

Try this!

1. Install plugin called PWG Stuffs

2. In the Blocks Management tab of PWG Stuffs, locate the 'Main block' in the list and click the checkbox beneath it called 'Hide on home page'.

3. In the Blocks Management tab of PWG Stuffs, edit the 'Login' block and click the checkbox called 'On main page', and then click on 'Submit' to save the change.

Hope the above achieves what you desire.


Piwigo 14.0.0 on Linux since 7 March 2020
PHP: 8.1.26 and MySQL: 10.11.6-MariaDB
Graphics Library: ImageMagick 6.9.10-68

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact