diff --git a/core/ajax/scenario.ajax.php b/core/ajax/scenario.ajax.php index e41f10a2ef..b842306585 100644 --- a/core/ajax/scenario.ajax.php +++ b/core/ajax/scenario.ajax.php @@ -40,6 +40,7 @@ throw new Exception(__('Impossible de lancer le scénario car il est désactivé. Veuillez l\'activer', __FILE__)); } $scenario->addTag('trigger','user'); + $scenario->addTag('trigger_value',$_SESSION['user']->getLogin()); $scenario->addTag('message',$GLOBALS['JEEDOM_SCLOG_TEXT']['startManual']['txt']); $scenario->launch(0); break; diff --git a/core/class/scenario.class.php b/core/class/scenario.class.php index 8c9f248824..eba62cf81c 100644 --- a/core/class/scenario.class.php +++ b/core/class/scenario.class.php @@ -870,7 +870,6 @@ public function launch($_forceSyncMode = false) { return false; } $this->setCache(array('startingTime' => strtotime('now'), 'state' => 'starting')); - $this->setCache('lastExecutionUser', (isset($_SESSION) && isset($_SESSION['user']) && $_SESSION['user'] != null) ? $_SESSION['user']->getLogin() : 'none'); if ($this->getConfiguration('syncmode') == 1 || $_forceSyncMode) { $this->setLog($GLOBALS['JEEDOM_SCLOG_TEXT']['launchScenarioSync']['txt']); return $this->execute(); @@ -939,7 +938,6 @@ public function execute($instance_id = '') { $timeline->setOptions(array('trigger' => ($this->getTag('trigger') == 'schedule') ? 'programmation' : $this->getTag('trigger'))); $timeline->save(); } - $_triggerValue = $this->getCache('lastExecutionUser', 'none'); } if ($this->getState() == 'in progress' && $this->getConfiguration('allowMultiInstance', 0) == 0) { return;