Added hook for session handling, fixed bug [0000315]
[fa-stable.git] / includes / hooks.inc
index c279b4afc4371ded9621aa6548884168a729d8bc..d89c1d3e677c3e30fe7b8f5ad8beffa497ef81a8 100644 (file)
@@ -367,3 +367,17 @@ function hook_price_in_words($amount, $document)
 {
        return hook_invoke_last('price_in_words', $amount, $document);
 }
+//
+//     Session handling hook. This is special case of hook class which have to be run before session is started.
+//     If fa_session_manager class is defined in any installed extension, this class provides session handling
+//     for application, otherwise standard php session handling is used.
+//
+function hook_session_start($company)
+{
+       if (class_exists('fa_session_manager')) {
+               global $SessionManager;
+               $SessionManager = new fa_session_manager($company);
+               return $SessionManager->installed;
+       }
+       return false;
+}