Clicking on the Admin Area button logs me out!

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
dannybridi
Veteran Member
Posts: 54
Joined: 2016-03-21 19:33

Clicking on the Admin Area button logs me out!

Post by dannybridi » 2020-01-23 09:52

Hello,

I had not accessed the site in a while, but yesterday I logged in (as admin) and then clicked on the "Admin Area" button (to do some user/group management), but instead of taking me to the admin area, I was logged out! I tried re-generating the code, but that didn't help. I was using version 5.76, but I upgraded to 5.81, but that didn't help either.

Any ideas?

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Clicking on the Admin Area button logs me out!

Post by onoehring » 2020-01-24 08:26

Hi,

did you disable cookies? Did you clear your cache first? Did you try another browser?
Olaf

dannybridi
Veteran Member
Posts: 54
Joined: 2016-03-21 19:33

Re: Clicking on the Admin Area button logs me out!

Post by dannybridi » 2020-01-24 08:43

Hi,

Thanks for your reply. Yes, I have tried all of the above. I also tried different machines and OS's (Windows, MacOS, iPad). They all show the same behavior.

Thanks

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Clicking on the Admin Area button logs me out!

Post by onoehring » 2020-01-24 09:08

Hi,

if I remember correctly a few days (3-4 weeks?) ago someone asked a similar question where Jan (pbötcher?) was able to give the correct hint. If I remember correctly something changed in password handling since version .??..
You may try:
a) Please check your database (phpmyadmin or similar) and see, if the users are NOT banned.
b) Maybe create a new entry in the users table yourself and make sure, that user is in the admin group. You can simply generate a password and hash it with MD5 ( http://onlinemd5.com ). Insert the MD5 into the password column of that new user. Now you should be able to login and correct the other users passwords/login data.

Olaf

dannybridi
Veteran Member
Posts: 54
Joined: 2016-03-21 19:33

Re: Clicking on the Admin Area button logs me out!

Post by dannybridi » 2020-01-24 15:16

Thanks Olaf.
a) I checked and the users are not banned.
b) If I create a user and set the password as you suggest, where do I tell the application to use that user instead (which AppGini file)?
Thanks

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

Re: Clicking on the Admin Area button logs me out!

Post by jsetzer » 2020-01-24 15:20

Instead of creating new users, you can try to use the password reset function. If I remember right, someone else here in the forum had similar problems and solved it that way.
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

dannybridi
Veteran Member
Posts: 54
Joined: 2016-03-21 19:33

Re: Clicking on the Admin Area button logs me out!

Post by dannybridi » 2020-01-24 15:33

You mean at the sign in page, select "Forgot your password"?

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

Re: Clicking on the Admin Area button logs me out!

Post by jsetzer » 2020-01-24 17:04

Yes, or in members management in Admin area. I don't remember how he finally solved it.
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

dannybridi
Veteran Member
Posts: 54
Joined: 2016-03-21 19:33

Re: Clicking on the Admin Area button logs me out!

Post by dannybridi » 2020-01-24 18:40

It looks like "Forgot your password" does not work for the admin account, and I cannot go into the admin area (the reason for this post) to change the password there (catch 22 situation)...

As suggested above, what if I change the password (MD5 hash) of the admin account in the membership_users table directly? I just want to be sure this is what I need to do... :shock:

dannybridi
Veteran Member
Posts: 54
Joined: 2016-03-21 19:33

Re: Clicking on the Admin Area button logs me out!

Post by dannybridi » 2020-01-24 21:51

I thought if I copied the hash of the admin account from the table into the config.php, it would help, but it made no difference. I still could login to the application, but as soon as I click on the admin area button I get logged out.
When are the credentials in the config.php file used?

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

Re: Clicking on the Admin Area button logs me out!

Post by pbottcher » 2020-01-25 10:22

Hi,

did you reload all files after the upgrade to 5.81? Can you trace the $_SESSION['memberID'] for the user that clicks on the ADMIN AREA button and verify that this user matches the admin user in the config.php.
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.

dannybridi
Veteran Member
Posts: 54
Joined: 2016-03-21 19:33

Re: Clicking on the Admin Area button logs me out!

Post by dannybridi » 2020-01-25 18:13

Yes, I did reload all the files after the upgrade.
I unfortunately do not know how to trace the $_SESSION[‘memberID’]. How do I do it?
Thanks

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Clicking on the Admin Area button logs me out!

Post by onoehring » 2020-01-26 18:04

Hi dannybridi,

just write

Code: Select all

echo $_SESSION[‘memberID’];
die();
into your code where you want to see it's value. Should probably work.

Olaf

dannybridi
Veteran Member
Posts: 54
Joined: 2016-03-21 19:33

Re: Clicking on the Admin Area button logs me out!

Post by dannybridi » 2020-01-27 09:27

Thanks Olaf, but where do I put this code?

dannybridi
Veteran Member
Posts: 54
Joined: 2016-03-21 19:33

Re: Clicking on the Admin Area button logs me out!

Post by dannybridi » 2020-01-27 09:32

I checked the hash in the config.php file for the admin account. It was different (and much smaller in length) than the one in the membership_users table. So I copied that hash to the table. I was able to login (as before), but when I looked at the table again, the hash in the table changed back to the same hash that was in there before (it does not look like MD5). I'm confused. In any case, I still cannot access the admin area :-(

dannybridi
Veteran Member
Posts: 54
Joined: 2016-03-21 19:33

Re: Clicking on the Admin Area button logs me out!

Post by dannybridi » 2020-01-27 11:46

I manually changed the password for the admin account (in the membership_users table), and was able to login, but still the admin area button logs me out!

dannybridi
Veteran Member
Posts: 54
Joined: 2016-03-21 19:33

Re: Clicking on the Admin Area button logs me out!

Post by dannybridi » 2020-01-27 12:14

... forgot to mention that I also changed the hash in the config.php file accordingly.

dannybridi
Veteran Member
Posts: 54
Joined: 2016-03-21 19:33

Re: Clicking on the Admin Area button logs me out!

Post by dannybridi » 2020-01-27 12:30

I also tried to give another user admin rights by changing the groupID field in the membership_users table from 3 to 2, but all that changed was that now that user got access to all the tables, but not the Admin Area button. Anyone know how to manually make a user full admin?

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

Re: Clicking on the Admin Area button logs me out!

Post by jsetzer » 2020-01-27 12:52

Did you already send a support request to BigProf? I think you should do. To me it seems there are more developers than just you having that problem. So this may be of common interest for others, who need to upgrade to 5.8x.

Jan
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

dannybridi
Veteran Member
Posts: 54
Joined: 2016-03-21 19:33

Re: Clicking on the Admin Area button logs me out!

Post by dannybridi » 2020-01-27 12:58

No I didn't, but I will now.
Thanks

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Clicking on the Admin Area button logs me out!

Post by onoehring » 2020-01-27 13:08

Hi,

make a user (super)admin:
Check table membership_groups and see which groupID the ADMIN group has (probably 2).
Open table membership_users and edit the user you want to make admin: Set his/her groupID to that of the ADMIN group.
Done.
And to be sure, also set isBanned to 0 and isApproved to 1.

Olaf

dannybridi
Veteran Member
Posts: 54
Joined: 2016-03-21 19:33

Re: Clicking on the Admin Area button logs me out!

Post by dannybridi » 2020-01-28 09:13

Olaf,
I have already tried that approach (as mentioned above), but although the user becomes admin (by changing the groupID), he does not get the "Admin Area" button! He gets to see all the tables, but not that button. It seems like only the "admin" user gets it.
Thanks

User avatar
onoehring
AppGini Super Hero
AppGini Super Hero
Posts: 1156
Joined: 2019-05-21 22:42
Location: Germany
Contact:

Re: Clicking on the Admin Area button logs me out!

Post by onoehring » 2020-01-28 10:17

Hi,

isn't this normal ... only the big superadmin gets that button... (not sure, maybe someone else can tell)?

Olaf

dannybridi
Veteran Member
Posts: 54
Joined: 2016-03-21 19:33

Re: Clicking on the Admin Area button logs me out!

Post by dannybridi » 2020-01-29 16:02

The issue seems to be resolved now, but I don't really know why or what caused it.
I emptied the folder of the application on the server and uploaded a fresh regenerated copy. I can now access the Admin Area again. I tried this approach before, but the difference was that I did not first delete the target location, I overwrote the files. Nevertheless, the issue is confusing. I'm glad it now works though.
Thank you all for your help.

Post Reply