Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
Doulos
Life Cycles Becoming CPU Cycles



Joined: Jun 06, 2005
Posts: 732

PostPosted: Thu Sep 04, 2014 6:43 am Reply with quote

I am getting this warning in error_log when I try to add or edit a news story, and when viewing comments.
Quote:
[04-Sep-2014 08:33:23 America/New_York] PHP Warning: base64_decode() expects parameter 1 to be string, array given in /home/me/public_html/modules/News/comments.php on line 116
 
View user's profile Send private message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1772

PostPosted: Sun Sep 07, 2014 8:50 am Reply with quote

Good catch!

It seems it would be a relic from the past. The cause is a check for the rights of the admins.

php Code:
// Determine if Admin and if so what level

$admin_comments = addslashes(base64_decode($admin));
$admin_comments = explode(':', $admin_comments);
$aid = addslashes($admin_comments[0]);
$aid = substr($aid, 0, 25);
$row = $db->sql_fetchrow($db->sql_query('SELECT `title`, `admins` FROM `' . $prefix . '_modules` WHERE `title` = \'' . $module_name . '\''));
$row2 = $db->sql_fetchrow($db->sql_query('SELECT `name`, `radminsuper` FROM `' . $prefix . '_authors` WHERE `aid` = \'' . $aid . '\''));
$admins = explode(',', $row['admins']);
$auth_admin = 0;
if ($row2['radminsuper'] == 1) {
$adminsuper = 1;
$thold = -1;
} else {
$adminsuper = 0;
}
for ($i = 0;$i < sizeof($admins);$i++) {
if (is_admin($admin) && $row2['name'] == $admins[$i] && $row['admins'] != '') {
$auth_admin = 1;
$thold = -1;
}
}


Since RN25x exists a easier way and if i'm not wrong then the following lines should do the same:

php Code:
if (is_mod_admin('admin')) { # check if admin is a super-admin (access to all modules)

$adminsuper = 1;
$thold = -1;
} else {
$adminsuper = 0;
}
if (is_mod_admin($module_name)) { # check if admin is a module-admin (access only for this module)
$auth_admin = 1;
$thold = -1;
} else {
$auth_admin = 0;
}


You could try to replace and test it if all admin-options in the comments works in the same way.

Maybe a one of the RN-Team have the time to keep a eye on it.

Wink

_________________
Github: RavenNuke 
View user's profile Send private message
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1122

PostPosted: Tue Sep 09, 2014 7:37 am Reply with quote

I tested the news features again and I am not getting any error like this. I will check other things. Shocked
 
View user's profile Send private message
neralex







PostPosted: Tue Sep 09, 2014 11:14 am Reply with quote

Its only for the admin functions of the comments.php, that means the old nuke comment system not the new disqus comments. So it must be tested with activated nuke comments and then it must tried to use the admin functions in there.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©