Beispiel #1
0
 function getActivateAction(ActivateUser $activateUserCommand, Router $router, Users $eUsers, Response $response)
 {
     $rUser = $eUsers->where('activation', $router->get('activation'))->oneOrFail(new NotFound('User not found. Maybe it was already activated?'));
     return $activateUserCommand->setUser($rUser)->onSuccess(function () use($response) {
         $response->redirect('/auth/activated?succesful');
     })->onError(function () {
         return view('vendor/lfw/auth/src/Pckg/Auth/View/activationFailed');
     })->execute();
 }
Beispiel #2
0
 public function resolve($value)
 {
     $table = $this->router->resolved('table');
     $this->tables->setTable($table->table);
     $this->tables->setRecordClass(DatabaseRecord::class);
     if ($table->repository) {
         $this->tables->setRepository(context()->get(Repository::class . '.' . $table->repository));
     }
     $this->dynamic->joinTranslationsIfTranslatable($this->tables);
     $this->dynamic->joinPermissionsIfPermissionable($this->tables);
     return $this->tables->where('id', $value)->oneOrFail(function () {
         $this->response->unauthorized('Record not found');
     });
 }
Beispiel #3
0
 function getTakeloginAction(Response $response, Router $router)
 {
     $success = $this->auth->useFacebookProvider($this->facebook)->getProvider()->handleTakelogin();
     $response->redirect($success ? '/?success' : $router->make('login') . '?error=fb');
 }
Beispiel #4
0
 /**
  * @param Routes $routes
  * @param Router $router
  */
 public static function addRoutesFromDb(Routes $routes, Router $router)
 {
     if (!$routes->getRepository()->getCache()->hasTable('routes')) {
         return;
     }
     $arrRoutes = $routes->joinTranslation()->all();
     foreach ($arrRoutes as $route) {
         $router->add($route->getRoute(false), ["controller" => GenericController::class, "view" => "generic", 'resolvers' => ['route' => RouteResolver::class]], $route->slug);
     }
 }