Marius Cramer
2014-07-24 51569edba0f9598e08c7975490f9ca8254017425
Fixed: db user not created in mysql user table if password is stored in cleartext (ISPConfig < 3.0.3.3)
Fixed: db user not created on update if status not changed (e. g. on using resync tool)
1 files modified
11 ■■■■ changed files
server/plugins-available/mysql_clientdb_plugin.inc.php 11 ●●●● patch | view | raw | blame | history
server/plugins-available/mysql_clientdb_plugin.inc.php
@@ -83,7 +83,14 @@
        if(!is_array($host_list)) $host_list = explode(',', $host_list);
        $success = true;
        if(!preg_match('/\*[A-F0-9]{40}$/', $database_password)) {
                $result = $link->query("SELECT PASSWORD('" . $link->escape_string($database_password) . "') as `crypted`");
                if($result) {
                        $row = $result->fetch_assoc();
                        $database_password = $row['crypted'];
                        $result->free();
                }
        }
        // loop through hostlist
        foreach($host_list as $db_host) {
            $db_host = trim($db_host);
@@ -270,7 +277,7 @@
            $old_host_list .= 'localhost';
            // Create the database user if database was disabled before
            if($data['new']['active'] == 'y' && $data['old']['active'] == 'n') {
            if($data['new']['active'] == 'y') {
                if($db_user) {
                    if($db_user['database_user'] == 'root') $app->log('User root not allowed for Client databases', LOGLEVEL_WARNING);
                    else $this->process_host_list('GRANT', $data['new']['database_name'], $db_user['database_user'], $db_user['database_password'], $host_list, $link);