Zubrag.com
December 17, 2017, 07:45:34 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Warning: Invalid argument supplied for foreach()  (Read 7979 times)
usermiracle
Newbie
*
Posts: 2


« on: April 18, 2015, 07:34:50 AM »

Hi, great script, for this reason - please please please - fix the errors on the flatfile.inc.php / when visiting this file directly it displays the delete button for deleting registered users and a number of  Warning: Invalid argument supplied for foreach(). I think this is easy for you to fix. Unfortunately I am not so clever Smiley However I believe the solution is here: https://www.euperia.com/development/fix-php-warning-invalid-argument-supplied-foreach/1230

Will you fix this it seems quite important - if you google that file and error you find a number of websites with the script, this seems to be a security issue too.

Thank you!!!

I realized I did not give enough info to help. These are the actual errors:

Warning: file() [function.file]: Filename cannot be empty in /flatfile.inc.php on line 49

Warning: Invalid argument supplied for foreach() in /flatfile.inc.php on line 51

Warning: file() [function.file]: Filename cannot be empty in /flatfile.inc.php on line 118

Warning: str_repeat() [function.str-repeat]: Second argument has to be greater than or equal to 0 in /flatfile.inc.php on line 124

Logged
zubrag
Administrator
Hero Member
*****
Posts: 785


WWW
« Reply #1 on: April 18, 2015, 04:43:43 PM »

Hi. Please try following
Open flatfile.inc.php and add following code as second line into it  (the first line is  <?php    )

if(!defined('USE_USERNAME_ADMIN')){ die(); }


I didn't try it, but hopefully it will show just blank screen when opened directly. Does it help?
Logged
usermiracle
Newbie
*
Posts: 2


« Reply #2 on: April 18, 2015, 06:54:02 PM »

Hi, thanks for replying. Your solution appears to work. I have not checked if it affects any functionality but it has cleared up the errors. Thanks. I will let you know if there are any related issues, hopefully not. Thanks for fast response I did not expect it.
Logged
anythinghere
Newbie
*
Posts: 7


« Reply #3 on: April 20, 2015, 04:33:33 PM »

I am the original poster http://www.zubrag.com/forum/index.php/topic,12160.0.html but locked out of my 1st forum account... so opened another account. Since adding your suggested code I am unable to login to my site with your script. Thanks

Actually that is not the issue the issue is I can only login to the site as the admin - but not as "member" after sign up
Logged
anythinghere
Newbie
*
Posts: 7


« Reply #4 on: April 20, 2015, 04:56:06 PM »

actually they just can not login to password protected pages. The login.php appears to work but protected pages just says incorrect password for members... and I don't think it is the code you supplied for the flatfile.inc.php that causes this. The admin CAN login to password protected pages. So it is weird.
Logged
zubrag
Administrator
Hero Member
*****
Posts: 785


WWW
« Reply #5 on: April 21, 2015, 01:45:06 AM »

Were these users able to login previously, or you are trying to setup users for the first time?
Logged
anythinghere
Newbie
*
Posts: 7


« Reply #6 on: April 21, 2015, 08:43:28 AM »

Forum will not accept my replies... in short I only tested the login php originally
Logged
zubrag
Administrator
Hero Member
*****
Posts: 785


WWW
« Reply #7 on: April 21, 2015, 09:38:12 AM »

So you can login into manager.php and see list of users there with logins and passwords?  And you cannot login as one of these users by opening login.php?  How does it look after user login? Any errors, any messages?
Logged
anythinghere
Newbie
*
Posts: 7


« Reply #8 on: April 21, 2015, 12:22:21 PM »

unable to beat spm filter
Logged
anythinghere
Newbie
*
Posts: 7


« Reply #9 on: April 21, 2015, 08:34:49 PM »

yes manager.php works and users are stored, longer messages in this forum get stopped Sad
Logged
anythinghere
Newbie
*
Posts: 7


« Reply #10 on: April 23, 2015, 09:02:55 AM »

any suggestions? thanks
Logged
zubrag
Administrator
Hero Member
*****
Posts: 785


WWW
« Reply #11 on: April 23, 2015, 09:36:19 AM »

I sent you email yesterday how to proceed
Logged
anythinghere
Newbie
*
Posts: 7


« Reply #12 on: April 30, 2015, 06:46:42 PM »

Hi, I saw the email asking for my script but it is your script I am using and without any customization. Perhaps it only works with a specific version of php?
Logged
zubrag
Administrator
Hero Member
*****
Posts: 785


WWW
« Reply #13 on: May 01, 2015, 03:07:18 PM »

If it is without customization, then please send me url to check it (via email or private message). It should work with default usernames in this case.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC