/**
  * Activate an organization of type customer
  */
 public function activateAction()
 {
     if (!$this->getRequest()->isPost()) {
         throw new AppEx\UnexpectedException("Resquest must be POST");
     }
     $org = $this->_getOrganization();
     // Check permissions
     $this->_helper->allowed('activate', $org);
     // Fix customer
     if (isset($org->trialDuration)) {
         unset($org->trialDuration);
     }
     $result = $this->_orgSrv->activate($org);
     $this->view->data = $result;
 }
Пример #2
0
 public function testOrgCustomerActivation()
 {
     $this->_service->deactivate(self::CUSTOMER_ORG_ID);
     $result = $this->_service->activate(self::CUSTOMER_ORG_ID);
     $this->assertNotNull($result);
     $this->assertEquals($result, self::CUSTOMER_ORG_ID);
 }
 public function testActivate()
 {
     // Persist the org model
     $this->_org->save();
     $this->_service->deactivate($this->_org->getId());
     $org = $this->_service->load($this->_org->getId());
     $this->assertEquals($org->status, OrgAggregatorModel::ORG_STATUS_DEACTIVATED);
     $this->_service->activate($this->_org->getId());
     $org = $this->_service->load($this->_org->getId());
     $this->assertEquals($org->status, OrgAggregatorModel::ORG_STATUS_ACTIVATED);
 }