URL to your eFiction: http://www.fanworld.it/EF/
test account: test
pwd: test123
Version of eFiction: 3.5.1 (english)
Have you bridged eFiction, if so with what?: No
Version of PHP: 5.2.10
Version of MySQL: 5.0
Have you searched for your problem: Yes
If so, what terms did you try: Warning: Invalid argument supplied for foreach() in admin.php on line 51
State the nature of your problem: OK. We were testing efiction. One of us turned off the submissions, then we made an author level 4 admin. He clicked on "admin" in the main menu and received this warning:
Warning: Invalid argument supplied for foreach() in /web/htdocs/www.fanworld.it/home/EF/admin.php on line 51
Still, he was able to see how many stories there were in queue. (There are %d chapters waiting to be validated. => this)
A level four admin is just an approved author, really, I think, with perks such as edit/delete. I'm not really sure about it, myself, but they don't get any special admin page.
foreach($panellist as $accesslevel => $row) {
$output .= implode(" | ", $row)."<br />";
}
... is causing the problem. The way the admin nav is set out is that each row is for the admin levels... so a level 1 will see everything, level 2 will see the first rows minus the last one etc. Level 4 doesn't have any row for itself -- I think that's the issue.
archive: dramione.org
site: accio.nu
Available for skin/mod commission! 🙂
So, the "bug" is the Admin link showing for Lev4 admins... could it be possible to hide it for them?
*mumble*
I guess if you don't plan on giving them any special powers at all:
Line 40 is:
if(!isADMIN) accessDenied( );
Change to:
if(!isADMIN || uLEVEL == 4) accessDenied( );
archive: dramione.org
site: accio.nu
Available for skin/mod commission! 🙂
Find: (should be line 47)
while($panel = dbassoc($panelquery)) {
ABOVE this add:
$panellist = array();
Okay, I did both of those suggestions and it now output "you are not authorized to access that function" instead of MySQL errors. But the "Admin" link still appears. Is there a way to change this so that it doesn't? Page Links only breaks it down to Admins or Members.
The only way to do it would be a MOD on the includes/pagesetup.php file.
Go to line 80:
if($link['link_access'] == 2 && uLEVEL < 1) continue;
And change it to:
if($link['link_access'] == 2 && (uLEVEL == 0 || uLEVEL == 4)) continue;
This is not tested!
That last fix works. 😀
archive: dramione.org
site: accio.nu
Available for skin/mod commission! 🙂
Someone please update as to whether or not this has been fixed (newest SVN files) by testing on their archive. Thank you!
Whoever said nothing is impossible never tried slamming a revolving door.
The original bug is fixed.