]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/commitdiff
Warn about SQL_DEFAULT_USER being set in config.php.
authorBram Matthys <redacted>
Wed, 15 Mar 2023 07:54:07 +0000 (08:54 +0100)
committerBram Matthys <redacted>
Wed, 15 Mar 2023 07:56:09 +0000 (08:56 +0100)
This is a plaintext user/password that is set in the config that is only
meant for during installation of the SQL plugin. It should be removed
directly after you are logged in for the first time.

plugins/sql_auth/sql_auth.php

index ececaec3b2561dcf67b2dab97a15f1bf119bd12e..a78a9d0c7c850a80c6fdd9090d9cdfb8b9dd24f4 100644 (file)
@@ -24,6 +24,7 @@ class sql_auth
                Hook::func(HOOKTYPE_GET_USER_LIST, 'sql_auth::get_user_list');
                Hook::func(HOOKTYPE_USER_DELETE, 'sql_auth::user_delete');
                Hook::func(HOOKTYPE_EDIT_USER, 'sql_auth::edit_core');
+               Hook::func(HOOKTYPE_PRE_OVERVIEW_CARD, 'sql_auth::add_pre_overview_card');
 
                if (defined('SQL_DEFAULT_USER')) // we've got a default account
                {
@@ -54,6 +55,12 @@ class sql_auth
                }
        }
 
+       public static function add_pre_overview_card($empty)
+       {
+               if (defined('SQL_DEFAULT_USER'))
+                       Message::Fail("Warning: SQL_DEFAULT_USER is set in config.php. You should remove that item now, as it is only used during installation.");
+       }
+
        /* pre-Header hook */
        public static function session_start($n)
        {