Question

i've got the Single File PHP Gallery and an OpenID provider. The gallery should only be accesible for registered users, so i tried to add a login to the gallery via LightOpenID. Additonal i have to set a cookie for to stay logged in.

In conclusion

  1. Open index.php - ask for OpenID - FINE
  2. Enter OpenID and set cookie - FINE
  3. Show gallery: NO images!

I can't see the images ... the script loads the CSS, but not the images. Here is the source:

index.php

<?php 
if ($_SERVER['REMOTE_ADDR'] == $_SERVER["HTTP_HOST"]) {
/* Single File PHP Gallery 4.1.1 (SFPG)
... */        
} else {
        $key = '27' .date(W). '28' .date(n). '35';
        if (isset($_COOKIE[$key])) {
            echo 'Session set ';
        }
        else {
            header ("Location: http://example.de/intern/login.php"); 
            # echo 'Session NOT set ';
            exit();
        }

/*
Single File PHP Gallery 4.1.1 (SFPG)
...

login.php

...
if ($openid->validate()) {
    $key = '27' .date(W). '28' .date(n). '35';
    setcookie($key, $key, time()+3600); # 1 hour
...

I think, the server don't allows the SFPG script to access to the images because the script has no cookie, so i tried the strange walkaround you see in the index.php

Thank you very much in advance for any help.

Single File PHP Gallery: http://sye.dk/sfpg/

Was it helpful?

Solution

The Single File PHP Gallery: http://sye.dk/sfpg/ have been updated, and now includes an option to set a password on the gallery.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top