OpenGamePanel / OGP-Website

GNU General Public License v2.0
127 stars 105 forks source link

SubUser / Group #614

Closed Sh4d0wless closed 11 months ago

Sh4d0wless commented 11 months ago

hello, here some problem with subusers user is hiden in group for assign here is pics for ilustration... p.s. changeing theme does nor helped...

2 1

Zorrototo commented 11 months ago

No issue on my side to add a user to a group.

Look into your error log, give relevant information about your system.

Sh4d0wless commented 11 months ago

Windows Server 2019 + XAMPP Apache 2.4.56 (Win64) OpenSSL 1.1.1t
PHP 8.0.28

php log

[16-Oct-2023 02:00:50 Asia/] PHP Fatal error:  Uncaught Error: Undefined constant "users_login" in C:\xampp\htdocs\cp\modules\user_admin\show_groups.php:116
Stack trace:
#0 C:\xampp\htdocs\cp\includes\navig.php(106): exec_ogp_module()
#1 C:\xampp\htdocs\cp\includes\navig.php(27): navigation()
#2 C:\xampp\htdocs\cp\home.php(146): include('C:\\xampp\\htdocs...')
#3 C:\xampp\htdocs\cp\home.php(405): heading()
#4 C:\xampp\htdocs\cp\home.php(77): ogpHome()
#5 {main}
  thrown in C:\xampp\htdocs\cp\modules\user_admin\show_groups.php on line 116
[16-Oct-2023 02:00:52 Asia/] PHP Fatal error:  Uncaught Error: Undefined constant "users_login" in C:\xampp\htdocs\cp\modules\user_admin\show_groups.php:116
Stack trace:
#0 C:\xampp\htdocs\cp\includes\navig.php(106): exec_ogp_module()
#1 C:\xampp\htdocs\cp\includes\navig.php(27): navigation()
#2 C:\xampp\htdocs\cp\home.php(146): include('C:\\xampp\\htdocs...')
#3 C:\xampp\htdocs\cp\home.php(405): heading()
#4 C:\xampp\htdocs\cp\home.php(77): ogpHome()
#5 {main}
  thrown in C:\xampp\htdocs\cp\modules\user_admin\show_groups.php on line 116

with some reasons i need to run PHP 8, as well cygwin has only PHP 7, i moved all htdocs files to XAMPP everthing works on panel, except this...

Sh4d0wless commented 11 months ago

Panel version: 7ada45d8c3c3565c4827f74e5f96f507971f6d86

Latest version: 7ada45d8c3c3565c4827f74e5f96f507971f6d86

Zorrototo commented 11 months ago

OK it is normal user's group and sub user issue. You can create sub user but if you try to create again the same user, PHP crash. you can create group but again, trying to create same group again crashes PHP.

[Sun Oct 15 23:29:55.328929 2023] [php:error] [pid 292106] [client bla:36006] PHP Fatal error:  Uncaught mysqli_sql_exception: Duplicate entry 'b' for key 'PRIMARY' in /var/www/bla/includes/database_mysqli.php:413\nStack trace:\n#0 /var/www/bla/includes/database_mysqli.php(413): mysqli_query()\n#1 /var/www/bla/modules/subusers/add_subuser-exec.php(87): OGPDatabaseMySQL->addUser()\n#2 /var/www/bla/includes/navig.php(106): exec_ogp_module()\n#3 /var/www/bla/includes/navig.php(27): navigation()\n#4 /var/www/bla/home.php(146): include('...')\n#5 /var/www/bla/home.php(405): heading()\n#6 /var/www/bla/home.php(77): ogpHome()\n#7 {main}\n  thrown in /var/www/bla/includes/database_mysqli.php on line 413, referer: http://bla.fr/ogp/home.php?m=subusers&p=add

[Sun Oct 15 23:30:10.770067 2023] [php:error] [pid 292106] [client bla:37180] PHP Fatal error:  Uncaught mysqli_sql_exception: Duplicate entry 'a' for key 'group_name' in /var/www/bla/includes/database_mysqli.php:513\nStack trace:\n#0 /var/www/bla/includes/database_mysqli.php(513): mysqli_query()\n#1 /var/www/bla/modules/user_admin/add_group.php(40): OGPDatabaseMySQL->addGroup()\n#2 /var/www/bla/includes/navig.php(106): exec_ogp_module()\n#3 /var/www/bla/includes/navig.php(27): navigation()\n#4 /var/www/bla/home.php(146): include('...')\n#5 /var/www/bla/home.php(405): heading()\n#6 /var/www/bla/home.php(77): ogpHome()\n#7 {main}\n  thrown in /var/www/bla/includes/database_mysqli.php on line 513, referer: http://bla.fr/ogp/home.php?m=user_admin&p=show_groups

Same issue with Admin account when trying to recreate the same group or user.

I don't have the issue shown in screenshot, my sub user and group as a normal user work as intended besides when you try to create same user or group again. PHP 8.1 Linux.

User above is using OGP on Windows and created his own web environment on PHP 8 if I understood.. By default as he pointed this is not an OGP installation as it would be on PHP 7 and probably would not have these issues, by default. But there are still PHP 8 errors globally.

own3mall commented 11 months ago

Can't reproduce @Sh4d0wless issue, but fixed @Zorrototo issue in https://github.com/OpenGamePanel/OGP-Website/pull/615