/**
  * Register the routes required for this module.
  * @param Router $router
  * @return void
  */
 public function setRoutes(Router $router)
 {
     $router->match('GET|POST', $this->routepath . '/login', '\\CatLab\\OpenIDClient\\Controllers\\LoginController@login');
     $router->match('GET|POST', $this->routepath . '/login/next', '\\CatLab\\OpenIDClient\\Controllers\\LoginController@next');
     $router->get($this->routepath . '/logout', '\\CatLab\\OpenIDClient\\Controllers\\LoginController@logout');
     $router->get($this->routepath . '/status', '\\CatLab\\OpenIDClient\\Controllers\\LoginController@status');
 }
Example #2
0
 /**
  * @param Request $request
  * @throws DataNotSet
  */
 public function dispatch(Request $request = null)
 {
     if ($this->isFirstDispatch) {
         $this->isFirstDispatch = false;
         $this->trigger('dispatch:first');
     }
     // Trigger initialize
     $this->trigger('dispatch:initialize');
     // Check locales
     $this->checkLocale();
     if (!isset($this->router)) {
         throw new DataNotSet("Application needs a router.");
     }
     if (!isset($request)) {
         $request = Request::fromInput();
     }
     // Set session from the session handler
     $session = new Session($this->getSessionHandler());
     $session->connect();
     // Set session in request
     $request->setSession($session);
     // Trigger before
     $this->trigger('dispatch:before', $request);
     // Run router
     $this->router->run($request);
     // Trigger dispatch
     $this->trigger('dispatch:after', $request);
     // Disconnect the session
     $session->disconnect();
     // End
     $this->trigger('dispatch:terminate');
 }
Example #3
0
 /**
  * Register the routes required for this module.
  * @param \Neuron\Router $router
  * @return void
  */
 public function setRoutes(\Neuron\Router $router)
 {
     $router->get('/', 'Pages_Home@getHTML');
     $router->get('/about/{a?}/{b?}/{c?}/{d?}', 'Pages_About@getHTML');
     $router->match('POST|GET', '/home/{a?}/{b?}/{c?}/{d?}', 'Pages_Home@getHTML');
     $router->match('POST|GET', '/register/{a?}/{b?}/{c?}/{d?}', 'Pages_Register@getHTML');
     $router->match('POST|GET', '/welcome/{a?}/{b?}/{c?}/{d?}', 'Pages_Welcome@getHTML');
     $router->match('POST|GET', '/company/{a?}/{b?}/{c?}/{d?}', 'Pages_Company@getHTML');
     $router->match('POST|GET', '/donate/{a?}/{b?}/{c?}/{d?}', 'Pages_Donate@getHTML');
     $router->match('POST|GET', '/order/{a?}/{b?}/{c?}/{d?}', 'Pages_Order@getHTML');
     $router->match('POST|GET', '/shop/{a?}/{b?}/{c?}/{d?}', 'Pages_Shop@getHTML');
     $router->match('POST|GET', '/lostPassword/{a?}/{b?}/{c?}/{d?}', 'Pages_LostPassword@getHTML');
 }
Example #4
0
 public function setRoutes(Router $router)
 {
     // Add filter
     $router->addFilter('oauth2', array($this, 'routerVerifier'));
     $router->match('GET|POST', $this->routepath . '/setup', '\\CatLab\\OAuth2\\Controllers\\RegisterController@setup');
     // And register
     $router->match('GET|POST', $this->routepath . '/authorize/{param?}', '\\CatLab\\OAuth2\\Controllers\\AuthorizeController@authorize');
     $router->match('GET|POST', $this->routepath . '/register', '\\CatLab\\OAuth2\\Controllers\\RegisterController@register');
     $router->match('GET|POST', $this->routepath . '/token', '\\CatLab\\OAuth2\\Controllers\\AuthorizeController@token');
 }
Example #5
0
 public static function addFilter(\Neuron\Router $router)
 {
     $checker = new self(\Neuron\Config::get('auth.users'));
     $router->addFilter('basicauth', array($checker, 'check'));
 }
Example #6
0
 /**
  * Register the routes required for this module.
  * @param Router $router
  * @return mixed
  */
 public function setRoutes(Router $router)
 {
     // Filter
     $router->addFilter('authenticated', array($this, 'routerVerifier'));
     // Routes
     $router->match('GET|POST', $this->routepath . '/login/{authenticator}', '\\CatLab\\Accounts\\Controllers\\LoginController@authenticator');
     $router->match('GET', $this->routepath . '/login', '\\CatLab\\Accounts\\Controllers\\LoginController@login');
     $router->match('GET', $this->routepath . '/welcome', '\\CatLab\\Accounts\\Controllers\\LoginController@welcome')->filter('authenticated');
     $router->match('GET|POST', $this->routepath . '/notverified', '\\CatLab\\Accounts\\Controllers\\LoginController@requiresVerification');
     $router->match('GET', $this->routepath . '/logout', '\\CatLab\\Accounts\\Controllers\\LoginController@logout');
     $router->match('GET', $this->routepath . '/cancel', '\\CatLab\\Accounts\\Controllers\\LoginController@cancel');
     $router->match('GET|POST', $this->routepath . '/register/{authenticator}', '\\CatLab\\Accounts\\Controllers\\RegistrationController@authenticator');
     $router->match('GET|POST', $this->routepath . '/register', '\\CatLab\\Accounts\\Controllers\\RegistrationController@register');
     $router->get($this->routepath . '/verify/{id}', '\\CatLab\\Accounts\\Controllers\\LoginController@verify');
 }