/** * Set and update common user status function that must be loaded after each Controller Action. */ protected function initialize() { if ($this->PublisherInfoID != null) { $this->dashboard_home = "publisher"; } $initialized = parent::initialize(); if (!$initialized) { return $initialized; } $route_name = $this->getEvent()->getRouteMatch()->getMatchedRouteName(); if (!$this->is_super_admin && (strpos($route_name, 'publisher') === 0 && $this->PublisherInfoID == null && $this->DemandCustomerInfoID != null)) { return $this->redirect()->toRoute('private-exchange'); } return $initialized; /* * ADD STUFF HERE */ }
/** * Set and update common user status function that must be loaded after each Controller Action. */ protected function initialize() { $is_preview = $this->getRequest()->getQuery('ispreview'); $this->preview_query = $is_preview == true ? "?ispreview=true" : ""; if ($this->DemandCustomerInfoID != null) { $this->dashboard_home = "demand"; } $initialized = parent::initialize(); if (!$initialized) { return $initialized; } $route_name = $this->getEvent()->getRouteMatch()->getMatchedRouteName(); if (!$this->is_admin && (strpos($route_name, 'demand') === 0 && $this->DemandCustomerInfoID == null && $this->PublisherInfoID != null)) { return $this->redirect()->toRoute('publisher'); } return $initialized; /* * ADD STUFF HERE */ }