Example #1
0
File: Auth.php Project: pckg/auth
 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();
 }
Example #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');
     });
 }
Example #3
0
 public function resolve($value)
 {
     $this->dynamic->joinTranslationsIfTranslatable($this->tables);
     $this->dynamic->joinPermissionsIfPermissionable($this->tables);
     return $this->tables->where('id', $value)->withFields(function (HasMany $fields) {
         $fields->joinTranslation();
         $fields->joinFallbackTranslation();
         $fields->withFieldType();
         $fields->withSettings();
     })->withTabs(function (HasMany $tabs) {
         $tabs->joinTranslation();
         $tabs->joinFallbackTranslation();
     })->oneOrFail(function () {
         $this->response->unauthorized('Table not found');
     });
 }
Example #4
0
 function getTakeloginAction(Response $response, Router $router)
 {
     $success = $this->auth->useFacebookProvider($this->facebook)->getProvider()->handleTakelogin();
     $response->redirect($success ? '/?success' : $router->make('login') . '?error=fb');
 }
Example #5
0
 /**
  * Respond with code 400, redirect to get action
  */
 protected function postErrorResponse()
 {
     $this->flash->set('form', 'Invalid data posted, check data and resubmit form');
     return $this->response->code(400)->redirect();
 }