ona icon indicating copy to clipboard operation
ona copied to clipboard

Admin user has no rights

Open dmgeurts opened this issue 5 years ago • 4 comments
trafficstars

After modifying installcli.php in the way it creates the ona_sys mysql account I managed to complete the installation. However when logging in the admin user has no more rights than the guest user has.

I've checked the data import into the database and that completed successfully.

Some debug logs:

Jan 8 22:14:17 unifipi [email protected]: [DEFAULT] DEBUG => db_get_record($dbh, $where, groups, ) called
Jan 8 22:14:17 unifipi [email protected]: [DEFAULT] ERROR => SQL query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups WHERE name = ''' at line 1
Jan 8 22:14:17 unifipi [email protected]: [DEFAULT] DEBUG => db_get_records($dbh, $where, permission_assignments, , -1, -1) called
Jan 8 22:14:17 unifipi [email protected]: [DEFAULT] INFO => Loaded permissions for admin
Jan 8 22:14:17 unifipi [email protected]: [DEFAULT] INFO => [Standalone] admin has logged in via authtype: local
...
Jan 8 22:14:23 unifipi [email protected]: [DEFAULT] DEBUG => db_update_record($dbh, sessions, $where, $insert) called
Jan 8 22:14:23 unifipi [email protected]: [DEFAULT] DEBUG => webwin_submit() Window: edit_subnet Function: editor Form:  
Jan 8 22:14:23 unifipi [email protected]: [DEFAULT] DEBUG => auth() User[admin] does not have the subnet_modify permission

dmgeurts avatar Jan 08 '20 22:01 dmgeurts

hmm this one is odd.. if it got as far as it did, it should have the proper access defined. seems the error there does not have the name variable passing through for some reason.

I'll try and catch up to where you are.. I've not yet tried ONA on Ubuntu 19.10 (yea, sad)..

You might try dropping the database entirely and trying from the beginning with your updates to the cli installer.

mattpascoe avatar Jan 09 '20 03:01 mattpascoe

So.. I found the problem here.. apparently mysql 8 no longer likes my table named 'groups'.. I think it is now a reserved word. So I have updated the appropriate things to fix that.. but now have found another issue. I'll check in my fixes for this bug and open another one related to the new issue.

mattpascoe avatar Jan 13 '20 02:01 mattpascoe

Dev code works, except for:

  1. MySQL user isn't created (temporary fix, create the account either before or after installing.
  2. Default domain isn't set (due to known ctime error)

dmgeurts avatar Jan 13 '20 19:01 dmgeurts

FYI

I've just switched from the master branch (fresh install from yesterday) to the develop branch (today).

Once done, and after re-running the installer, I've noticed that the version warning was still there (update not completely performed) and, worse, that Admin, no longer had any permissions.

The cure was to run this query

INSERT INTO auth_groups VALUES (17,'Default','Default user group',1),(18,'Admin','Admin group',99);

I guess that the updates forget or fail to do it properly..

Then RE run the installer step.

It seems to work fine from now

HTH somemone

soif avatar Nov 27 '20 10:11 soif

These issues should now be resolved in the latest v19.0.0 release.

mattpascoe avatar Jun 01 '23 03:06 mattpascoe