MyBB Community Forums

Full Version: Invalid AdminCP login warning 1.8.37 PHP 8.2
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
admin/index.php
If a user attempts to login to AdminCP without permissions, a warning is generated.
$login_message and error condition is not defined.

<error>
	<dateline>1705314831</dateline>
	<datetime>2024-01-15 10:33:51 UTC -0700</datetime>
	<script>admin/index.php</script>
	<line>619</line>
	<type>2</type>
	<friendly_type>Warning</friendly_type>
	<message>Undefined variable $login_message</message>
	<back_trace>#0  errorHandler->error() called at [/inc/class_error.php:153]
#1  errorHandler->error_callback() called at [/admin/index.php:619]
</back_trace>
</error>

Find beginning line 538
	my_unsetcookie('adminsid');
}
and replace with
	my_unsetcookie('adminsid');
	if($mybb->get_input('do') == 'login')
	{
		$login_message = $lang->error_mybb_not_admin_account;
	}
}

Then add language string in inc/languages/english/admin/global.lang.php after line 54.
$l['error_mybb_not_admin_account'] = "Username is not an administrator.";

Thank you Laird for helping me track this one down.
Hi,

Thank you for your report. We have pushed this issue to our Github repository for further analysis where you can track our commits and progress with fixing this bug. Discussions regarding this bug may also take place there too.

Follow this link to visit the issue on Github: https://github.com/mybb/mybb/issues/4783

Thanks for contributing to MyBB!

Regards,
The MyBB Group