Ejemplo n.º 1
0
 case '-h':
     print 'Usage: php innomatic/core/scripts/tenant.php command argument' . "\n";
     print "\n";
     print 'Supported commands:' . "\n";
     print '    create tenantname description pwd  Creates a new tenant' . "\n";
     print '    remove tenantname                  Removes a tenant' . "\n";
     print '    enable tenantname                  Enables a disabled tenant' . "\n";
     print '    disable tenantname                 Disables a tenant' . "\n";
     print '    applist tenantname                 Retrieves a list of enabled applications' . "\n";
     print '    appenable tenantname application   Disables a tenant' . "\n";
     print '    appdisable tenantname application  Disables a tenant' . "\n";
     $script->cleanExit();
     break;
 case 'enable':
     $tenant = new \Innomatic\Domain\Domain(InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $argv[2], null);
     if ($tenant->enable()) {
         print "Tenant {$argv['2']} enabled\n";
         $script->cleanExit();
     } else {
         print "Tenant {$argv['2']} not enabled\n";
         $script->cleanExit(1);
     }
     break;
 case 'disable':
     $tenant = new \Innomatic\Domain\Domain(InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $argv[2], null);
     if ($tenant->disable()) {
         print "Tenant {$argv['2']} disabled\n";
         $script->cleanExit();
     } else {
         print "Tenant {$argv['2']} not disabled\n";
         $script->cleanExit(1);
 public function executeEnabledomain($eventData)
 {
     $null = null;
     $domain = new \Innomatic\Domain\Domain(\Innomatic\Core\InnomaticContainer::instance('\\Innomatic\\Core\\InnomaticContainer')->getDataAccess(), $eventData['domainid'], $null);
     if ($domain->enable()) {
         $this->status = $this->localeCatalog->getStr('domainenabled_status');
     } else {
         $this->status = $this->localeCatalog->getStr('domainnotenabled_status');
     }
     $this->setChanged();
     $this->notifyObservers('status');
 }