diff --git a/app/Authentication/Classes/CustomProfile/Repository/CustomProfileRepository.php b/app/Authentication/Classes/CustomProfile/Repository/CustomProfileRepository.php index fc469ac..50bac77 100755 --- a/app/Authentication/Classes/CustomProfile/Repository/CustomProfileRepository.php +++ b/app/Authentication/Classes/CustomProfile/Repository/CustomProfileRepository.php @@ -28,7 +28,7 @@ public static function getAllTypes() public static function addNewType($description) { // firing event for permission handling - Event::fire('customprofile.creating'); + Event::dispatch('customprofile.creating'); $profile_field_type = ProfileFieldType::create(["description" => $description]); return $profile_field_type; @@ -37,7 +37,7 @@ public static function addNewType($description) public static function deleteType($id) { // firing event for permission handling - Event::fire('customprofile.deleting'); + Event::dispatch('customprofile.deleting'); $success = ProfileFieldType::findOrFail($id)->delete(); return $success; diff --git a/app/Authentication/Classes/SentryAuthenticator.php b/app/Authentication/Classes/SentryAuthenticator.php index e4bf12e..a958597 100755 --- a/app/Authentication/Classes/SentryAuthenticator.php +++ b/app/Authentication/Classes/SentryAuthenticator.php @@ -42,7 +42,7 @@ public function check() */ public function authenticate(array $credentials, $remember = false) { - Event::fire('service.authenticating', [$credentials, $remember]); + Event::dispatch('service.authenticating', [$credentials, $remember]); try { @@ -70,7 +70,7 @@ public function authenticate(array $credentials, $remember = false) if(!$this->errors->isEmpty()) throw new AuthenticationErrorException; - Event::fire('service.authenticated', [$credentials, $remember, $user]); + Event::dispatch('service.authenticated', [$credentials, $remember, $user]); } /** @@ -115,9 +115,9 @@ public function loginById($id, $remember = false) */ public function logout() { - Event::fire('service.delogging'); + Event::dispatch('service.delogging'); $this->sentry->logout(); - Event::fire('service.delogged'); + Event::dispatch('service.delogged'); } /** diff --git a/app/Authentication/Commands/InstallCommand.php b/app/Authentication/Commands/InstallCommand.php index 2bd70aa..7ccb22e 100755 --- a/app/Authentication/Commands/InstallCommand.php +++ b/app/Authentication/Commands/InstallCommand.php @@ -47,4 +47,9 @@ public function fire() $this->info('## Laravel Authentication ACL Installed successfully ##'); } + + public function handle() + { + $this->fire(); + } } diff --git a/app/Authentication/Controllers/AuthController.php b/app/Authentication/Controllers/AuthController.php index 829b793..17a952f 100755 --- a/app/Authentication/Controllers/AuthController.php +++ b/app/Authentication/Controllers/AuthController.php @@ -71,7 +71,7 @@ public function postClientLogin(Request $request) /** * Logout utente - * + * * @return string */ public function getLogout() @@ -154,4 +154,4 @@ private function getLoginInput(Request $request) return array($email, $password, $remember); } -} +} \ No newline at end of file diff --git a/app/Authentication/Repository/SentryGroupRepository.php b/app/Authentication/Repository/SentryGroupRepository.php index c32d6a1..4fef720 100755 --- a/app/Authentication/Repository/SentryGroupRepository.php +++ b/app/Authentication/Repository/SentryGroupRepository.php @@ -47,7 +47,7 @@ public function create(array $data) public function update($id, array $data) { $obj = $this->find($id); - Event::fire('repository.updating', [$obj]); + Event::dispatch('repository.updating', [$obj]); $obj->update($data); return $obj; } @@ -61,7 +61,7 @@ public function update($id, array $data) public function delete($id) { $obj = $this->find($id); - Event::fire('repository.deleting', [$obj]); + Event::dispatch('repository.deleting', [$obj]); return $obj->delete(); } diff --git a/app/Authentication/Repository/SentryUserRepository.php b/app/Authentication/Repository/SentryUserRepository.php index 8e937b2..6152e62 100755 --- a/app/Authentication/Repository/SentryUserRepository.php +++ b/app/Authentication/Repository/SentryUserRepository.php @@ -74,7 +74,7 @@ public function update($id, array $data) { $this->ClearEmptyPassword($data); $obj = $this->find($id); - Event::fire('repository.updating', [$obj]); + Event::dispatch('repository.updating', [$obj]); $obj->update($data); return $obj; } diff --git a/app/Authentication/Services/UserRegisterService.php b/app/Authentication/Services/UserRegisterService.php index c216b67..1feddbf 100755 --- a/app/Authentication/Services/UserRegisterService.php +++ b/app/Authentication/Services/UserRegisterService.php @@ -59,7 +59,7 @@ public function __construct(UserSignupValidator $v = null) */ public function register(array $input) { - Event::fire('service.registering', [$input]); + Event::dispatch('service.registering', [$input]); $this->validateInput($input); $input['activated'] = $this->getDefaultActivatedState(); @@ -67,7 +67,7 @@ public function register(array $input) $this->sendRegistrationMailToClient($input); - Event::fire('service.registered', [$input, $user]); + Event::dispatch('service.registered', [$input, $user]); return $user; } @@ -173,7 +173,7 @@ public function checkUserActivationCode($email, $token) } $this->user_repository->activate($email); - Event::fire('service.activated', $user); + Event::dispatch('service.activated', $user); } public function getErrors() diff --git a/app/Http/Middleware/Logged.php b/app/Http/Middleware/Logged.php new file mode 100755 index 0000000..1f03b20 --- /dev/null +++ b/app/Http/Middleware/Logged.php @@ -0,0 +1,19 @@ +check()) return redirect($redirect_url); + + return $next($request); + } +} \ No newline at end of file diff --git a/app/Http/routes.php b/app/Http/routes.php index 586082c..66f52bf 100755 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -32,7 +32,7 @@ ]); Route::post('/login', [ "uses" => 'LaravelAcl\Authentication\Controllers\AuthController@postClientLogin', - "as" => "user.login" + "as" => "user.login.post" ]); /** @@ -124,7 +124,7 @@ 'uses' => 'LaravelAcl\Authentication\Controllers\UserController@editUser' ]); Route::post('/admin/users/edit', [ - 'as' => 'users.edit', + 'as' => 'users.edit.post', 'uses' => 'LaravelAcl\Authentication\Controllers\UserController@postEditUser' ]); Route::get('/admin/users/delete', [ @@ -148,7 +148,7 @@ 'uses' => 'LaravelAcl\Authentication\Controllers\UserController@editProfile' ]); Route::post('/admin/users/profile/edit', [ - 'as' => 'users.profile.edit', + 'as' => 'users.profile.edit.post', 'uses' => 'LaravelAcl\Authentication\Controllers\UserController@postEditProfile' ]); Route::post('/admin/users/profile/addField', [ @@ -180,7 +180,7 @@ 'uses' => 'LaravelAcl\Authentication\Controllers\GroupController@editGroup' ]); Route::post('/admin/groups/edit', [ - 'as' => 'groups.edit', + 'as' => 'groups.edit.post', 'uses' => 'LaravelAcl\Authentication\Controllers\GroupController@postEditGroup' ]); Route::get('/admin/groups/delete', [ @@ -204,7 +204,7 @@ 'uses' => 'LaravelAcl\Authentication\Controllers\PermissionController@editPermission' ]); Route::post('/admin/permissions/edit', [ - 'as' => 'permission.edit', + 'as' => 'permission.edit.post', 'uses' => 'LaravelAcl\Authentication\Controllers\PermissionController@postEditPermission' ]); Route::get('/admin/permissions/delete', [ diff --git a/app/Library/Form/FormModel.php b/app/Library/Form/FormModel.php index 11c0623..3fd863b 100755 --- a/app/Library/Form/FormModel.php +++ b/app/Library/Form/FormModel.php @@ -13,6 +13,7 @@ use LaravelAcl\Library\Exceptions\NotFoundException; use LaravelAcl\Authentication\Exceptions\PermissionException; use Event; +use LaravelAcl\Library\Form\FormInterface as FormInterface; class FormModel implements FormInterface{ @@ -52,7 +53,7 @@ public function process(array $input) { if($this->v->validate($input)) { - Event::fire("form.processing", array($input)); + Event::dispatch("form.processing", array($input)); return $this->callRepository($input); } else diff --git a/app/Library/Repository/EloquentBaseRepository.php b/app/Library/Repository/EloquentBaseRepository.php index e27f9b4..0da7099 100755 --- a/app/Library/Repository/EloquentBaseRepository.php +++ b/app/Library/Repository/EloquentBaseRepository.php @@ -43,7 +43,7 @@ public function create(array $data) public function update($id, array $data) { $obj = $this->find($id); - Event::fire('repository.updating', [$obj]); + Event::dispatch('repository.updating', [$obj]); $obj->update($data); return $obj; } @@ -57,7 +57,7 @@ public function update($id, array $data) public function delete($id) { $obj = $this->find($id); - Event::fire('repository.deleting', [$obj]); + Event::dispatch('repository.deleting', [$obj]); return $obj->delete(); } diff --git a/app/Library/Validators/AbstractValidator.php b/app/Library/Validators/AbstractValidator.php index e7b7326..bf151ee 100755 --- a/app/Library/Validators/AbstractValidator.php +++ b/app/Library/Validators/AbstractValidator.php @@ -19,7 +19,7 @@ abstract class AbstractValidator implements ValidatorInterface public function validate($input) { - Event::fire('validating', [$input]); + Event::dispatch('validating', [$input]); static::$messages = static::$messages ? static::$messages : []; $validator = V::make($input, static::$rules, static::$messages); diff --git a/composer.json b/composer.json index 485f440..9adb8fb 100755 --- a/composer.json +++ b/composer.json @@ -19,10 +19,10 @@ "license": "MIT", "type": "project", "require": { - "laravel/framework": "5.4.*", - "laravelcollective/html" : "5.4.*", + "laravel/framework": ">=8.0.0", + "laravelcollective/html": ">=5.5.0", "intervention/image": "2.*", - "jacopo/authentication-sentry": "3.0.7", + "jacopo/authentication-sentry": "4.0.0", "gregwar/captcha": "1.1.1" }, "require-dev": { @@ -61,5 +61,11 @@ "minimum-stability": "dev", "config": { "preferred-install": "dist" - } + }, + "repositories":[ + { + "type": "vcs", + "url": "https://github.com/newsbytesapp/sentry" + } + ] } diff --git a/readme.md b/readme.md index b7d75db..1b38b2f 100755 --- a/readme.md +++ b/readme.md @@ -1,14 +1,14 @@ laravel-authentication-acl ========================== -[![Build Status](https://travis-ci.org/intrip/laravel-authentication-acl.svg?branch=1.3)](https://travis-ci.org/intrip/laravel-authentication-acl) +[![Build Status](https://travis-ci.org/intrip/laravel-authentication-acl.svg?branch=1.5)](https://travis-ci.org/intrip/laravel-authentication-acl) [![Total Downloads](https://poser.pugx.org/jacopo/laravel-authentication-acl/d/total.svg)](https://packagist.org/packages/jacopo/laravel-authentication-acl) # We are looking for someone to take ownership of this project. Sadly I don't have enough time to maintain it anymore, please get in touch /w me if you are interested. -## This is the Laravel 5.4 Version, for Laravel 5.3 use the version 1.3.*, for Laravel 5.2 use the version 1.3.15, for Laravel 5.1/5.0 use the version 1.3.11, for Laravel4 version use the 1.2 branch +## This is the Laravel 8.0 Version, for Laravel 5.5 use the version 1.5.*, for Laravel 5.4 use the version 1.4.*, for Laravel 5.3 use the version 1.3.*, for Laravel 5.2 use the version 1.3.15, for Laravel 5.1/5.0 use the version 1.3.11, for Laravel4 version use the 1.2 branch -Laravel Authentication ACL is a Laravel 5 package, based on sentry2.
+Laravel Authentication ACL is a Laravel 5+ package, based on sentry2.
This package is made with the purpose of helping other developers to set-up a fully featured admin panel with an ACL using Laravel framework. diff --git a/tests/unit/EloquentPermissionRepositoryTest.php b/tests/unit/EloquentPermissionRepositoryTest.php index 8ccd389..b097ef6 100755 --- a/tests/unit/EloquentPermissionRepositoryTest.php +++ b/tests/unit/EloquentPermissionRepositoryTest.php @@ -77,7 +77,7 @@ public function ifAssociatedToUserThrowsException() public function validateThatPermissionIsNotAssociatedToAnyGroupAndAnyUser_OnRepositoryUpdate() { $false_stub = new FalseGetterStub; - Event::fire('repository.updating', [$false_stub]); + Event::dispatch('repository.updating', [$false_stub]); } /** @@ -86,7 +86,7 @@ public function validateThatPermissionIsNotAssociatedToAnyGroupAndAnyUser_OnRepo public function validateThatPermissionIsNotAssociatedToAnyGroupAndAnyUser_OnRepositoryDelete() { $false_stub = new FalseGetterStub; - Event::fire('repository.deleting', [$false_stub]); + Event::dispatch('repository.deleting', [$false_stub]); } protected function getModelGroupStub()