Forum

Notifications
Clear all

Admin lev4 problem

emmekappa
(@emmekappa)
Eminent Member

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)

Quote
Topic starter Posted : 15/08/2009 6:17 pm
Elle
 Elle
(@jenny)
Honorable Member

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! 🙂

ReplyQuote
Posted : 15/08/2009 7:52 pm
emmekappa
(@emmekappa)
Eminent Member

So, the "bug" is the Admin link showing for Lev4 admins... could it be possible to hide it for them?
*mumble*

ReplyQuote
Topic starter Posted : 15/08/2009 8:59 pm
Elle
 Elle
(@jenny)
Honorable Member

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! 🙂

ReplyQuote
Posted : 15/08/2009 11:20 pm
Tammy
(@tammy)
Member Moderator

Find:  (should be line 47)


while($panel = dbassoc($panelquery)) {

ABOVE this add:


$panellist = array();

ReplyQuote
Posted : 16/08/2009 6:00 am
Lyndsie
(@lyndsie)
Member Moderator

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.

ReplyQuote
Posted : 19/08/2009 3:08 am
Tammy
(@tammy)
Member Moderator

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!

ReplyQuote
Posted : 09/01/2010 7:42 pm
Elle
 Elle
(@jenny)
Honorable Member

That last fix works. 😀

archive: dramione.org
site: accio.nu

Available for skin/mod commission! 🙂

ReplyQuote
Posted : 20/02/2010 10:10 pm
Jan_AQ
(@jan_aq)
Noble Member

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.

ReplyQuote
Posted : 04/10/2010 9:41 am
Lyndsie
(@lyndsie)
Member Moderator

The original bug is fixed.

ReplyQuote
Posted : 25/02/2011 3:19 am
Share: