Admin button absent

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
hubert
Veteran Member
Posts: 50
Joined: 2018-12-06 22:32

Admin button absent

Post by hubert » 2021-11-21 10:20

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 !

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Admin button absent

Post by jsetzer » 2021-11-21 10:32

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.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

hubert
Veteran Member
Posts: 50
Joined: 2018-12-06 22:32

Re: Admin button absent

Post by hubert » 2021-11-21 10:41

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

hubert
Veteran Member
Posts: 50
Joined: 2018-12-06 22:32

Re: Admin button absent

Post by hubert » 2021-11-21 12:02

Mmhh ...
I tried and installed the app on the localhost ... exactly the same issue.
Seems that AppGini's making something badly, or ?

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Admin button absent

Post by pbottcher » 2021-11-21 13:22

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?
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

hubert
Veteran Member
Posts: 50
Joined: 2018-12-06 22:32

Re: Admin button absent

Post by hubert » 2021-11-21 13:29

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...

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Admin button absent

Post by jsetzer » 2021-11-21 13:35

Sorry for my silly question: when uploading to server, did you skip the following files:

config.php
setup.md5
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

hubert
Veteran Member
Posts: 50
Joined: 2018-12-06 22:32

Re: Admin button absent

Post by hubert » 2021-11-21 17:30

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 !...

hubert
Veteran Member
Posts: 50
Joined: 2018-12-06 22:32

Re: Admin button absent

Post by hubert » 2021-11-21 18:20

And now ... clean install of last xampp, clean database, clean all ...
Compil .. and the issue's there !

hubert
Veteran Member
Posts: 50
Joined: 2018-12-06 22:32

Re: Admin button absent

Post by hubert » 2021-11-21 18:49

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 ...

hubert
Veteran Member
Posts: 50
Joined: 2018-12-06 22:32

Re: Admin button absent

Post by hubert » 2021-11-21 19:32

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 ...

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 352
Joined: 2013-03-21 04:37

Re: Admin button absent

Post by peebee » 2021-11-21 21:53

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?

hubert
Veteran Member
Posts: 50
Joined: 2018-12-06 22:32

Re: Admin button absent

Post by hubert » 2021-11-22 20:18

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 !

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Admin button absent

Post by a.gneady » 2021-11-23 16:56

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.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

hubert
Veteran Member
Posts: 50
Joined: 2018-12-06 22:32

Re: Admin button absent

Post by hubert » 2021-11-23 19:53

Thx in advance Ahmed !

User avatar
fbrano
Veteran Member
Posts: 70
Joined: 2018-03-19 10:39
Location: Slovakia
Contact:

Re: Admin button absent

Post by fbrano » 2021-12-08 14:35

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?
ver 23.15 1484

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 352
Joined: 2013-03-21 04:37

Re: Admin button absent

Post by peebee » 2021-12-09 04:59

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/

User avatar
fbrano
Veteran Member
Posts: 70
Joined: 2018-03-19 10:39
Location: Slovakia
Contact:

Re: Admin button absent

Post by fbrano » 2021-12-10 07:57

Also I am affraid of new version 5.98 impact to table audit log workaround
ver 23.15 1484

Post Reply