Răsfoiți Sursa

Merge branch 'master' of https://github.com/unacms/una

AntonLV 1 an în urmă
părinte
comite
38a57e6aee

+ 3 - 2
inc/classes/BxDolAI.php

@@ -63,8 +63,9 @@ class BxDolAI extends BxDolFactory implements iBxDolSingleton
      */
     public static function getInstance()
     {
-        if(!isset($GLOBALS['bxDolClasses'][__CLASS__]))
-            $GLOBALS['bxDolClasses'][__CLASS__] = new BxDolAI();
+        if (!isset($GLOBALS['bxDolClasses'][__CLASS__])) {
+            $GLOBALS['bxDolClasses'][__CLASS__] = BxDolDb::getInstance()->isTableExists('sys_agents_automators') ? new BxDolAI() : null;
+        }
 
         return $GLOBALS['bxDolClasses'][__CLASS__];
     }

+ 9 - 7
inc/classes/BxDolAlerts.php

@@ -146,13 +146,15 @@ class BxDolAlerts extends BxDol
 
         // call automators
         $oAi = BxDolAI::getInstance();
-
-        $aAutomators = $oAi->getAutomatorsEvent($this->sUnit, $this->sAction);
-        foreach($aAutomators as $aAutomator)
-            $oAi->callAutomator(BX_DOL_AI_AUTOMATOR_EVENT, [
-                'automator' => $aAutomator,
-                'alert' => $this
-            ]);
+        if ($oAi) {
+            $aAutomators = $oAi->getAutomatorsEvent($this->sUnit, $this->sAction);
+            foreach($aAutomators as $aAutomator) {
+                $oAi->callAutomator(BX_DOL_AI_AUTOMATOR_EVENT, [
+                    'automator' => $aAutomator,
+                    'alert' => $this
+                ]);
+            }
+        }
     }
 
     /**

+ 2 - 0
inc/params.inc.php

@@ -133,4 +133,6 @@ bx_check_maintenance_mode_soft();
 $o = new BxDolAlerts('system', 'begin', 0);
 $o->alert();
 
+check_logged();
+
 /** @} */

+ 0 - 2
inc/profiles.inc.php

@@ -441,6 +441,4 @@ function bx_login_form($bStudio = false, $bAjaxMode = false, $sForceRelocate = '
     exit;
 }
 
-check_logged();
-
 /** @} */

+ 1 - 1
scripts/docker-compose/Cron.Dockerfile

@@ -1,4 +1,4 @@
-FROM php:8.0-cli
+FROM php:8.1-cli
 
 RUN apt-get update && apt-get install -y \
         cron \