Page 1 of 1

Admin button absent

Posted: 2021-11-21 10:20
by hubert
Hi all,

Didn't find an answer in forums ...
I just create a new ap, move it to the distant server and of course configured admin account.
But ... when logged in this alone created account ... no admin area button visible.
Quite annoying as I cannot access there ...
Any idea ?
Many thx !

Re: Admin button absent

Posted: 2021-11-21 10:32
by jsetzer
Never seen that.

Trying to narrow down:
When logged in as Admin (user in Admins group), can you enter any admin page by editing the URL in browser's address bar? What happens?

If permission denied, there is a problem with permissions for that user, not with navbar.

Re: Admin button absent

Posted: 2021-11-21 10:41
by hubert
Thx for answering jsetzer.
Seems non of the admin pages is accessible.
Trid to see groups or members picking up URL from another functionnal app and sends me back on the index page.
I confirm that the user logged is the one created at first use (defining database and user).
Never had that issue neither, AppGini is 5.98 1216

Re: Admin button absent

Posted: 2021-11-21 12:02
by hubert
Mmhh ...
I tried and installed the app on the localhost ... exactly the same issue.
Seems that AppGini's making something badly, or ?

Re: Admin button absent

Posted: 2021-11-21 13:22
by pbottcher
Hi,

just to confirm. If you say you install the app on the server/localhost, you copy the generated files to the server/localhost and then run the setup?

Re: Admin button absent

Posted: 2021-11-21 13:29
by hubert
I launched the compil in AppGini that writes the files in the htdocs/... designed directory you choose before compiling.
I really don't understand what happens there.
Tried to downgrade on AppGini 5.97, no change...

Re: Admin button absent

Posted: 2021-11-21 13:35
by jsetzer
Sorry for my silly question: when uploading to server, did you skip the following files:

config.php
setup.md5

Re: Admin button absent

Posted: 2021-11-21 17:30
by hubert
Sorry for delay ...

Both files were deleted on server.
I tried this on my laptop.
Back on my desktop, I realize that the install I made two days ago is ok with admin access (button)
I tried again from this compyter on distant server after erasing everything in the concerned directory abd resetting also database.
Still no admin button .. mystery is darker and darker !...

Re: Admin button absent

Posted: 2021-11-21 18:20
by hubert
And now ... clean install of last xampp, clean database, clean all ...
Compil .. and the issue's there !

Re: Admin button absent

Posted: 2021-11-21 18:49
by hubert
Must be something in the project ..
Took an older project and installed on the clean xampp.
Admin button's there ...
I have very short hair but on this issue maybe I'll lose all of it ...

Re: Admin button absent

Posted: 2021-11-21 19:32
by hubert
Confirmed ...
Tried an example app, only one short table, just for test, all default values but "show tech doc" on.
Admin button's there ...
So, the key is in the app ... interesting if able to isolate the issue ...

Re: Admin button absent

Posted: 2021-11-21 21:53
by peebee
I have experienced exactly the same issue. It appears to be another bug introduced with the significant changes in V5.98.

It is all to do with capitalisation of Super Admin Username.

By default, on creation Appgini converts ALL Usernames to lowercase. That is something I never quite understood and personally find just a little unneccessary and annoying, particularly when in some cases I require Users to use their actual name as "Username". Sadly, the amount of time/effort involved in changing that behaviour is considerable and ongoing so I put up with it (**Feature request - please make that function optional).

V5.98 is doing the same - stripping capitals from usernames, including the Super Admin.

I personally use my own First & Last name in the capitalised format for testing. It strips the capitals on creation. Annoying, but anyhow....

In V5.98 I noticed that on creation, the config file ISN'T stripped of the capitals - so the actual 'Super Admin in config.php is saved as:

Code: Select all

adminUsername' => "My Name"
That does not match the database Super Admin Username that is saved as "my name" (all lowercase).

This procedure now allows you login as an Admin - but removes access to the Admin area.

To resolve: change the Admin username in config.php to all lowercase (to match the database): adminUsername' => "my name". Admin button will magically reappear! Easy to test by doing just that.

Odd that you can still log in with the Capitalised Username and the Admin button is available but I haven't looked into what is causing the problem - just how to get around it.

Ahmed - any suggestions?

Re: Admin button absent

Posted: 2021-11-22 20:18
by hubert
Wouahouuu !! MAGIC !!!

Thx much peebee, I really appreciate your help as I was conviced that the forum would be the solution for help !

Please Ahmed, note that issue as an emergency to treat, it could really be annoying !
Thx also to jsetzer and pböttcher to try and find, it was like a needle in a haystack !

Re: Admin button absent

Posted: 2021-11-23 16:56
by a.gneady
Thanks for the detailed investigation @peebee. This is indeed a use case that didn't get captured in our automated tests. I'll fix it and include in tests to insure it doesn't take place again.

Re: Admin button absent

Posted: 2021-11-23 19:53
by hubert
Thx in advance Ahmed !

Re: Admin button absent

Posted: 2021-12-08 14:35
by fbrano
In versions prior 5.98 I used this modification in file /admin/incFunctions.php to enable Admin buttom for all members in grouID=2 (Admins)

search for
'admin' => ($adminConfig['adminUsername'] == $memberID ? true : false),
replace with
'admin' => ($row['groupID'] == 2 ? true : false),

search for
if($_SESSION['memberID'] == $adminConfig['adminUsername']) {
replace with
if($_SESSION['memberGroupID'] == 2) {

Any advice where and how to do it in 5.98 version?

Re: Admin button absent

Posted: 2021-12-09 04:59
by peebee
I haven't tried to make this work so I can't offer you the required code edits but after a quick browse of V5.98 files I can see those functions are now handled in:

/resources/lib/Authentication.php

I'd be searching for 'admin' => or ['adminUsername'] or similar and edit accordingly.

Please share on the forum if you do manage to get it working.

I am also aware of this blog post but I have no idea if it still applies to V5.98 (which has MANY changes) as I haven't tried it:

https://bigprof.com/blog/appgini/custom ... dmin-area/

Re: Admin button absent

Posted: 2021-12-10 07:57
by fbrano
Also I am affraid of new version 5.98 impact to table audit log workaround