]> 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 b0aa0038ca8da174cf7b2312ef611fd0c3119b6e..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);
@@ -65,6 +76,8 @@ class sql_auth
                                header("Location: ".BASE_URL."plugins/sql_auth/login.php");
                                die();
                        }
+                       // you'll be automatically logged out after one hour of inactivity
+                       session_set_cookie_params(3600);
                        session_start();
                }
        }
@@ -100,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();
        }
 
@@ -203,4 +222,6 @@ function dnsbl_check($ip)
 }
 
 function fail2ban_check($ip)
-{}
\ No newline at end of file
+{
+
+}
\ No newline at end of file