You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: interface/lib/classes/aps_guicontroller.inc.php
+13-3Lines changed: 13 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -253,16 +253,26 @@ public function createPackageInstance($settings, $packageid)
253
253
//* Find a free db name for the app
254
254
for($n = 1; $n <= 1000; $n++) {
255
255
$mysql_db_name = $dbname_prefix.'aps'.$n;
256
+
$tmp = $app->db->queryOneRecord("SELECT count(database_id) as number FROM web_database WHERE database_name = '".$app->db->quote($mysql_db_name)."'");
257
+
if($tmp['number'] == 0) break;
258
+
}
259
+
//* Find a free db username for the app
260
+
for($n = 1; $n <= 1000; $n++) {
256
261
$mysql_db_user = $dbuser_prefix.'aps'.$n;
257
-
$tmp = $app->db->queryOneRecord("SELECT count(database_id) as number FROM web_database WHERE database_name = '".$app->db->quote($mysql_db_user)."' OR database_user = '".$app->db->quote($mysql_db_name)."'");
262
+
$tmp = $app->db->queryOneRecord("SELECT count(database_user_id) as number FROM web_database_user WHERE database_user = '".$app->db->quote($mysql_db_user)."'");
0 commit comments