Jump to content
View in the app

A better way to browse. Learn more.

Froxlor Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Customer cannot be deleted / Kundenkonto kann nicht gelöscht werden

Featured Replies

Hallo, | Hello,

mein Froxlor möchte euch diesen Fehler-Report weiterleiten. | my froxlor wants you to send this error report.

 

Dear froxlor-team,

the following error has been reported by a user:

-------------------------------------------------------------
HY000 SQLSTATE[HY000]: General error: 1396 Operation DROP USER failed for 'XXXX'@'127.0.0.1'

File: lib/Froxlor/Database/Database.php:122

Trace:
#0 lib/Froxlor/Database/Database.php(122): PDOStatement->execute(Array)
#1 lib/Froxlor/Database/Manager/DbManagerMySQL.php(203): Froxlor\Database\Database::pexecute(Object(PDOStatement), Array)
#2 lib/Froxlor/Api/Commands/Customers.php(1685): Froxlor\Database\Manager\DbManagerMySQL->deleteUser('XXXX', '127.0.0.1')
#3 admin_customers.php(155): Froxlor\Api\Commands\Customers->delete()
#4 {main}

-------------------------------------------------------------

User-Area: admin
Froxlor-version: 2.2.1
DB-version: 202408140

Database: 5.5.5-10.5.26-MariaDB-0+deb11u2End of report

 

Das Problem tritt aktuell bei allen Konten auf die ich versuche zu löschen. | The problem is currently occurring with all the accounts I am trying to delete.This Problem shows up on all customer accounts.

Falls ihr weitergehende Informationen brauch, helfe ich gerne.

 

Danke fürs Feedback, wir schauen uns das mal an und gucken ob wir das reproduzieren können

  • Author
vor 35 Minuten schrieb d00p:

Danke fürs Feedback, wir schauen uns das mal an und gucken ob wir das reproduzieren können

Gerne doch,

mir ist gerade was aufgefallen, als ich jetzt auf der SQL-Konsole mir die Benutzerliste manuell angeschaut habe:

SELECT host, user FROM mysql.user;

Dort haben praktisch alle Benutzer ein "sql1"-Anhängsel. - Kann hier vielleicht das Problem liegen? - Also der Drop dann vermutlich auf 'XXXXsql1'@'127.0.0.1' angewendet werden, oder?

 

VG

nein, ein drop wird immer auf den exakten user + alle hinterlegten mysql-access-hosts gefahren, niemals wildcard

  • Author
vor 2 Minuten schrieb d00p:

nein, ein drop wird immer auf den exakten user + alle hinterlegten mysql-access-hosts gefahren, niemals wildcard

Ah okay, gut ich warte dann auf euer Feedback.

Database: 5.5.5-10.5.26-MariaDB-0+deb11u2

Recht altes System, MySQL unterstützt "IF EXISTS" bei einem "DROP USER" erst ab 5.7, probier mal folgende Anpassung in der `lib/Froxlor/Database/Manager/DbManagerMySQL.php`:

        public function deleteUser(string $username, string $host)
        {
+               if ($this->userExistsOnHost($username, $host)) {
                       if (version_compare(Database::getAttribute(PDO::ATTR_SERVER_VERSION), '5.0.2', '<')) {
                               // Revoke privileges (only required for MySQL 4.1.2 - 5.0.1)
                               $stmt = Database::prepare("REVOKE ALL PRIVILEGES ON * . * FROM `" . $username . "`@`" . $host . "`");
                               Database::pexecute($stmt);
                       }
                       // as of MySQL 5.0.2 this also revokes privileges. (requires MySQL 4.1.2+)
                       if (version_compare(Database::getAttribute(PDO::ATTR_SERVER_VERSION), '5.7.0', '<')) {
                               $stmt = Database::prepare("DROP USER :username@:host");
                       } else {
                               $stmt = Database::prepare("DROP USER IF EXISTS :username@:host");
                       }
                       Database::pexecute($stmt, [
                               "username" => $username,
                               "host" => $host
                       ]);
+               }
	}

 

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.