function action_deactivateapplication($eventData) { global $gLocale, $gLocale, $gStatus; $domainQuery = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT domainid FROM domains WHERE id = ' . $eventData['domainid']); if ($domainQuery) { $domainData = $domainQuery->getFields(); $domain = new \Innomatic\Domain\Domain(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $domainData['domainid'], $null); if (!$domain->disableApplication($eventData['appid'])) { $unmetDeps = $domain->getLastActionUnmetDeps(); if (count($unmetDeps)) { while (list(, $dep) = each($unmetDeps)) { $unmetDepsStr .= ' ' . $dep; } $gStatus .= $gLocale->getStr('modnotdisabled_status') . ' '; $gStatus .= $gLocale->getStr('disunmetdeps_status') . $unmetDepsStr . '.'; } } else { $gStatus .= $gLocale->getStr('moddisabled_status'); } } }
break; case 'appenable': $tenant = new \Innomatic\Domain\Domain(InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $argv[2], null); $appid = \Innomatic\Application\Application::getAppIdFromName($argv[3]); if ($tenant->enableApplication($appid)) { print "Application {$argv['3']} enabled to tenant {$argv['2']}\n"; $script->cleanExit(); } else { print "Application {$argv['3']} not enabled to tenant {$argv['2']}\n"; $script->cleanExit(1); } break; case 'appdisable': $tenant = new \Innomatic\Domain\Domain(InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $argv[2], null); $appid = \Innomatic\Application\Application::getAppIdFromName($argv[3]); if ($tenant->disableApplication($appid)) { print "Application {$argv['3']} disabled from tenant {$argv['2']}\n"; $script->cleanExit(); } else { print "Application {$argv['3']} not disabled from tenant {$argv['2']}\n"; $script->cleanExit(1); } break; default: print 'Usage: php innomatic/core/scripts/tenant.php command' . "\n"; print 'Type tenant.php -h for a list of supported commands' . "\n"; } } catch (\Exception $e) { echo $e; } $script->cleanExit();
public function executeDeactivateapplication($eventData) { $domainQuery = \Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess()->execute('SELECT domainid FROM domains WHERE id = ' . $eventData['domainid']); if ($domainQuery) { $domainData = $domainQuery->getFields(); $null = null; $domain = new \Innomatic\Domain\Domain(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $domainData['domainid'], $null); if (!$domain->disableApplication($eventData['appid'])) { $unmetDeps = $domain->getLastActionUnmetDeps(); if (count($unmetDeps)) { while (list(, $dep) = each($unmetDeps)) { $unmetDepsStr .= ' ' . $dep; } $this->status .= $this->localeCatalog->getStr('modnotdisabled_status') . ' '; $this->status .= $this->localeCatalog->getStr('disunmetdeps_status') . $unmetDepsStr . '.'; } } else { $this->status .= $this->localeCatalog->getStr('moddisabled_status'); } } $this->setChanged(); $this->notifyObservers('status'); }