Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

private.txt not working
https://www.tinywebgallery.com/forum/viewtopic.php?f=1&t=3070
Page 1 of 1

Author:  peque [ 2. Aug 2011, 00:07 ]
Post subject:  private.txt not working

Hi!

I use a simple private.txt with password inside to protect some dirs inside my Gallery... After upgrading all my system, I can't make it work again... If I try to access protected gallery dir with correct password, TWG just asks me again for password... If I try to access with wrong password, I get a "wrong password, retype" message.

I've seen some errors in debug file... but they don't apear always when trying to access proctected gallery:

Code:
08.01.2011 14:22:32 (es) - ERROR 8 in P\Aspx\fotos\i_frames\i_privatelogin.php, line 80: Undefined variable: passwd
08.01.2011 14:22:32 (es) - ERROR 2 in P\Aspx\fotos\i_frames\i_privatelogin.php, line 80: in_array() [_a href='function.in-array'_function.in-array_/a_]: Wrong datatype for second argument


Do you have some idea what could I be doing wrong? Here are some config variables:

$password_file='private.txt'; I've tried some variations, just in case. No luck.
$user_login_mode = false; Just to show you I'm not using username system... Just plain text password inside private.txt.

Any idea?

Thanks a lot.

Author:  peque [ 2. Aug 2011, 13:45 ]
Post subject:  Re: private.txt not working

More info: I either can't login with upper right link (same behaviour: TWG asks again and again for correct credentials)... I must go to /admin url directly, then introduce login/password...

Oh! I'm using last available version, 1.8.4... with almost no change in config from defaults...

Author:  TinyWebGallery [ 3. Aug 2011, 00:03 ]
Post subject:  Re: private.txt not working

Make sure all files from TWG are transfered properly.

- Michael

Author:  peque [ 3. Aug 2011, 09:36 ]
Post subject:  Re: private.txt not working

I'm using it in local PC with Apache 2.2 and last available php win32 binaries (5.0.x), so no possibility to have broken files because of fail ftp transfer... I'll reinstall and come back to you with results...

Thanks a lot.

Author:  peque [ 3. Aug 2011, 12:07 ]
Post subject:  Re: private.txt not working

I've done a new installation from scratch in a different directory, with demo gallery (so not a comma changed from default config installation). All is working right... So I suspect it could be something relative to my gallery, which is quite big (29 pages, 343 dirs)... Could it be?

Author:  TinyWebGallery [ 3. Aug 2011, 21:38 ]
Post subject:  Re: private.txt not working

if you have so many dirs please read the howto how to optimize galleries.

Best,
Michael

Author:  peque [ 4. Aug 2011, 13:51 ]
Post subject:  Re: private.txt not working

Ok... I understand you are talking about howto 45... Anyway... Doing those things should affect speed... but not the login session stability... ¿?

I've done some more tests, and I can confirm that my whole gallery is crashing TWG... If I configure different basedir, with less galleries, there's no login session problem at all. :(

Author:  TinyWebGallery [ 4. Aug 2011, 14:23 ]
Post subject:  Re: private.txt not working

maybe the session size is getting a problem then. TWG does cache folder structures in the session to make everything much faster.

have you tried:
$cache_dirs = false;
$autoenable_cache=-1; // because otherwise the cache is turn on automatically later on.

What you can also do is
$use_cache_with_dir = true;

then the cache folder is not flat but with folders. Some servers have problems with big file lists...
You only have to test if this works because php has to be able to create dirs.

- Michael

Author:  peque [ 4. Aug 2011, 17:11 ]
Post subject:  Re: private.txt not working

I did all of your recomendations... None of them worked... But as you said it has to be something related to session caching... I just disable "Enable session caching of directories and files" using admin panel... Now all is working flawlessly again.

What's exactly what I "lose" by disabling this, provided that general caching is enable?

Thanks man!

Author:  TinyWebGallery [ 4. Aug 2011, 19:30 ]
Post subject:  Re: private.txt not working

Enable session caching of directories and files == $cache_dirs = false;

If this is enabled directories are only read once and not every time you access the folder.
Especially for the counting how many files are in a folder does already a prefetch. So normally TWG takes a little bit more
at the beginning and after that everything is taken from cache.

But with that many folders this might runs into a limit.

Have you find out at how many folders this happens? Because I tried with 200.000 files but this is my local install where I don't have any memory problems...

- Michael

Author:  TinyWebGallery [ 4. Aug 2011, 19:41 ]
Post subject:  Re: private.txt not working

you can also try to enable the caching but set
$serialize_dir_data=false;
$precache_background=false;

then only the folder s you access are cached and no precaching in the background is done...

- Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/