login required before accessing root album

qwaq

Joined: 2009-11-11
Posts: 14
Posted: Sun, 2012-01-15 08:50

Hi,

I have a website constituted of a main album containing subalbums, the whole being 100% Gallery2.

I wish to set up a password for accessing the root album: visitors would type the address or follow a link to the site, and reach a page asking for login / password information or a "please contact adminATsite.com" form.
This would allow only selected visitors to have access to the site. To put it in other words, family and friends but not people from Google and others :)

I am pretty sure there is something that has been developed to achieve this.
I have to admit I am very far from these site administration questions: it's already something for me to have a gallery working, and that can be seen by others!!

Many thanks for your help!


Gallery version = 2.3 noyau 1.3.0
PHP version = 4.4.9 cgi
PHPInfo Link (see FAQ):
Serveur Web = Apache/2.2.X (OVH)
Base de données = mysqlt 5.0.68-log, lock.system=flock
Activated toolkits = Gd
Operating system = Linux web288.60gp.ha.ovh.net 2.6.29.5-grsec-mutu2-grs-ipv4-32-debug #53 SMP Thu Jul 30 18:59:58 CEST 2009 i686
Browser = Mozilla/5.0

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2012-01-15 13:44

From the root album Edit Permissions -> Group Permissions -> Remove Everybody [core] View all versions -> Add Registered Users [core] View all versions

Either create your "family users" and email them their username & passwords or install the register module and allow anonymous registration but activate each user manually in site admin -> Registration

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
qwaq

Joined: 2009-11-11
Posts: 14
Posted: Sun, 2012-01-15 14:54

sounds easy!
thanks for your help!
I got a little additional question on another unrelated topic: is there a way to monitor the visitors origin?
thanks again for your reply :)

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2012-01-15 18:21

The most complete way to monitor your site's traffic is to use Google Analytics.

open in notepad or your favorite html editor: gallery2/themes/your theme/templates/local/theme.tpl <- you may have to copy the original here

just before </body> add:

{literal}
  <script>
   var _gaq = [['_setAccount', 'UA-XXXXX-X'], ['_trackPageview']];
   (function(d, t) {
    var g = d.createElement(t),
        s = d.getElementsByTagName(t)[0];
    g.async = true;
    g.src = ('https:' == location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    s.parentNode.insertBefore(g, s);
   })(document, 'script');
  </script>
{/literal}

change the UA-XXXXX-X to be your site's Google Analytics ID

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2