How to solve "You Do Not Have Access to the Administrator Section of This Site - Error" When Trying to Login to Joomla’s Admin Account

09:52:00

I'm not an expert in Joomla, PHP & MySQL, but was able to successfully deliver 4 web development projects which were done using Jo...

I'm not an expert in Joomla, PHP & MySQL, but was able to successfully deliver 4 web development projects which were done using Joomla, PHP & MySQL. I faced many challenges as I self learned Joomla CMS and still trying to learn PHP & MySQL as well.

Usually I write random topics, "how to's" but this is the first time I'm writing a technical problem occurred in PHPMyadmin - MySQL database. The solution for this error can't be found easily. I actually contacted Godaddy to solve the error which didn't allow me to login as an administrator. Many of them would have faced this issue, as per rules any hosting company's support team will not interact or modify your files. They would only guide what you have to at your end to get rid of the problem. This is taken from the information they shared.

Scenario: I was hosting two websites in the root directory. The second website is linked as a subdomain. I was able to login the website administrator account of main domain but wasn't able to login the admin account of the subdomain. As a web administrator I was not able to login into administrator page of Joomla and saw this error: “You do not have access to the administrator section of this site”.

Those who are inexperienced (same as me) with Joomla will do one of the following when they see this error:

Check if the user is blocked in Joomla.

Reset the Joomla password of the super user, directly in the user table through phpmyadmin.

Both methods above are irrelevant in this scenario and didn't workout because this error happens after checking if the password is OK and after checking if the user is blocked. In other words, a wrong password or a blocked user will break the login process earlier and will result in a different error. I even deleted my super user account ( which is just a row in the user table ) and re created two more super user accounts, which didn't help me to login the administrator account.

Here are the steps that I followed in order to solve the problem:

Step 1: Check if the user is really an administrator: In many cases, this error happens when the person is trying to login with a user who’s not an administrator.

Checking if the user is an administrator – all you need to do is to check if the id of the user is assigned to right group in the table jos_user_usergroup_map(replace jos with your table prefix). If all is OK (the user is assigned to the right group) then we move to the next step… (If not then we fix the problem by assigning the account to administrator group)

Step 2: Check if the ACL ( Access control list ) tables are not corrupt: Compare the table with table in your computer localhost database. However, if the login problem is because of ACL corruption, then in 99% of the cases the error lies somewhere in the jos_viewlevels and/or the jos_usergroups tables. I suggest that you look at a clean Joomla database and compare the two tables of that database with those in your website’s database. If the ACL tables are corrupt, then we manually fix them (fixing these tables should only be done by an expert) – if not, then (you’ve guessed it!) we move to the next step. I was glad to see that my list is not corrupted.

Step 3: Check the jos_assets table: If all else fails, then (sadly) the problem almost certainly lies in the jos_assets table (which is, by far, the scariest table in Joomla – because a simple mistake in that table can cause a total collapse of the website). The two most common causes in the jos_assets table that might lead to this problem are:

Missing entry for the com_admin row. Wrong rules field for the com_admin row. The rules field for that row should just contain “{}”. (two curly brackets) I had this entry in the related row, so no problem with this table.

If you are seeing the “You do not have access to the administrator section of this site” error when you try to login to the backend of your Joomla website, and if you are positive that you have administrative access to the website – then unless you’re a very technical person, I suggest that you contact some Joomla experts to fix the problem for you! Step 2 and Step 3 above are rather complicated and delicate and if done incorrectly then they may break the whole website – and not just login functionality.

Lucky enough to find my problem in Step 1. My Super User accounts were not added to the jos_user_usergroup_map table. So manually I have added the User ID and Group ID( this is the ID of user access level taken from jos_usergroups table).