]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/commitdiff
Add sql::table_prefix to first setup screen
authorBram Matthys <redacted>
Fri, 21 Apr 2023 10:22:37 +0000 (12:22 +0200)
committerBram Matthys <redacted>
Fri, 21 Apr 2023 10:22:37 +0000 (12:22 +0200)
plugins/sql_auth/setup.php
plugins/sql_auth/sql_auth.php
settings/install.php

index ccd4619923e47c75ee98bfc9d60a26d6d55ccf72..1ac313b5ea141006b40dcdb0baa20e797562c542 100644 (file)
@@ -124,7 +124,7 @@ elseif (isset($_POST['createbtn']))
        $error_messages = "";
        foreach($tables as $table)
        {
-               $prefix = get_config("sql::prefix");
+               $prefix = get_config("sql::table_prefix");
                $sql = "SHOW TABLES LIKE '$prefix%'"; // SQL query to check if table exists
 
                $result = $conn->query($sql);
index cf8d71c06ec22d06389b17e9e71eb3ea60fe80d2..58bc12ea0e55a5b449f51bc278ed8914e70e9a8f 100644 (file)
@@ -140,7 +140,7 @@ class sql_auth
                $error_messages = "";
                foreach($tables as $table)
                {
-                       $prefix = get_config("sql::prefix");
+                       $prefix = get_config("sql::table_prefix");
                        $sql = "SHOW TABLES LIKE '$prefix%'"; // SQL query to check if table exists
 
                        $result = $conn->query($sql);
index c98e2f566874e62df413d1739adbcd31aad48a4b..ba8ba1c88c4a1f6abb4f7fbdc3f63f2a67e1b87d 100644 (file)
@@ -109,6 +109,7 @@ $writable = (is_writable("../config/")) ? true: false;
                                "database" => $opts->sql_db,
                                "username" => $opts->sql_user,
                                "password" => $opts->sql_password,
+                               "table_prefix" => $opts->sql_table_prefix,
                                ];
                }
 
@@ -209,6 +210,11 @@ $writable = (is_writable("../config/")) ? true: false;
                        <label for="sql_password">Password</label>
                        <input name="sql_password" type="password" class="revalidation-needed-sql form-control" id="sql_password">
                </div>
+               <div class="form-group">
+                       <label for="sql_table_prefix">Table prefix</label>
+                       <input name="sql_table_prefix" type="text" class="revalidation-needed-sql form-control" id="sql_table_prefix" aria-describedby="sql_table_prefix_help" value="unreal_">
+                       <small id="sql_table_prefix_help" class="form-text text-muted">The prefix for table names (leave blank for none)</small>
+               </div>
        </div>
        <div class="text-center">
                <div id="page3_next" class="btn btn-primary ml-3">Next</div>