+//
+// 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;
+}
+//
+// Third party authentication modules.
+// Returns true after successfull authentication, false otherwise, null if no login hook is defined.
+//
+function hook_authenticate($login, $password)
+{
+ return hook_invoke_last('authenticate', $login, $password);
+}