public function bind(\Nethgui\Controller\RequestInterface $request) { parent::bind($request); $curAction = $this->establishCurrentActionId(); $action = $this->getAction($curAction); if ($action instanceof \Nethgui\Module\ModuleInterface && !isset($action->wizardPosition)) { throw new \Nethgui\Exception\HttpException('Not found', 404, 1420822725); } }
public function bind(\Nethgui\Controller\RequestInterface $request) { $userName = $request->getUser()->getCredential('username'); if ($userName === 'admin' && $this->getPlatform()->getDatabase('accounts')->getType('admin') !== 'user') { # Fake admin user, fallback to root. $userName = '******'; } // The root user needs a different data source: if ($userName === 'root') { $this->adapter = $this->getPlatform()->getTableAdapter('configuration', 'configuration'); } else { $this->adapter = $this->getPlatform()->getTableAdapter('accounts', 'user'); } // Inject username-dependent datasource into the record adapter $this->recordAdapter->setTableData($this->adapter)->setKeyValue($userName); parent::bind($request); }