]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - plugins/sql_auth/sql_auth.php
Rather large update, please see commit notes
[irc/unrealircd/unrealircd-webpanel.git] / plugins / sql_auth / sql_auth.php
index 5822fda11376afbcfc8c9628bf2e2368fe928682..fdfeb566177842bc191ced91037807faf4cd6a26 100644 (file)
@@ -17,6 +17,7 @@ class sql_auth
                Hook::func(HOOKTYPE_NAVBAR, 'sql_auth::add_navbar');
                Hook::func(HOOKTYPE_PRE_HEADER, 'sql_auth::session_start');
                Hook::func(HOOKTYPE_OVERVIEW_CARD, 'sql_auth::add_overview_card');
+               Hook::func(HOOKTYPE_FOOTER, 'sql_auth::add_footer_info');
 
                if (defined('SQL_DEFAULT_USER')) // we've got a default account
                {
@@ -43,6 +44,16 @@ class sql_auth
                }
        }
 
+       public static function add_footer_info($empty)
+       {
+               if (!($user = unreal_get_current_user()))
+                       return;
+
+               else {
+                       echo "<code>Admin Panel v" . WEBPANEL_VERSION . "</code>";
+               }
+       }
+
        public static function session_start($n)
        {
                do_log($_SESSION);
@@ -102,6 +113,12 @@ class sql_auth
                        setting_value VARCHAR(255),
                        PRIMARY KEY (id)
                )");
+               $conn->query("CREATE TABLE IF NOT EXISTS " . SQL_PREFIX . "fail2ban (
+                       id int AUTO_INCREMENT NOT NULL,
+                       ip VARCHAR(255) NOT NULL,
+                       count VARCHAR(255),
+                       PRIMARY KEY (id)
+               )");
                new AuthSettings();
        }
 
@@ -205,4 +222,6 @@ function dnsbl_check($ip)
 }
 
 function fail2ban_check($ip)
-{}
\ No newline at end of file
+{
+
+}
\ No newline at end of file