Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin Panel -> Traffic -> Customers: Table is using wrong ids for links #1236

Closed
showp1984 opened this issue Feb 4, 2024 · 1 comment
Closed
Assignees
Labels
Milestone

Comments

@showp1984
Copy link

showp1984 commented Feb 4, 2024

Describe the bug
If I go to Traffic -> Customers and select the first customer by the link on their name I get an empty page.
URL: https://froxlor/admin_customers.php?page=customers&action=su&id=0

But if I select any other customer I jump into the customer panel dashboard of another customer. (the "impersonate" feature, but for the wrong customer - not the one I clicked on.)
eg: https://froxlor/admin_customers.php?page=customers&action=su&id=1

I found out that this is happening because there is no user with id 0 in my database. It seems to be a bug in the table, as it's simply enumerated from 0-n, instead of using the actual user's id. The same user having the link with id=0 above actually has id=7 in the database and in the link under Resources -> Customers, where the link works fine:
https://froxlor/admin_customers.php?page=customers&action=su&sort=customerName&id=7
Same for the mismatched customer links. The ids are just ascending numbers no matter the name of the customer (as it seems).

mysql> select customerid from panel_customers;
+------------+
| customerid |
+------------+
|          1 |
|          2 |
|          3 |
|          5 |
|          6 |
|          7 |
+------------+

If I manually edit the link to:
https://froxlor/admin_customers.php?page=customers&action=su&id=7
the link works as expected. So this seems to be a bug in the table, right?

Version:
System information

  • Froxlor version: 2.1.6-1
  • Froxlor database version: 202312120
  • Web server: apache2
  • DNS server: Bind
  • POP/IMAP server: Dovecot
  • SMTP server: postfix
  • FTP server: proftpd
  • OS/Version:
    ** Distributor ID: Ubuntu
    ** Description: Ubuntu 22.04.3 LTS
    ** Release: 22.04
    ** Codename: jammy
    ** Kernel: Linux host 5.15.0-92-generic '#'102-Ubuntu SMP Wed Jan 10 09:33:48 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

To Reproduce
(The steps in the description should be sufficient, but I imagine this would also work on a fresh install of froxlor, as far as I understand the issue now)
Steps to reproduce the behavior:

  1. create a customer aone
  2. create another customer bone
  3. delete customer aone.
  4. go to: Traffic -> Customers
  5. Click on 'bone' in the traffic table
  6. You should see an empty page (the id of the customer isn't found in the database anymore)

Expected behavior
Impersonate the clicked on customer, not another, nor show an empty page.

Logfiles
n/a

Additional context
Server was upgraded from ubuntu 18.04 to 20.04 to 22.04. Froxlor was uninstalled on 20.04 as it blocked the upgrade and reinstalled afterwards on 22.04.
I couldn't test the issue on a new install yet.

@d00p d00p self-assigned this Feb 4, 2024
@d00p d00p added the bug label Feb 4, 2024
@d00p d00p added this to the 2.1.x milestone Feb 4, 2024
@d00p
Copy link
Member

d00p commented Feb 4, 2024

Yea, found already, this originates from bc1892d - the sorting does not keep the Array-Index values. Fix will follow shortly

@d00p d00p closed this as completed in 4e23b96 Feb 4, 2024
d00p added a commit that referenced this issue Feb 4, 2024
…overview which leads to incorrect customer-links due to wrong indexing in the array; fixes #1236

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

2 participants