Notifications
Clear all

Admin lev4 problem

10 Posts
5 Users
0 Reactions
4,659 Views
(@emmekappa)
Posts: 27
Eminent Member
Topic starter
 

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)


 
Posted : 15/08/2009 11:17 am
 Elle
(@jenny)
Posts: 594
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! πŸ™‚

 
Posted : 15/08/2009 12:52 pm
(@emmekappa)
Posts: 27
Eminent Member
Topic starter
 

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


 
Posted : 15/08/2009 1:59 pm
 Elle
(@jenny)
Posts: 594
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! πŸ™‚

 
Posted : 15/08/2009 4:20 pm
(@tammy)
Posts: 2577
Member Moderator
 

Find:  (should be line 47)


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

ABOVE this add:


$panellist = array();


 
Posted : 15/08/2009 11:00 pm
(@lyndsie)
Posts: 1263
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.


 
Posted : 18/08/2009 8:08 pm
(@tammy)
Posts: 2577
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!


 
Posted : 09/01/2010 1:42 pm
 Elle
(@jenny)
Posts: 594
Honorable Member
 

That last fix works. πŸ˜€


archive: dramione.org
site: accio.nu

Available for skin/mod commission! πŸ™‚

 
Posted : 20/02/2010 4:10 pm
Jan_AQ
(@jan_aq)
Posts: 1300
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.

url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word

 
Posted : 04/10/2010 2:41 am
(@lyndsie)
Posts: 1263
Member Moderator
 

The original bug is fixed.


 
Posted : 24/02/2011 9:19 pm
Share: