MyBB Hacks

Full Version: There is a case, when XThreads remove admin permissions during installation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi!

First of all - thanks for excellent plugin! Great

Come back to the subject.

I found this on my test environment, which I create by copying of my production environment (MyBB 1.6.8).

In my database, for some reasons, field mybb_adminoptions.permissions are empty for Administrators group members (except user with uid=0). MyBB are happy with that and use inheritance from group permissions.

During installation XThreads do unserialisation from mybb_adminoptions.permissions, add permission to manage additional fields and serialize back.

As result - all admins with uid>0 lost any Administrator permissions except permission to manage additional fields.

Why this field are empty ? Probably because my forum starts with phpbb (very old and very customized version), then, some years ago, it was semi-manually migrated to MyBB 1.4.х, then it was upgraded to MyBB 1.6.x. All admins are admins already from phpbb's times.

I'll suggest to add some check for mybb_adminoptions.permissions content in installation procedure. Or remove automated permission addition at all and leave related message in readme to add this permission manually.

thanks again.
Interesting observation.  Thanks for reporting.

I've made the following modification in inc/xthreads/xt_install.php
for all instances of

PHP Code:
$perms = unserialize($adminopt['permissions']);

replace with

PHP Code:
$perms = @unserialize($adminopt['permissions']);
if(empty($perms)) continue;

Great. thanks.
Reference URL's